banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Messages posted by: LQV0604  XML
Profile for LQV0604 Messages posted by LQV0604 [ number of posts not being displayed on this page: 7 ]
 

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.
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;
};
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

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
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
Thanks anh conmale
Có bạn nào biết IDE nào tốt hơn ANJUTA trong Fedora core không? . Thằng ANJUTA cứ bị lỗi và thoát luôn khi sử dụng pthread.h . Không biết sao sửa được
Cảm ơn

Mình gặp trường hợp này, hổng biết giải quyết sao. Các bạn chỉ giúp với
Mạng ở nhà nên đơn giản :
+ router có wireless
+ PC cài fedora core 6

Router IP: 192.168.1.1/24
PC dùng network adapter để kết nối không dây với router .

PC--> Router

+ Router có cài WEP 64 bit. Để minh họa mình dùng key : abcd-efgh-ij

Khi dùng cái card này trên windows thì chạy tốt.
Khi chuyển sang linux thì FAILED

Sử dụng #iwconfig wlan0 thì thấy có
essid : "ESSID"
có AP: "xxsmiliexsmiliex:..."
có key abcd-efgh-ij mode open

gõ ifconfig thì thấy có ip , netmask

gõ route thì có 2 dòng
- route add default gw 192.168.1.1
- 192.168.1.0 gw 0.0.0.0 netmask 255.255.255.0 dev wlan0
- Khi ping thì ping không được báo lỗi( ping vào gateway mà cũng hổng được)

Sử dụng dhclient wlan0 --> không thấy thông báo nào. Bó tay

Khi không sử dụng WEP trên router thì card chạy tốt smilie

Do mình hông rành lắm về linux nên nhờ các bạn chỉ giúp cách troubleshoot vấn đề này

Cảm ơn nhiều nhiều

PS: Card hổng có tên trong list các card mạng được hỗ trợ bởi fedora core 6. Nên phải tìm driver hỗ trợ riêng. Netword adapter gắn với PC thông qua USB
Các bạn ai biết thư viện toán nào có hỗ trợ tính tích phân không chỉ mình với
Hỗ trợ .NET càng tốt.
Cảm ơn
Đại học FPT mục tiêu đào tạo cho FPT ===> đại học này không có chức năng giáo dục toàn diện và giống trường nghề hơn .
Không biết các công ty khác khi tuyển sv FPT sẽ nói như thế nào đây smilie .
Mức học phí quá cao , không hỗ trợ được cho nền giáo dục toàn dân. SV nghèo chắc thât học nếu đại học nào cũng như đại học này quá .
Mình đang vướng một một vấn đề về check quyền trên windows .
Mình có một chương trình A nằm ở máy B . Chương trình A muốn kiểm tra việc truy xuất vào một thư mục và file nào đó trong máy C nào đó trong mạng ( mạng windows) có được không để xử lý các tác vụ khác . Mình có sử dụng một số hàm check quyền API của windows nhưng kết quả trả ra không chính xác cho tất cả các loại windows (98,XP1,2,windows server 2000,2003...) . Các bạn có thể chỉ giúp mình thư viện hoặc hàm nào có hỗ trợ check quyền của users X ở groups Y trên một thư mục nào đó trên mạng có những quyền gì .
Cảm ơn trước
Nếu mình sử dụng hàm waitforobject bên trong bản thân processB thì thread nào sử dụng hàm wait mới bị dừng . Do chương trình sử dụng multithread và network nên các thread khác vẫn có thể chạy bình thường . Xét ở mức độ nào đó , việc wait trên process B không ảnh hưởng lớn lắm đến performance . Mình nghĩ là vẫn có thể chạy tốt .
Như vậy theo các bài post trước thì xu hướng hiện giờ là sử dụng injnection code vào process B , thay vì sử dụng debug function : readprocessmemory với writeprocessmemory để đọc process B . Vậy vấn đề hiện giờ là làm sao mình tạo được mutex,semaphore ... trong process B để sử dụng

secmask wrote:
hihi , thực ra cách này cũng hơi khó , như ThangCuEm đã nói nếu nó sử dụng mutex,semaphore .. thì ta có thể lock nó lại đúng không , nếu như nó không có thì ta làm cho nó có , overwrite code để nó wait một Object nào đó mà ta tạo ra. Cách này hơi khó bởi vì nếu có quá nhiều đoạn code tham chiếu đến vùng nhớ này . secmask đang nghĩ đến một cách khác là ta monitor vùng nhớ đó như các chương trình debug làm . Secmask cũng bắt đầu thấy có hứng thú với cái vụ này đây smilie 


^^ . Dùng cách gì cũng được nhưng có yêu cầu không được làm suppend thread hay làm chậm performance . Tại đây là ứng dụng real time .
Debug không khả thi lắm nếu như phải dừng process B lại .
Thanks các bạn secmask,evh,ThangCuEm đã trả lời .
Cho tới hiện giờ thì cách tốt nhất mình nghĩ có thể được là sử dụng dll injection để gắn code của mình vào process B và ngồi hy vọng smilie . Trong dll thì mình chỉ đảm bảo được việc ghi hoặc đọc của mình không bị vấn đề gì nhưng không đảm bảo được code của process B ghi vào trong lúc dll của mình đang ghi . Mình cũng thử reverse code của B và đang tìm hiểu thêm xem nó co sử dụng cơ chế lock không . Kết quả chưa tìm xong ( code tùm lum , dll quá trời ... ) .
@evh : thật tình hông hiểu cách của bạn đưa ra. Chắc bạn hiểu nhầm vấn đề rồi .
@secmask : override ít code vào B là sao . Bạn có thể nói rõ hơn được không . Hiện tại mình đang sử dụng dll injection . Nhưng vẫn còn bị đụng độ.
Chắc chỉ còn cách reverse chương trình để tìm ra hàm trong nào trong process B truy cập vào địa chỉ đó và gọi nó từ dll hoặc xem nó có dùng share-lock không
Set thread priority đâu có tác dụng trong việc tránh tranh chấp bộ nhớ . Nó chỉ làm thread có quyền cao hơn mà thôi .
Mình đã tìm được lỗi tại sao sai rồi . Tại vì mình set hook nhằm vào trong chương trình gọi thay vì chương trình đích .
Xin lỗi mọi người vì cái topic củ chuối
Mình có 2 process
Process A bị hook
Process B là process hook vào A
========
Xét process A
Ở DLL chứa hàm hook của loại WH_CALLWNDPROC
Khi mình hook CallWndProc :
Code:
if (nCode < 0) // do not process message
return CallNextHookEx(hhook, nCode, wParam, lParam);
switch (nCode)
{
case HC_ACTION:
{
if (wParam == 0) {//by another thread
CWPSTRUCT* info = (CWPSTRUCT*) lParam ;
mess = info->message ;
switch (mess) {
case WM_USER + 1:
{
// do some thing here
}
}
default:
break;
}
return CallNextHookEx(hhook, nCode,wParam, lParam);


ở process B còn lại mình gửi lệnh SendMessage(hwnd,WM_USER+1,0,0)
Nhưng hook không bắt được thông điệp này . Không biết mình viết sai chỗ nào . Mong các bạn hướng dẫn
PS :
Hàm hook hoạt động bình thường , chương trình chạy vào được hàm hook
Handle cửa sổ của A nhận được chính xác .
Đúng như Hoàng nói , ý của mình như sau :
A : là một process do mình viết
B : là một ứng dụng của người khác và B là một ứng dụng network application

@ light.phoenix :
1.Việc không quan tâm đến việc tranh chấp khi gọi các hàm WriteProcessMemory là sai , nó có thể khiến hệ thống chạy không đúng đặc biệt nếu ứng dụng chạy liên tục trong thời gian dài
2.Việc sử dụng hook API ( cho hàm writeprocessmemory và readprocessmemory ) là không khả thi đúng như bạn nói vì B có thể sử dụng con trỏ hoặc các hàm read write trên memory do B quản lý

@ptalksoft : Mình cũng không hiểu ý của bạn . Bạn có thể nói rõ hơn được không .

PS : Hàm ReadProcessMemory và WriteProcessMemory hình như yêu cầu có quyền administrator mới sử dụng được . Không biết có cách nào vượt qua không . Theo mình thì mình có thể tự nâng quyền của mình lên để có quyền debug rồi gọi hàm này có khả thi không .
Do đây là hàm debug nên có một số ứng dụng B có thể sử dụng hàm IsDebug của NT để chống debug . Không biết có cách nào vượt qua.
Việc hook API cho các hàm WriteProcessMemory và ReadProcessMemory là một ý rất hay trong việc crack phần mềm . ^^ .
Thanks mọi người góp ý .
Mình không muốn suspend chương trình B tại vì B là chương trình ứng dụng mạng . Khi mình suspend sẽ gây lỗi chương trình chạy sai .
Còn cách hook vào API readprocessmemory và writeprocessmemory thì không được vì nó khá phức tạp và thứ 2 : do mình truy xuất vào memory của B mà B không chỉ dùng readprocessmemory hoặc writeprocessmemory để ghi lên bộ nhớ của nó ( nó có thể dùng các hàm khác để làm ) cho nên hook vào 2 hàm này không có tác dụng gì nhiều . Bạn có thể giới thiệu những cách khác để từ A mình có thể truy xuất vào vùng nhớ của B mà không gây ảnh hưởng đến hoạt động của B .
Thanks LVH đã góp ý
Trong OlllyDbg , có cách nào khi phân tích file xong , nó cho mình biết hàm địa chỉ nào là của hàm API nào không .
Chằng hạn mình biết chương trình đó viết bằng VC . Nó có sử dụng hàm send và recv để gửi và nhận dữ liệu từ server . Mình muốn tìm các vị trí mà nó gọi hàm send và recv để debug . Nhưng trong OllyDbg không thấy .
Bạn nào biết xin chỉ dùm
Cám ơn.
Khi mình sử dụng hàm ReadProcessMemory và hàm WriteProcessMemory , làm sao tránh được trường hợp tranh chấp đọc ghi dữ liệu .
Mình có 2 process :
process A : là chương trình của mình viết
process B : là process mình cần đọc và ghi trên memory của nó .
Từ A mình gọi hàm WriteProcessMemory để ghi vào một ô nhớ nào đó trên B.
Nhưng mình không biết cách nào để cho trong khi mình ghi thì B ko được thao tác trên ô nhớ đó .
Các bạn có thể chỉ mình cách để tránh trường hợp đó (hoặc tài liệu để đọc) hoặc những cách tương đương (hoặc hàm tương đương ) để làm .
PS :
Hiện tại mình có thể dùng cách hook vào B ( WM_WNDPROC ) . Rồi trong hàm hook gọi hàm readprocessmemory và writeprocessmemory để tránh xung đột đươc không . Mình không muốn chương trình B bị dừng lại trong quá trình gọi các hàm read hoặc write ( nghĩa là B vẫn chạy như bình thường)

Mình có thiết lập một ftp home server ở máy ở nhà với mục đích share file .
Mình làm các bước như sau :
1.Cài đặt một sub domain của no-ip.com để nó luôn trỏ đến địa chỉ IP của máy ở nhà . Kiểm tra lại IP của domain thấy nó luôn chỉ đúng đên địa chỉ IP của máy .
2. Cài đặt một ftp server ( filezilla -- free ) 8)
3. Cấu hình ftp server sử dụng port 21 . Tạo account . Cấu hình root
4.Cấu hình router ( sử dụng wireless D-Link router) mở port 21 . Port foward đến PC có ftp server ( router port 21 --> PC port 21 )

Test server trên localhost thi nó nhận được ftp server
Nhưng khi test tử ngoài internet truy cập vào thì nó báo sai . Hông biêt tại sao sai .
Cấu hình máy : PC cài win 2003 , cài domain controller . Cài zonealarm . Tắt luôn zone alarm trước khi test ở ngoài localhost

Các bạn ai đã từng làm ftp server sử dụng dynamic DNS xin chỉ dùm mình cách sửa .
 
Go to Page:  First Page Page 1

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