< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] Getting a segmentation fault in SipMessage destructor


I have the following code, modelled after UdpTransport.cxx

    sipMsg->addBuffer(newbuf);
    
    mMsgHeaderScanner.prepareForMessage(sipMsg);
    
    char *unprocessedCharPtr;
    if (mMsgHeaderScanner.scanChunk(newbuf,
                                    len,
                                    &unprocessedCharPtr) !=
        MsgHeaderScanner::scrEnd)
        
    {
        return _RvFailure_;
    }

    Do some processing { currently commented out }

    delete sipMsg;

This works fine with a register message, but with an invite message, it
cores with the following back trace:

0xb74357c7 in raise () from /lib/tls/libc.so.6
#1  0xb743706b in abort () from /lib/tls/libc.so.6
#2  0xb746c545 in __fsetlocking () from /lib/tls/libc.so.6
#3  0xb7472b97 in malloc_usable_size () from /lib/tls/libc.so.6
#4  0xb7473032 in free () from /lib/tls/libc.so.6
#5  0xb7ed4051 in operator delete () from /usr/lib/libstdc++.so.6
#6  0xb7844846 in resip::SipMessage::cleanUp (this=0x8074d58) at
SipMessage.cxx:176
#7  0xb78445d1 in ~SipMessage (this=0x8074d58) at SipMessage.cxx:168

Thanks,
Vinod