Discussion:
[omniORB] nameServer Connection - localhost vs. 127.0.0.1
Michael Jäntsch
2009-06-17 22:50:48 UTC
Permalink
Hello everyone,

I am using a piece of software that is using omniOrb. Everything was working
fine until I moved to a different PC. The whole thing crashed on me. Both

PCs are running Ubuntu 9.04 and I believe I have about the same packages
installed.
I have narrowed down the problem but I am kind of stuck on the exact
reason. Maybe someone can help me with this here!?

The problem is that with the attached source code I am not able to connect
to my omniNames server, using localhost as a server location. omniNames is
up and running and I can connect to it using 127.0.0.1. This seems really
strange to me for I always thought the two are equivalent.
This is no problem on my first PC but only on my second. It must be some
kind of setup problem.

I already checked to standards:
loopback interface is up and runnding
/etc/hosts contains: 127.0.0.1 localhost
I can ping localhost

Can somebody please help me with this? Would be really nice...

regards
Michael J?ntsch


-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 755 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090617/6cf3879f/main.bin
Michael Jäntsch
2009-06-18 18:15:33 UTC
Permalink
Hi,

ok, I now found the problem.

For those who are interested:
The PC where it did not work was set up to use ipv6 for localhost
::1 localhost ip6-localhost ip6-loopback (in /etc/hosts)

I am not sure why that made the whole communication break but it did.
Maybe some problem with omniOrb and ipv6???

regards
Michael J?ntsch
Post by Michael Jäntsch
Hello everyone,
I am using a piece of software that is using omniOrb. Everything was working
fine until I moved to a different PC. The whole thing crashed on me. Both
PCs are running Ubuntu 9.04 and I believe I have about the same packages
installed.
I have narrowed down the problem but I am kind of stuck on the exact
reason. Maybe someone can help me with this here!?
The problem is that with the attached source code I am not able to connect
to my omniNames server, using localhost as a server location.
omniNames is
up and running and I can connect to it using 127.0.0.1. This seems really
strange to me for I always thought the two are equivalent.
This is no problem on my first PC but only on my second. It must be some
kind of setup problem.
loopback interface is up and runnding
/etc/hosts contains: 127.0.0.1 localhost
I can ping localhost
Can somebody please help me with this? Would be really nice...
regards
Michael J?ntsch
------------------------------------------------------------------------
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
Duncan Grisby
2009-06-18 18:21:04 UTC
Permalink
Post by Michael Jäntsch
ok, I now found the problem.
The PC where it did not work was set up to use ipv6 for localhost
::1 localhost ip6-localhost ip6-loopback (in /etc/hosts)
I am not sure why that made the whole communication break but it did.
Maybe some problem with omniOrb and ipv6???
IPv6 should work fine on Linux.

Please can you send a trace from traceLevel 25 from both omniNames and
your client code on the machine that's failing?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Michael Jäntsch
2009-06-18 18:52:14 UTC
Permalink
I attached the traces of the test program when it was not working

sudo omniNames -ORBtraceLevel 25 2> omniNames.trace
./omniNamesTest -ORBtraceLevel 25 2>omniNamesTest.trace

regards
Michael
Post by Duncan Grisby
Post by Michael Jäntsch
ok, I now found the problem.
The PC where it did not work was set up to use ipv6 for localhost
::1 localhost ip6-localhost ip6-loopback (in /etc/hosts)
I am not sure why that made the whole communication break but it did.
Maybe some problem with omniOrb and ipv6???
IPv6 should work fine on Linux.
Please can you send a trace from traceLevel 25 from both omniNames and
your client code on the machine that's failing?
Cheers,
Duncan.
-------------- next part --------------
omniORB: Read from configuration file "/etc/omniORB4.cfg".
omniORB: Version: 4.1.2
omniORB: Distribution date: Thu Feb 14 14:19:08 GMT 2008 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 131.159.61.56
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB: DefaultInitRef (file) = corbaloc::
omniORB: DefaultInitRef (args) =
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB4.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::2809
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 180
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 5
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 120
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = -1
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 0
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::2809'
omniORB: Bind to address 0.0.0.0
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:131.159.61.56:2809
omniORB: Publish endpoint 'giop:tcp:131.159.61.56:2809'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:131.159.61.56:2809
omniORB: Persistent server identifier: 2b48364a010041e0
omniORB: Adding key<NameService> (activating) to object table.
omniORB: State key<NameService> (activating) -> active
omniORB: Adding root/<8e293a4a01000ae8/0> (activating) to object table.
omniORB: State root/<8e293a4a01000ae8/0> (activating) -> active
omniORB: Creating ref to local: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating ref to local: root/<8e293a4a01000ae8/0>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: ObjRef(IDL:omg.org/CosNaming/NamingContextExt:1.0) -- deleted.
omniORB: Creating ref to local: root/<8e293a4a01000ae8/0>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating ref to remote: root<1>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:openrtm.aist.go.jp/RTC/DataFlowComponent:1.0
omniORB: ObjRef(IDL:omg.org/CosNaming/NamingContextExt:1.0) -- deleted.

Thu Jun 18 14:45:47 2009:

Read log file successfully.
omniORB: Creating ref to local: key<NameService>
target id : IDL:omg.org/CosNaming/NamingContextExt:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000070000000010102000e0000003133312e3135392e36312e353600f90a0b0000004e616d6553657276696365000300000000000000080000000100000000545441010000001c0000000100000001000100010000000100010509010100010000000901010003545441080000002b48364a010041e0
Checkpointing Phase 1: Prepare.
omniORB: createLocalObjRef -- reusing reference from local ref list.
omniORB: createLocalObjRef -- reusing reference from local ref list.
Checkpointing Phase 2: Commit.
Checkpointing completed.
omniORB: SocketCollection idle. Sleeping.
-------------- next part --------------
omniORB: Read from configuration file "/etc/omniORB4.cfg".
omniORB: Version: 4.1.2
omniORB: Distribution date: Thu Feb 14 14:19:08 GMT 2008 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 131.159.61.56
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB: DefaultInitRef (file) = corbaloc::
omniORB: DefaultInitRef (args) =
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB4.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 180
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 5
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 120
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = -1
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 0
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: Trying to resolve initial reference `NameService'
with configuration file default `corbaloc::/NameService'
omniORB: Creating ref to remote: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Initial reference `NameService' resolved with configuration file ORBDefaultInitRef prefix.
omniORB: Client attempt to connect to giop:tcp:localhost:2809
omniORB: Switch rope to use address giop:tcp:localhost:2809
omniORB: Unable to open new connection: giop:tcp:localhost:2809
omniORB: throw giopStream::CommFailure from giopStream.cc:1148(0,NO,TRANSIENT_ConnectFailed)
omniORB: throw TRANSIENT from omniObjRef.cc:789 (NO,TRANSIENT_ConnectFailed)
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ORB not destroyed; no final clean-up.
Ando Noriaki
2009-07-08 14:17:38 UTC
Permalink
Hello

I faced same problem on Ubuntu 9.04 and omniORB-4.1.3.
From Ubuntu 9.04, IPv6 is disabled in default settings.
I have some question as follows.

1. LibcWrapper::getAddrInfo() returns multiple address infomation
including ipv6 (localhost as ::1) address and ipv4 (localhost as 127.0.0.1)
address on the Ubuntu 9.04. (order: ipv6->ipv4)

2. However tcpAddress::Connect() tries to connect to only the first
ipv6 address.
Is there loop for multiple addresses which returned by getaddrinfo()?

3. I modified tcpAddress::Connect() and added tcpAddress::tryConnect()
functions as follows. (see also attached patch) This works well at least
in my environment. How do you think about it?

<pseudo code>
giopActiveConnection* tcpAddress::Connect(...) {
AddrInfo* ai0 =getAddrInfo(); // this returns multiple addresses

for (AddrInfo* ai = ai0; ai != 0; ai = ai->next()) {
giopActiveConnection* connection = tryConnect(ai, ...);
if (connection != 0) return connection;
}
return 0;
}

tcpAddress::tryConnect() is almost same as original tcpAddress::Connect()

4. sslAddress::Connect() and unixAddress::Connect() might need same patch?

Best regards,
Noriaki Ando
Post by Michael Jäntsch
ok, I now found the problem.
The PC where it did not work was set up to use ipv6 for localhost
::1 ? ? localhost ip6-localhost ip6-loopback (in /etc/hosts)
I am not sure why that made the whole communication break but it did.
Maybe some problem with omniOrb and ipv6???
IPv6 should work fine on Linux.
Please can you send a trace from traceLevel 25 from both omniNames and
your client code on the machine that's failing?
Cheers,
Duncan.
--
?-- Duncan Grisby ? ? ? ? --
? -- http://www.grisby.org --
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
--
Noriaki Ando, Ph.D.
National Institute of Advanced Industrial Science and Technology
Intelligent Systems Research Institute
Tsukuba Central 2, 1-1-1 Umezono, Tsukuba, Ibaraki 305-8568 JAPAN.
TEL: +81-29-861-5981 FAX: +81-29-861-5971
e-mail: n-***@aist.go.jp, n-***@ieee.org
RT-Middleware: http://www.openrtm.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORB4_getaddrinfo_ipv6.patch
Type: application/octet-stream
Size: 2284 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090708/a206f4c1/omniORB4_getaddrinfo_ipv6.obj
Duncan Grisby
2009-07-08 22:25:56 UTC
Permalink
On Wednesday 8 July, Ando Noriaki wrote:

[...]
Post by Ando Noriaki
3. I modified tcpAddress::Connect() and added tcpAddress::tryConnect()
functions as follows. (see also attached patch) This works well at least
in my environment. How do you think about it?
Something equivalent is already in CVS, and will be in omniORB 4.1.4.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...