[tao-bugs] [TAO] Changing interface status after startup cause incomplete IOR
Schuele, Benjamin
Benjamin.Schuele at karlstorz.com
Fri Aug 28 03:21:43 CDT 2015
TAO VERSION: 2.2.0
ACE VERSION: 6.2.0
HOST MACHINE and OPERATING SYSTEM:
Ubuntu 14.04.3 LTS
THE $ACE_ROOT/ace/config.h FILE
#include "ace/config-linux.h"
COMPILER NAME AND VERSION (AND PATCHLEVEL):
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE
cross_compile=1
shared_libs=1
static_libs=0
debug=1
optimize=0
inline=1
ssl=0
no_hidden_visibility=1
TAO_IDL = /home/..../bin/tao_idl
include $ACE_ROOT/include/makeinclude/platform_linux.GNU
TAO_IDL_PREPROCESSOR = /usr/bin/g++
AREA/CLASS/EXAMPLE AFFECTED:
TAO/examples/Simple/chat
DOES THE PROBLEM AFFECT:
COMPILATION?
no
LINKING?
no
EXECUTION?
yes
SYNOPSIS:
If a computer running a corba program get an IP (over DHCP) after object generation, the IOR send to other computers misses the new IP.
DESCRIPTION:
We have a simple network device and a PC program talking each other with corba. In order to work without name resolution, we use the "-ORBDottedDecimalAddresses 1" option. If the user power up the device and connecting the network cable after the software is started, all GIOP call from the device sending an IOR to the computer misses the new IP. This cause the computer program to not be able to use this object pointer.
REPEAT BY:
I was able to reproduce the exact same behavior with the a slightly patched (see patch blow) chat example on two computers. The steps to reproduce are:
1. start server on computer A with: ./server -ORBObjRefStyle URL -ORBDottedDecimalAddresses 1 -o /media/exchange/chat.ior.txt
2. copy the chat.ior.txt to computer B
3. disconnect the network to the computer B
4. start the client on computer B with: ./client -n remote -ORBDottedDecimalAddresses 1 -ORBObjRefStyle URL -f ./chat.ior.txt
5. reconnect the network to the computer B
6. enter a chat message
Below you see the error i got on the server. Interestingly the client started on A sees the chat messages from the client on B, but the client on B receives no chat messages at all from the server. The captured GIOP packet below is the "add" call from the client on B to the server on A.
SAMPLE FIX/WORKAROUND:
nothing, no idea where the bad things happens in the code.
----------------------------------- error message --------------------------------------------
(28014|140705385342784) EXCEPTION, Failed to send a message
system exception, ID 'IDL:omg.org/CORBA/TRANSIENT:1.0'
OMG minor code (2), described as 'No usable profile in IOR.', completed = NO
----------------------------------- GIOP add call ---------------------------------------------
0000 47 49 4f 50 01 02 01 00 b3 00 00 00 02 00 00 00 GIOP............
0010 03 00 00 00 00 00 00 00 1b 00 00 00 14 01 0f 00 ................
0020 52 53 54 62 c0 de 55 38 db 01 00 00 00 00 00 01 RSTb..U8........
0030 00 00 00 01 00 00 00 00 04 00 00 00 61 64 64 00 ............add.
0040 00 00 00 00 00 00 00 00 11 00 00 00 49 44 4c 3a ............IDL:
0050 52 65 63 65 69 76 65 72 3a 31 2e 30 00 2e 30 00 Receiver:1.0..0.
0060 01 00 00 00 00 00 00 00 48 00 00 00 01 01 02 00 ........H.......
0070 0a 00 00 00 31 32 37 2e 30 2e 30 2e 31 00 31 cf ....127.0.0.1.1.
0080 1b 00 00 00 14 01 0f 00 52 53 54 1b de de 55 a8 ........RST...U.
0090 ee 07 00 00 00 00 00 01 00 00 00 01 00 00 00 00 ................
00a0 01 00 00 00 00 00 00 00 08 00 00 00 01 27 ce c1 .............'..
00b0 00 4f 41 54 07 00 00 00 72 65 6d 6f 74 65 00 .OAT....remote.
--------------------------------------- chat.patch -----------------------------------------------------------
--- ACE_wrappers.org/TAO/examples/Simple/chat/Client_i.cpp
+++ ACE_wrappers/TAO/examples/Simple/chat/Client_i.cpp
@@ -94,22 +94,37 @@
this->ior_file_name_),
-1);
- CORBA::Object_var server_object =
- orb->string_to_object (this->ior_.c_str ());
-
- if (CORBA::is_nil (server_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("invalid ior <%C>\n"),
- this->ior_.c_str ()),
- -1);
-
- this->server_ = Broadcaster::_narrow (server_object.in ());
- if (CORBA::is_nil (this->server_.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Nil Server\n")),
- -1);
- }
+ bool gotException;
+ do
+ {
+ try
+ {
+ CORBA::Object_var server_object =
+ orb->string_to_object (this->ior_.c_str ());
+
+ if (CORBA::is_nil (server_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("invalid ior <%C>\n"),
+ this->ior_.c_str ()),
+ -1);
+
+ this->server_ = Broadcaster::_narrow (server_object.in ());
+ if (CORBA::is_nil (this->server_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Nil Server\n")),
+ -1);
+ }
+ gotException = false;
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("client_i::init\n");
+ gotException = true;
+ }
+ }
+ while(gotException);
+
}
catch (const CORBA::Exception& ex)
{
--------------------------------------- chat.patch -----------------------------------------------------------
More information about the tao-bugs
mailing list