banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg  XML
  [Question]   Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 19/02/2007 14:07:42 (+0700) | #1 | 42025
[Avatar]
LQV0604
Elite Member

[Minus]    0    [Plus]
Joined: 29/12/2003 14:54:13
Messages: 59
Offline
[Profile] [PM]
Gửi mọi người,
Mình đang tìm hiểu về corba trên linux ( C/C++) sử dụng omniORB ( mã nguồn mở và chạy nhanh theo như quảng cáo smilie) ) .
+ Bước đầu tiên mình đã cài được gói omniORB-4.1.0 vào
+ Bước thứ 2 mình gõ một đoạn example của omniORB-4.1.0 ( example có tên: echo) ở ngay file hướng dẫn của omniORB-4.1.0 để xem no chạy như thế nào.
+ Sau một hồi vật lộn để nó biên dịch không còn lỗi ( tại chưa quen với linux lắm) thì cũng ok. Không còn một lỗi nào cả
+ Bước cuối cùng chạy chương trình . Két quả bị văng exception ngay đoạn này

++argc và argv mình để mặc định .
Code:
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");


Mình đoán là do mình config bị sai ở file omniORB.cfg nên nó không tìm thấy RootPOA chăng? Mình tìm hiểu mất cả tuần rồi mà vẫn chưa làm sao cho nó chạy được. Bạn nào biết về corba chỉ mình gở rối với .
Cám ơn
[Up] [Print Copy]
  [Question]   Re: Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 20/02/2007 13:16:34 (+0700) | #2 | 42116
[Avatar]
LQV0604
Elite Member

[Minus]    0    [Plus]
Joined: 29/12/2003 14:54:13
Messages: 59
Offline
[Profile] [PM]

omniORB: (0) 2007-02-19 23:10:58.685226: Distribution date: Tue Nov 28 13:27:23 GMT 2006 dgrisby
omniORB: (0) 2007-02-19 23:10:58.685875: My addresses are:
omniORB: 127.0.0.1
omniORB: 192.168.1.5
omniORB: ::1
omniORB: (0) 2007-02-19 23:10:58.686178: Maximum supported GIOP version is 1.2
omniORB: (0) 2007-02-19 23:10:58.686430: Native char code sets: ISO-8859-1 UTF-8.
omniORB: (0) 2007-02-19 23:10:58.686577: 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: (0) 2007-02-19 23:10:58.686689: Native wide char code sets: UTF-16.
omniORB: (0) 2007-02-19 23:10:58.686790: Transmission wide char code sets: UTF-16(1.2).
omniORB: (0) 2007-02-19 23:10:58.686926: Information: the omniDynamic library is not linked.
omniORB: (0) 2007-02-19 23:10:58.687333: Current configuration is as follows:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: InitRef = NameService=corbaname::localhost
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/omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 1
omniORB: endPoint = giop:tcp::
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
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: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
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 = 1
omniORB: traceInvocations = 1
omniORB: traceLevel = 40
omniORB: traceThreadId = 1
omniORB: traceTime = 1
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: (0) 2007-02-19 23:10:58.687890: Initialising incoming endpoints.
omniORB: (0) 2007-02-19 23:10:58.688055: Instantiate endpoint 'giop:tcp::0'
omniORB: (0) 2007-02-19 23:10:58.688615: Bind to address ::
omniORB: (0) 2007-02-19 23:10:58.688979: Publish specification: 'addr'
omniORB: (0) 2007-02-19 23:10:58.689176: Try to publish 'addr' for endpoint giop:tcp:192.168.1.5:44518
omniORB: (0) 2007-02-19 23:10:58.689314: Publish endpoint 'giop:tcp:192.168.1.5:44518'
omniORB: (0) 2007-02-19 23:10:58.689530: Starting serving incoming endpoints.
omniORB: (0) 2007-02-19 23:10:58.689884: Adding root<0> (activating) to object table.
omniORB: (0) 2007-02-19 23:10:58.690091: State root<0> (activating) -> active
omniORB: (0) 2007-02-19 23:10:58.690313: Creating ref to local: root<0>
target id : IDL:Echo:1.0
most derived id: IDL:Echo:1.0
omniORB: (0) 2007-02-19 23:10:58.690569: Dispatching local call 'echoString' to root<0> (active)
omniORB: (0) 2007-02-19 23:10:58.690719: Return from local call 'echoString' to root<0> (active)
I said, "Hello!".
The Echo object replied, "Hello world".
*** glibc detected *** ./client_corba: munmap_chunk(): invalid pointer: 0x0804d620 ***
omniORB: (1) 2007-02-19 23:10:58.691914: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: (1) 2007-02-19 23:10:58.692136: giopRendezvouser task execute for giop:tcp:192.168.1.5:44518
======= Backtrace: =========
/lib/libc.so.6(cfree+0x1bb)[0x4930a67b]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x41a6fef1]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1d)[0x41a6ff4d]
./client_corba[0x804b9a6]
./client_corba[0x804b9c0]
./client_corba[0x804c06e]
./client_corba[0x804c287]
/lib/libc.so.6(__libc_start_main+0xdc)[0x492b6f2c]
./client_corba(__gxx_personality_v0+0x85)[0x804a1c1]
======= Memory map: ========
003f3000-003f4000 r-xp 003f3000 00:00 0 [vdso]
00542000-00547000 r-xp 00000000 fd:00 190166 /usr/local/lib/libomnithread.so.3.3
00547000-00548000 rwxp 00004000 fd:00 190166 /usr/local/lib/libomnithread.so.3.3
008f8000-00a66000 r-xp 00000000 fd:00 190170 /usr/local/lib/libomniORB4.so.1.0
00a66000-00a73000 rwxp 0016e000 fd:00 190170 /usr/local/lib/libomniORB4.so.1.0
00a73000-00a74000 rwxp 00a73000 00:00 0
08048000-0804f000 r-xp 00000000 fd:00 1201850 /root/workspace/client_corba/Debug/client_corba
0804f000-08050000 rwxp 00006000 fd:00 1201850 /root/workspace/client_corba/Debug/client_corba
08bc0000-08be1000 rwxp 08bc0000 00:00 0
419ae000-419b9000 r-xp 00000000 fd:00 2076850 /lib/libgcc_s-4.1.1-20070105.so.1
419b9000-419ba000 rwxp 0000a000 fd:00 2076850 /lib/libgcc_s-4.1.1-20070105.so.1
419bc000-41a9c000 r-xp 00000000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8
41a9c000-41a9f000 r-xp 000e0000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8
41a9f000-41aa1000 rwxp 000e3000 fd:00 168053 /usr/lib/libstdc++.so.6.0.8
41aa1000-41aa7000 rwxp 41aa1000 00:00 0
488d2000-488eb000 r-xp 00000000 fd:00 2078731 /lib/ld-2.5.so
488eb000-488ec000 r-xp 00018000 fd:00 2078731 /lib/ld-2.5.so
488ec000-488ed000 rwxp 00019000 fd:00 2078731 /lib/ld-2.5.so
492a1000-493d8000 r-xp 00000000 fd:00 2078732 /lib/libc-2.5.so
493d8000-493da000 r-xp 00137000 fd:00 2078732 /lib/libc-2.5.so
493da000-493db000 rwxp 00139000 fd:00 2078732 /lib/libc-2.5.so
493db000-493de000 rwxp 493db000 00:00 0
493e0000-49405000 r-xp 00000000 fd:00 2078739 /lib/libm-2.5.so
49405000-49406000 r-xp 00024000 fd:00 2078739 /lib/libm-2.5.so
49406000-49407000 rwxp 00025000 fd:00 2078739 /lib/libm-2.5.so
4940f000-49422000 r-xp 00000000 fd:00 2078734 /lib/libpthread-2.5.so
49422000-49423000 r-xp 00012000 fd:00 2078734 /lib/libpthread-2.5.so
49423000-49424000 rwxp 00013000 fd:00 2078734 /lib/libpthread-2.5.so
49424000-49426000 rwxp 49424000 00:00 0
b74f6000-b74f7000 ---p b74f6000 00:00 0
b74f7000-b7ef9000 rw-p b74f7000 00:00 0
b7f08000-b7f0a000 rw-p b7f08000 00:00 0
bf81c000-bf831000 rw-p bf81c000 00:00 0 [stack]
Aborted
 


Mình không hiểu lý do tại sao xuất hiện lỗi trên. Đây là đoạn trace log khi chạy chương trình echo. Các bạn giúp mình với.
Thanks
[Up] [Print Copy]
  [Question]   Re: Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 20/02/2007 13:35:34 (+0700) | #3 | 42118
[Avatar]
LQV0604
Elite Member

[Minus]    0    [Plus]
Joined: 29/12/2003 14:54:13
Messages: 59
Offline
[Profile] [PM]
Code:
omniORB: (0) 2007-02-19 23:28:41.121140: Distribution date: Tue Nov 28 13:27:23 GMT 2006 dgrisby
omniORB: (0) 2007-02-19 23:28:41.121768: My addresses are: 
omniORB: 127.0.0.1
omniORB: 192.168.1.5
omniORB: ::1
omniORB: (0) 2007-02-19 23:28:41.122057: Maximum supported GIOP version is 1.2
omniORB: (0) 2007-02-19 23:28:41.122296: Native char code sets: ISO-8859-1 UTF-8.
omniORB: (0) 2007-02-19 23:28:41.122437: 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: (0) 2007-02-19 23:28:41.122548: Native wide char code sets: UTF-16.
omniORB: (0) 2007-02-19 23:28:41.122660: Transmission wide char code sets: UTF-16(1.2).
omniORB: (0) 2007-02-19 23:28:41.122797: Information: the omniDynamic library is not linked.
omniORB: (0) 2007-02-19 23:28:41.123148: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = 
omniORB:   DefaultInitRef (args) = 
omniORB:   InitRef = NameService=IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000060000000010102000c0000003139322e3136382e312e3500f90a00000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
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/omniORB.cfg
omniORB:   connectionWatchImmediate = 0
omniORB:   connectionWatchPeriod = 50000
omniORB:   copyValuesInLocalCalls = 1
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 1
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublish = addr
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   idleThreadTimeout = 10
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:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
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 = 1
omniORB:   traceInvocations = 1
omniORB:   traceLevel = 40
omniORB:   traceThreadId = 1
omniORB:   traceTime = 1
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: (0) 2007-02-19 23:28:41.123694: Initialising incoming endpoints.
omniORB: (0) 2007-02-19 23:28:41.123862: Instantiate endpoint 'giop:tcp::0'
omniORB: (0) 2007-02-19 23:28:41.124435: Bind to address ::
omniORB: (0) 2007-02-19 23:28:41.124841: Publish specification: 'addr'
omniORB: (0) 2007-02-19 23:28:41.125044: Try to publish 'addr' for endpoint giop:tcp:192.168.1.5:45821
omniORB: (0) 2007-02-19 23:28:41.125193: Publish endpoint 'giop:tcp:192.168.1.5:45821'
omniORB: (0) 2007-02-19 23:28:41.125411: Starting serving incoming endpoints.
omniORB: (0) 2007-02-19 23:28:41.125769: Adding root<0> (activating) to object table.
omniORB: (0) 2007-02-19 23:28:41.125969: State root<0> (activating) -> active
omniORB: (0) 2007-02-19 23:28:41.126191: Creating ref to local: root<0>
 target id      : IDL:Echo:1.0
 most derived id: IDL:Echo:1.0
omniORB: (0) 2007-02-19 23:28:41.126424: Dispatching local call 'echoString' to root<0> (active)
omniORB: (0) 2007-02-19 23:28:41.126573: Return from local call 'echoString' to root<0> (active)
I said, "Hello!".
The Echo object replied, "Hello world".
*** glibc detected *** ./client_corba: munmap_chunk(): invalid pointer: 0x0804d620 ***
======= Backtrace: =========
/lib/libc.so.6(cfree+0x1bb)[0x4930a67b]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x41a6fef1]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1d)[0x41a6ff4d]
./client_corba[0x804b9a6]
./client_corba[0x804b9c0]
./client_corba[0x804c06e]
./client_corba[0x804c287]
/lib/libc.so.6(__libc_start_main+0xdc)[0x492b6f2c]
./client_corba(__gxx_personality_v0+0x85)[0x804a1c1]
======= Memory map: ========
00160000-00161000 r-xp 00160000 00:00 0          [vdso]
0078c000-00791000 r-xp 00000000 fd:00 190166     /usr/local/lib/libomnithread.so.3.3
00791000-00792000 rwxp 00004000 fd:00 190166     /usr/local/lib/libomnithread.so.3.3
0097e000-00aec000 r-xp 00000000 fd:00 190170     /usr/local/lib/libomniORB4.so.1.0
00aec000-00af9000 rwxp 0016e000 fd:00 190170     /usr/local/lib/libomniORB4.so.1.0
00af9000-00afa000 rwxp 00af9000 00:00 0 
08048000-0804f000 r-xp 00000000 fd:00 1201850    /root/workspace/client_corba/Debug/client_corba
0804f000-08050000 rwxp 00006000 fd:00 1201850    /root/workspace/client_corba/Debug/client_corba
084f1000-08512000 rwxp 084f1000 00:00 0 
419ae000-419b9000 r-xp 00000000 fd:00 2076850    /lib/libgcc_s-4.1.1-20070105.so.1
419b9000-419ba000 rwxp 0000a000 fd:00 2076850    /lib/libgcc_s-4.1.1-20070105.so.1
419bc000-41a9c000 r-xp 00000000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41a9c000-41a9f000 r-xp 000e0000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41a9f000-41aa1000 rwxp 000e3000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41aa1000-41aa7000 rwxp 41aa1000 00:00 0 
488d2000-488eb000 r-xp 00000000 fd:00 2078731    /lib/ld-2.5.so
488eb000-488ec000 r-xp 00018000 fd:00 2078731    /lib/ld-2.5.so
488ec000-488ed000 rwxp 00019000 fd:00 2078731    /lib/ld-2.5.so
492a1000-493d8000 r-xp 00000000 fd:00 2078732    /lib/libc-2.5.so
493d8000-493da000 r-xp 00137000 fd:00 2078732    /lib/libc-2.5.so
493da000-493db000 rwxp 00139000 fd:00 2078732    /lib/libc-2.5.so
493db000-493de000 rwxp 493db000 00:00 0 
493e0000-49405000 r-xp 00000000 fd:00 2078739    /lib/libm-2.5.so
49405000-49406000 r-xp 00024000 fd:00 2078739    /lib/libm-2.5.so
49406000-49407000 rwxp 00025000 fd:00 2078739    /lib/libm-2.5.so
4940f000-49422000 r-xp 00000000 fd:00 2078734    /lib/libpthread-2.5.so
49422000-49423000 r-xp 00012000 fd:00 2078734    /lib/libpthread-2.5.so
49423000-49424000 rwxp 00013000 fd:00 2078734    /lib/libpthread-2.5.so
49424000-49426000 rwxp 49424000 00:00 0 
b754c000-b754d000 ---p b754c000 00:00 0 
b754d000-b7f4f000 rw-p b754d000 00:00 0 
b7f5e000-b7f60000 rw-p b7f5e000 00:00 0 
bfd22000-bfd37000 rw-p bfd22000 00:00 0          [stack]
Aborted
[root@localhost Debug]# ./client_corba >> log
omniORB: (0) 2007-02-19 23:30:21.586723: Distribution date: Tue Nov 28 13:27:23 GMT 2006 dgrisby
omniORB: (0) 2007-02-19 23:30:21.587388: My addresses are: 
omniORB: 127.0.0.1
omniORB: 192.168.1.5
omniORB: ::1
omniORB: (0) 2007-02-19 23:30:21.587681: Maximum supported GIOP version is 1.2
omniORB: (0) 2007-02-19 23:30:21.587922: Native char code sets: ISO-8859-1 UTF-8.
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).
omniORB: (0) 2007-02-19 23:30:21.588175: Native wide char code sets: UTF-16.
omniORB: (0) 2007-02-19 23:30:21.588296: Transmission wide char code sets: UTF-16(1.2).
omniORB: (0) 2007-02-19 23:30:21.588438: Information: the omniDynamic library is not linked.
omniORB: (0) 2007-02-19 23:30:21.588807: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = 
omniORB:   DefaultInitRef (args) = 
omniORB:   InitRef = NameService=IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000060000000010102000c0000003139322e3136382e312e3500f90a00000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
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/omniORB.cfg
omniORB:   connectionWatchImmediate = 0
omniORB:   connectionWatchPeriod = 50000
omniORB:   copyValuesInLocalCalls = 1
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 1
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublish = addr
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   idleThreadTimeout = 10
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:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
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 = 1
omniORB:   traceInvocations = 1
omniORB:   traceLevel = 40
omniORB:   traceThreadId = 1
omniORB:   traceTime = 1
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: (0) 2007-02-19 23:30:21.589361: Initialising incoming endpoints.
omniORB: (0) 2007-02-19 23:30:21.589529: Instantiate endpoint 'giop:tcp::0'
omniORB: (0) 2007-02-19 23:30:21.590103: Bind to address ::
omniORB: (0) 2007-02-19 23:30:21.590471: Publish specification: 'addr'
omniORB: (0) 2007-02-19 23:30:21.590665: Try to publish 'addr' for endpoint giop:tcp:192.168.1.5:44206
omniORB: (0) 2007-02-19 23:30:21.590812: Publish endpoint 'giop:tcp:192.168.1.5:44206'
omniORB: (0) 2007-02-19 23:30:21.591034: Starting serving incoming endpoints.
omniORB: (0) 2007-02-19 23:30:21.591384: Adding root<0> (activating) to object table.
omniORB: (0) 2007-02-19 23:30:21.591592: State root<0> (activating) -> active
omniORB: (0) 2007-02-19 23:30:21.591820: Creating ref to local: root<0>
 target id      : IDL:Echo:1.0
 most derived id: IDL:Echo:1.0
omniORB: (0) 2007-02-19 23:30:21.592057: Dispatching local call 'echoString' to root<0> (active)
omniORB: (0) 2007-02-19 23:30:21.592227: Return from local call 'echoString' to root<0> (active)
*** glibc detected *** ./client_corba: munmap_chunk(): invalid pointer: 0x0804d620 ***
======= Backtrace: =========
/lib/libc.so.6(cfree+0x1bb)[0x4930a67b]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x41a6fef1]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1d)[0x41a6ff4d]
./client_corba[0x804b9a6]
./client_corba[0x804b9c0]
./client_corba[0x804c06e]
./client_corba[0x804c287]
/lib/libc.so.6(__libc_start_main+0xdc)[0x492b6f2c]
./client_corba(__gxx_personality_v0+0x85)[0x804a1c1]
======= Memory map: ========
0063a000-007a8000 r-xp 00000000 fd:00 190170     /usr/local/lib/libomniORB4.so.1.0
007a8000-007b5000 rwxp 0016e000 fd:00 190170     /usr/local/lib/libomniORB4.so.1.0
007b5000-007b6000 rwxp 007b5000 00:00 0 
00a5a000-00a5b000 r-xp 00a5a000 00:00 0          [vdso]
00ff8000-00ffd000 r-xp 00000000 fd:00 190166     /usr/local/lib/libomnithread.so.3.3
00ffd000-00ffe000 rwxp 00004000 fd:00 190166     /usr/local/lib/libomnithread.so.3.3
08048000-0804f000 r-xp 00000000 fd:00 1201850    /root/workspace/client_corba/Debug/client_corba
0804f000-08050000 rwxp 00006000 fd:00 1201850    /root/workspace/client_corba/Debug/client_corba
08789000-087aa000 rwxp 08789000 00:00 0 
419ae000-419b9000 r-xp 00000000 fd:00 2076850    /lib/libgcc_s-4.1.1-20070105.so.1
419b9000-419ba000 rwxp 0000a000 fd:00 2076850    /lib/libgcc_s-4.1.1-20070105.so.1
419bc000-41a9c000 r-xp 00000000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41a9c000-41a9f000 r-xp 000e0000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41a9f000-41aa1000 rwxp 000e3000 fd:00 168053     /usr/lib/libstdc++.so.6.0.8
41aa1000-41aa7000 rwxp 41aa1000 00:00 0 
488d2000-488eb000 r-xp 00000000 fd:00 2078731    /lib/ld-2.5.so
488eb000-488ec000 r-xp 00018000 fd:00 2078731    /lib/ld-2.5.so
488ec000-488ed000 rwxp 00019000 fd:00 2078731    /lib/ld-2.5.so
492a1000-493d8000 r-xp 00000000 fd:00 2078732    /lib/libc-2.5.so
493d8000-493da000 r-xp 00137000 fd:00 2078732    /lib/libc-2.5.so
493da000-493db000 rwxp 00139000 fd:00 2078732    /lib/libc-2.5.so
493db000-493de000 rwxp 493db000 00:00 0 
493e0000-49405000 r-xp 00000000 fd:00 2078739    /lib/libm-2.5.so
49405000-49406000 r-xp 00024000 fd:00 2078739    /lib/libm-2.5.so
49406000-49407000 rwxp 00025000 fd:00 2078739    /lib/libm-2.5.so
4940f000-49422000 r-xp 00000000 fd:00 2078734    /lib/libpthread-2.5.so
49422000-49423000 r-xp 00012000 fd:00 2078734    /lib/libpthread-2.5.so
49423000-49424000 rwxp 00013000 fd:00 2078734    /lib/libpthread-2.5.so
49424000-49426000 rwxp 49424000 00:00 0 
b75b4000-b75b5000 ---p b75b4000 00:00 0 
b75b5000-b7fb7000 rw-p b75b5000 00:00 0 
b7fc6000-b7fc8000 rw-p b7fc6000 00:00 0 
bfad7000-bfaec000 rw-p bfad7000 00:00 0          [stack]

Mình chỉnh lại cấu hình. Nhưng vẫn còn bị lỗi
[Up] [Print Copy]
  [Question]   Re: Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 20/02/2007 13:51:57 (+0700) | #4 | 42119
[Avatar]
LQV0604
Elite Member

[Minus]    0    [Plus]
Joined: 29/12/2003 14:54:13
Messages: 59
Offline
[Profile] [PM]
Sau đây là cái ví dụ echo mà mình chạy

Code:
#include <iostream>
#include "echo.hh"
using namespace std;

class Echo_i : public POA_Echo{
public:
	inline Echo_i(){};
	inline ~Echo_i(){};
	virtual char* echoString(const char* mesg);
};

char * Echo_i::echoString(const char* mesg){
	return "Hello world";
};

static void hello(Echo_ptr e)
{
  if( CORBA::is_nil(e) ) {
    cerr << "hello: The object reference is nil!\n" << endl;
    return;
  }
  CORBA::String_var src = (const char*) "Hello!";
  // String literals are (char*) rather than (const char*) on some
  // old compilers. Thus it is essential to cast to (const char*)
  // here to ensure that the string is copied, so that the
  // CORBA::String_var does not attempt to \u2019delete\u2019 the string
  // literal.
  CORBA::String_var dest = e->echoString(src);
  cout << "I said, \"" << (char*)src << "\"." << endl
       << "The Echo object replied, \"" << (char*)dest <<"\"." << endl;
};


int main(int argc, char *argv[]){
	try {
  // Initialise the ORB.
  CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
  // Obtain a reference to the root POA.
  //CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
  CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
  PortableServer:smilieOA_var poa = PortableServer:smilieOA::_narrow(obj);
    // We allocate the object on the heap. Since this is a reference
    // counted object, it will be deleted by the POA when it is no
    // longer needed.
  Echo_i* myecho = new Echo_i();
  // Activate the object. This tells the POA that this object is
  // ready to accept requests.
  PortableServer::ObjectId_var myechoid = poa->activate_object(myecho);
    // Obtain a reference to the object.
  Echo_var myechoref = myecho->_this();
  // Decrement the reference count of the object implementation, so
  // that it will be properly cleaned up when the POA has determined
  // that it is no longer needed.
  myecho->_remove_ref();
  // Obtain a POAManager, and tell the POA to start accepting
  // requests on its objects.
  PortableServer:smilieOAManager_var pman = poa->the_POAManager();
  pman->activate();
  // Do the client-side call.
  hello(myechoref);
  // Clean up all the resources.
  orb->destroy();
}
	catch(CORBA::SystemException& ex) {
  		cerr << "Caught CORBA::" << ex._name() << endl;
	}
	catch(CORBA::Exception& ex) {
  		cerr << "Caught CORBA::Exception: " << ex._name() << endl;
	}
	catch(omniORB::fatalException& fe) {
  		cerr << "Caught omniORB::fatalException:" << endl;
  		cerr << " file: " << fe.file() << endl;
  		cerr << " line: " << fe.line() << endl;
  		cerr << " mesg: " << fe.errmsg() << endl;
	}
	cout << "Hello world";
	return 0;
};
[Up] [Print Copy]
  [Question]   Re: Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 20/02/2007 17:31:40 (+0700) | #5 | 42124
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Ùm.... anh chịu thua. Chưa đụng tới cái omniORB bao giờ nên không biết sự thể ra sao. Tuy nhiên anh có xem thử thông tin trên trang omniORB thì thấy 4.1.x vẫn là beta developement version. Có thể nó còn bugs. Nên dùng bản stable thì bảo đảm hơn.

Xem qua cái thông điệp ở trên, anh nghi nó dính với glibc và threading trên Linux. Anh có xem qua cái FAQ trên trang omniORB thì thấy có đoạn:

Q. I compiled the source with gcc/egcs. When I ran the examples, I got IOT/Abort/SEGV. Why?

It is most likely to be a compiler problem. gcc 2.8 and egcs 1.0.x do not generate exception handling code that is thread safe. When an exception is thrown, the runtime has to locate the exception handler and unwind the stack of a thread accordingly. This part of the runtime is not thread safe. Furthermore, setjmp/longjmp is used on some platforms to implement exception handling. This way of handling exception only works if there is a separate chain of handlers per-thread. The compiler does not generate code to do so. The end result is that omniORB programs seem to crash randomly.

Thread-safe exception handling has been implemented in egcs-1.1. However, there still seem to be problems on some platforms, e.g. Alpha Linux .

With later gcc versions, the compiler itself (and libstdc++) must be configured with --enable-threads, otherwise exception handling code is not thread safe.  


Anh hy vọng sự thể nằm ở phần màu đỏ. Em thử compile lại và --enable-threads xem có khá hơn không? Nhớ kiểm tra kỹ phiên bản của glibc và compiler.

Good luck.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Re: Giúp hướng dẫn cài CORBA và cấu hình file omniORB.cfg 21/02/2007 07:39:44 (+0700) | #6 | 42165
[Avatar]
LQV0604
Elite Member

[Minus]    0    [Plus]
Joined: 29/12/2003 14:54:13
Messages: 59
Offline
[Profile] [PM]

conmale wrote:
Ùm.... anh chịu thua. Chưa đụng tới cái omniORB bao giờ nên không biết sự thể ra sao. Tuy nhiên anh có xem thử thông tin trên trang omniORB thì thấy 4.1.x vẫn là beta developement version. Có thể nó còn bugs. Nên dùng bản stable thì bảo đảm hơn.

Xem qua cái thông điệp ở trên, anh nghi nó dính với glibc và threading trên Linux. Anh có xem qua cái FAQ trên trang omniORB thì thấy có đoạn:

Q. I compiled the source with gcc/egcs. When I ran the examples, I got IOT/Abort/SEGV. Why?

It is most likely to be a compiler problem. gcc 2.8 and egcs 1.0.x do not generate exception handling code that is thread safe. When an exception is thrown, the runtime has to locate the exception handler and unwind the stack of a thread accordingly. This part of the runtime is not thread safe. Furthermore, setjmp/longjmp is used on some platforms to implement exception handling. This way of handling exception only works if there is a separate chain of handlers per-thread. The compiler does not generate code to do so. The end result is that omniORB programs seem to crash randomly.

Thread-safe exception handling has been implemented in egcs-1.1. However, there still seem to be problems on some platforms, e.g. Alpha Linux .

With later gcc versions, the compiler itself (and libstdc++) must be configured with --enable-threads, otherwise exception handling code is not thread safe.  


Anh hy vọng sự thể nằm ở phần màu đỏ. Em thử compile lại và --enable-threads xem có khá hơn không? Nhớ kiểm tra kỹ phiên bản của glibc và compiler.

Good luck. 


Cám ơn anh conmale đã bỏ thời gian ra tìm hiểu. Em đã tìm hiểu gợi ý của anh. May mắn là trên fedora core 6 không bị như trên.

Em đã tìm ra được lỗi gây ra vấn đề trên:

Code:
char * Echo_i::echoString(const char* mesg){
	[color=red]return "Hello world";[/color]
};


Dòng trên trả về một pointer. Mà omniORB do có hỗ trợ smart pointer nên nó tự động hủy pointer trên sau khi đã gửi message đi ( điều không nên làm) ---> văng exception

Cách sửa như sau:

Code:
char * Echo_i::echoString(const char* mesg){
	return CORBA::string_dup("Hello world");
};

Đau đầu thiệt , đây là example do omniORB cung cấp mà mình dùng để chạy thử mà cũng sai. smilie(
Cám ơn mọi người đã quan tâm đến topic.
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|