Hello Ice Team,
I have probably found a bug which exists in ICE 3.4.0 and 3.4.1 (other version not tested). Under some circumstances (not so rare!) ICE does something very wrong and the program exists with SEGFAULT under Linux system. It took me almost a week to find out that my code is not responsible for SEGFAULT, I have created simple program based on your example which does segfaults too. Here are some details:
- program is based on demo/minimal example
- program uses AMI for client and AMD for server side
- for AMD calls I used CallQueue (http://www.zeroc.com/newsletter/issue13/qt2.zip) which in my humble opinion should also suit well for
server side asynchronous calls
- client in main loop does:
+ create ice communicator
+ create Hello proxy with low timeout (200ms)
+ send few thousands of AMI sayHello calls and sleeps alternately
+ invoke
communicator->shutdown();
communicator->waitForShutdown();
communicator->destroy();
Client's main loop is repeated about 50 times. After a few iterations client does segfault on my machine. Here are some other observations:
- for greater value of timeout segfault is less probable
- for synchronous server calls (AMD) segfault is unlikely
- debugger shows that the error happens in ConnectionI.cpp line: 591 (copy(p, p + sizeof(Int), os->b.begin() + headerSize), I checked that os->b.begin() points to NULL buffer; till today I thought that maybe some part of my code does some writes in memory where ICE objects are located, but I managed to isolate the problem
I put the code in the attachement. I assume that segfault might be caused by some race condition or some path of code which is executed under rare conditions so it might be not easy to reproduce the error immediately on your side.
Regardles from this please check whether the code it is valid and should not cause segfaults.
Best regards
Przemek

, I checked that os->b.begin() points to NULL buffer; till today I thought that maybe some part of my code does some writes in memory where ICE objects are located, but I managed to isolate the problem
Reply With Quote