I running the example "Echo" but there are errors occured. Here is my trace log.<br>Could you please help me to solve the problems? <br>Any help will be greatly appreciate!<br><br>Thanks and Best regards,<br><br>
Running:<br>$./echo<br><br><span style="font-weight: bold;">CODE</span><br><br>#include <iostream><br>#include "echo.hh"<br>using namespace std;<br><br>class Echo_i : public POA_Echo{<br>public:<br> inline Echo_i(){};
<br> inline ~Echo_i(){};<br> virtual char* echoString(const char* mesg);<br>};<br><br>char * Echo_i::echoString(const char* mesg){<br> return "Hello world";<br>};<br><br>static void hello(Echo_ptr e)<br>
{<br> if( CORBA::is_nil(e) ) {<br> cerr << "hello: The object reference is nil!\n" << endl;<br> return;<br> }<br> CORBA::String_var src = (const char*) "Hello!";<br> // String literals are (char*) rather than (const char*) on some
<br> // old compilers. Thus it is essential to cast to (const char*)<br> // here to ensure that the string is copied, so that the<br> // CORBA::String_var does not attempt to \u2019delete\u2019 the string<br> // literal.
<br> CORBA::String_var dest = e->echoString(src);<br> cout << "I said, \"" << (char*)src << "\"." << endl<br> << "The Echo object replied, \"" << (char*)dest <<"\"." << endl;
<br>};<br><br><br>int main(int argc, char *argv[]){<br> try {<br> // Initialise the ORB.<br> CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);<br> // Obtain a reference to the root POA.<br> //CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
<br> CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");<br> PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);<br> // We allocate the object on the heap. Since this is a reference
<br> // counted object, it will be deleted by the POA when it is no<br> // longer needed.<br> Echo_i* myecho = new Echo_i();<br> // Activate the object. This tells the POA that this object is<br> // ready to accept requests.
<br> PortableServer::ObjectId_var myechoid = poa->activate_object(myecho);<br> // Obtain a reference to the object.<br> Echo_var myechoref = myecho->_this();<br> // Decrement the reference count of the object implementation, so
<br> // that it will be properly cleaned up when the POA has determined<br> // that it is no longer needed.<br> myecho->_remove_ref();<br> // Obtain a POAManager, and tell the POA to start accepting<br> // requests on its objects.
<br> PortableServer::POAManager_var pman = poa->the_POAManager();<br> pman->activate();<br> // Do the client-side call.<br> hello(myechoref);<br> // Clean up all the resources.<br> orb->destroy();<br>}<br> catch(CORBA::SystemException& ex) {
<br> cerr << "Caught CORBA::" << ex._name() << endl;<br> }<br> catch(CORBA::Exception& ex) {<br> cerr << "Caught CORBA::Exception: " << ex._name() << endl;
<br> }<br> catch(omniORB::fatalException& fe) {<br> cerr << "Caught omniORB::fatalException:" << endl;<br> cerr << " file: " << fe.file() << endl;
<br> cerr << " line: " << fe.line() << endl;<br> cerr << " mesg: " << fe.errmsg() << endl;<br> }<br> cout << "Hello world";<br>
return 0;<br>};<br><br><span style="font-weight: bold;">TRACE LOG</span><br>omniORB: (0) 2007-02-19 23:30:21.586723: Distribution date: Tue Nov 28 13:27:23 GMT 2006 dgrisby<br>omniORB: (0) 2007-02-19 23:30:21.587388: My addresses are:
<br>omniORB: <a href="http://127.0.0.1">127.0.0.1</a><br>omniORB: <a href="http://192.168.1.5">192.168.1.5</a><br>omniORB: ::1<br>omniORB: (0) 2007-02-19 23:30:21.587681: Maximum supported GIOP version is 1.2<br>omniORB: (0) 2007-02-19 23:30:
21.587922: Native char code sets: ISO-8859-1 UTF-8.<br>omniORB: (0) 2007-02-19 23:30:21.588065: 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).<br>omniORB: (0) 2007-02-19 23:30:
21.588175: Native wide char code sets: UTF-16.<br>omniORB: (0) 2007-02-19 23:30:21.588296: Transmission wide char code sets: UTF-16(1.2).<br>omniORB: (0) 2007-02-19 23:30:21.588438: Information: the omniDynamic library is not linked.
<br>omniORB: (0) 2007-02-19 23:30:21.588807: Current configuration is as follows:<br>omniORB: DefaultInitRef (file) = <br>omniORB: DefaultInitRef (args) = <br>omniORB: InitRef = NameService=IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000060000000010102000c0000003139322e3136382e312e3500f90a00000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
<br>omniORB: abortOnInternalError = 0<br>omniORB: abortOnNativeException = 0<br>omniORB: acceptBiDirectionalGIOP = 0<br>omniORB: acceptMisalignedTcIndirections = 0<br>omniORB: bootstrapAgentHostname = <br>omniORB: bootstrapAgentPort = 900
<br>omniORB: clientCallTimeOutPeriod = 0<br>omniORB: clientConnectTimeOutPeriod = 0<br>omniORB: clientTransportRule = * unix,ssl,tcp<br>omniORB: configFile = /etc/omniORB.cfg<br>omniORB: connectionWatchImmediate = 0
<br>omniORB: connectionWatchPeriod = 50000<br>omniORB: copyValuesInLocalCalls = 1<br>omniORB: diiThrowsSysExceptions = 0<br>omniORB: dumpConfiguration = 1<br>omniORB: endPoint = giop:tcp::<br>omniORB: endPointPublish = addr
<br>omniORB: giopMaxMsgSize = 2097152<br>omniORB: giopTargetAddressMode = KeyAddr<br>omniORB: id = omniORB4<br>omniORB: idleThreadTimeout = 10<br>omniORB: inConScanPeriod = 180<br>omniORB: lcdMode = 0<br>omniORB: maxGIOPConnectionPerServer = 5
<br>omniORB: maxGIOPVersion = 1.2<br>omniORB: maxInterleavedCallsPerConnection = 5<br>omniORB: maxServerThreadPerConnection = 100<br>omniORB: maxServerThreadPoolSize = 100<br>omniORB: maxSocketRecv = 2147483647<br>
omniORB: maxSocketSend = 2147483647<br>omniORB: nativeCharCodeSet = ISO-8859-1<br>omniORB: nativeWCharCodeSet = UTF-16<br>omniORB: objectTableSize = 0<br>omniORB: offerBiDirectionalGIOP = 0<br>omniORB: oneCallPerConnection = 1
<br>omniORB: outConScanPeriod = 120<br>omniORB: poaHoldRequestTimeout = 0<br>omniORB: poaUniquePersistentSystemIds = 1<br>omniORB: principal = [Null]<br>omniORB: scanGranularity = 5<br>omniORB: serverCallTimeOutPeriod = 0
<br>omniORB: serverTransportRule = * unix,ssl,tcp<br>omniORB: strictIIOP = 1<br>omniORB: supportBootstrapAgent = 0<br>omniORB: supportCurrent = 1<br>omniORB: supportPerThreadTimeOut = 0<br>omniORB: tcAliasExpand = 0
<br>omniORB: threadPerConnectionLowerLimit = 9000<br>omniORB: threadPerConnectionPolicy = 1<br>omniORB: threadPerConnectionUpperLimit = 10000<br>omniORB: threadPoolWatchConnection = 1<br>omniORB: traceExceptions = 1
<br>omniORB: traceFile = [stderr]<br>omniORB: traceInvocationReturns = 1<br>omniORB: traceInvocations = 1<br>omniORB: traceLevel = 40<br>omniORB: traceThreadId = 1<br>omniORB: traceTime = 1<br>omniORB: unixTransportDirectory = /tmp/omni-%u
<br>omniORB: unixTransportPermission = 777<br>omniORB: useTypeCodeIndirections = 1<br>omniORB: verifyObjectExistsAndType = 1<br>omniORB: (0) 2007-02-19 23:30:21.589361: Initialising incoming endpoints.<br>omniORB: (0) 2007-02-19 23:30:
21.589529: Instantiate endpoint 'giop:tcp::0'<br>omniORB: (0) 2007-02-19 23:30:21.590103: Bind to address ::<br>omniORB: (0) 2007-02-19 23:30:21.590471: Publish specification: 'addr'<br>omniORB: (0) 2007-02-19 23:30:
21.590665: Try to publish 'addr' for endpoint giop:tcp:<a href="http://192.168.1.5:44206">192.168.1.5:44206</a><br>omniORB: (0) 2007-02-19 23:30:21.590812: Publish endpoint 'giop:tcp:<a href="http://192.168.1.5:44206">
192.168.1.5:44206</a>'<br>omniORB: (0) 2007-02-19 23:30:21.591034: Starting serving incoming endpoints.<br>omniORB: (0) 2007-02-19 23:30:21.591384: Adding root<0> (activating) to object table.<br>omniORB: (0) 2007-02-19 23:30:
21.591592: State root<0> (activating) -> active<br>omniORB: (0) 2007-02-19 23:30:21.591820: Creating ref to local: root<0><br> target id : IDL:Echo:1.0<br> most derived id: IDL:Echo:1.0<br><span style="background-color: rgb(255, 102, 102);">
omniORB: (0) 2007-02-19 23:30:21.592057: Dispatching local call 'echoString' to root<0> (active)</span><br style="background-color: rgb(255, 102, 102);"><span style="background-color: rgb(255, 102, 102);">omniORB: (0) 2007-02-19 23:30:
21.592227: Return from local call 'echoString' to root<0> (active)</span><br style="background-color: rgb(255, 102, 102);"><span style="background-color: rgb(255, 102, 102);">*** glibc detected *** ./echo: munmap_chunk(): invalid pointer: 0x0804d620 ***
</span><br>======= Backtrace: =========<br>/lib/libc.so.6(cfree+0x1bb)[0x4930a67b]<br>/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x41a6fef1]<br>/usr/lib/libstdc++.so.6(_ZdaPv+0x1d)[0x41a6ff4d]<br>./echo[0x804b9a6]<br>./echo[0x804b9c0]
<br>./echo[0x804c06e]<br>./echo[0x804c287]<br>/lib/libc.so.6(__libc_start_main+0xdc)[0x492b6f2c]<br>./echo(__gxx_personality_v0+0x85)[0x804a1c1]<br>======= Memory map: ========<br>0063a000-007a8000 r-xp 00000000 fd:00 190170 /usr/local/lib/libomniORB4.so.1.0
<br>007a8000-007b5000 rwxp 0016e000 fd:00 190170 /usr/local/lib/libomniORB4.so.1.0<br>007b5000-007b6000 rwxp 007b5000 00:00 0 <br>00a5a000-00a5b000 r-xp 00a5a000 00:00 0 [vdso]<br>00ff8000-00ffd000 r-xp 00000000 fd:00 190166 /usr/local/lib/libomnithread.so.3.3
<br>00ffd000-00ffe000 rwxp 00004000 fd:00 190166 /usr/local/lib/libomnithread.so.3.3<br>08048000-0804f000 r-xp 00000000 fd:00 1201850 /root/workspace/echo/Debug/echo<br>0804f000-08050000 rwxp 00006000 fd:00 1201850 /root/workspace/echo/Debug/echo
<br>08789000-087aa000 rwxp 08789000 00:00 0 <br>419ae000-419b9000 r-xp 00000000 fd:00 2076850 /lib/libgcc_s-4.1.1-20070105.so.1<br>419b9000-419ba000 rwxp 0000a000 fd:00 2076850 /lib/libgcc_s-4.1.1-20070105.so.1<br>419bc000-41a9c000 r-xp 00000000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8
<br>41a9c000-41a9f000 r-xp 000e0000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8<br>41a9f000-41aa1000 rwxp 000e3000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8<br>41aa1000-41aa7000 rwxp 41aa1000 00:00 0 <br>488d2000-488eb000 r-xp 00000000 fd:00 2078731 /lib/ld-
<a href="http://2.5.so">2.5.so</a><br>488eb000-488ec000 r-xp 00018000 fd:00 2078731 /lib/ld-<a href="http://2.5.so">2.5.so</a><br>488ec000-488ed000 rwxp 00019000 fd:00 2078731 /lib/ld-<a href="http://2.5.so">2.5.so</a>
<br>492a1000-493d8000 r-xp 00000000 fd:00 2078732 /lib/libc-<a href="http://2.5.so">2.5.so</a><br>493d8000-493da000 r-xp 00137000 fd:00 2078732 /lib/libc-<a href="http://2.5.so">2.5.so</a><br>493da000-493db000 rwxp 00139000 fd:00 2078732 /lib/libc-
<a href="http://2.5.so">2.5.so</a><br>493db000-493de000 rwxp 493db000 00:00 0 <br>493e0000-49405000 r-xp 00000000 fd:00 2078739 /lib/libm-<a href="http://2.5.so">2.5.so</a><br>49405000-49406000 r-xp 00024000 fd:00 2078739 /lib/libm-
<a href="http://2.5.so">2.5.so</a><br>49406000-49407000 rwxp 00025000 fd:00 2078739 /lib/libm-<a href="http://2.5.so">2.5.so</a><br>4940f000-49422000 r-xp 00000000 fd:00 2078734 /lib/libpthread-<a href="http://2.5.so">
2.5.so</a><br>49422000-49423000 r-xp 00012000 fd:00 2078734 /lib/libpthread-<a href="http://2.5.so">2.5.so</a><br>49423000-49424000 rwxp 00013000 fd:00 2078734 /lib/libpthread-<a href="http://2.5.so">2.5.so</a><br>49424000-49426000 rwxp 49424000 00:00 0
<br>b75b4000-b75b5000 ---p b75b4000 00:00 0 <br>b75b5000-b7fb7000 rw-p b75b5000 00:00 0 <br>b7fc6000-b7fc8000 rw-p b7fc6000 00:00 0 <br>bfad7000-bfaec000 rw-p bfad7000 00:00 0 [stack]<br><br>