Archived

This forum has been archived. Please start a new discussion on GitHub.

Assertion raised in Ice3.4.1 ConnectionI.cpp:2587

We have a regular assertion raised in ConnectionI.cpp. Below is the stack trace
(gdb) bt
#0 0x000000300a830265 in raise () from /lib64/libc.so.6
#1 0x000000300a831d10 in abort () from /lib64/libc.so.6
#2 0x000000300a8296e6 in __assert_fail () from /lib64/libc.so.6
#3 0x00002b3056f75f5f in Ice::ConnectionI::parseMessage (this=0x2aaab9fea050, stream=@0x49bb8ca8,
invokeNum=@0x49bb89b4, requestId=@0x49bb89b8, compress=@0x49bb89bf, servantManager=@0x49bb89a0,
adapter=@0x49bb8990, outAsync=@0x49bb8980) at ConnectionI.cpp:2587
#4 0x00002b3056f7fbe5 in Ice::ConnectionI::message (this=0x2aaab9fea050, current=@0x49bb8ca0)
at ConnectionI.cpp:1353
#5 0x00002b30570c1dc3 in IceInternal::ThreadPool::run (this=0x8ea12d0, thread=@0x49bb90a0) at ThreadPool.cpp:624
#6 0x00002b30570c2991 in IceInternal::ThreadPool::EventHandlerThread::run (this=0x2aaab9c40dc0)
at ThreadPool.cpp:1097
#7 0x00002b30562662ca in startHook (arg=0x2aaab9c40dc0) at Thread.cpp:413
#8 0x000000300b0064[PHP][/PHP]a7 in start_thread () from /lib64/libpthread.so.0
#9 0x000000300a8d3c2d in clone () from /lib64/libc.so.6
(gdb)

When the assertion is raised
assert(_state > StateNotValidated && _state < StateClosed);
, _state has the value StateClosed. This is probably due to an exception raised in the call to sendNextMessage a few lines above. We hadn't Ice.Trace.Network activated when the assertions were raised so no way to check this hypothesis without reproducing the pb.

We worked around this problem by checking that the connection is not closed prior to calling sendNextMessage
if(current.operation & SocketOperationWrite)
{
sendNextMessage(sentCBs);
}

if (_state == StateClosed)
return;

if(current.operation & SocketOperationRead)
{
parseMessage(current.stream, invokeNum, requestId, compress, servantManager, adapter, outAsync);
}

We did not test against Ice 3.4.2 so see if the problem remains in the latest revision.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Thanks for the bug report. Your fix should work. We will look into fixing this for the next release.

    Cheers,
    Benoit.