Tom van der Geer writes:

this happens if in your application you don't call setStopped() for all possible cases.

Usually with b2b apps that is failed calls on the second leg. IIRC you need to check whether the dialog's status changes from Pending to Disconnected in onSipReply, or, in the caller leg, you need to call terminateOtherLeg(). It's not really intuitive; do you think we should introduce onFailedCall event handler?

Stefan
Stefan, can you elaborate a bit more on this? I'm also working on a B2B application and occasionally SEMS crashes which might be caused by too much (or too little) session/thread cleanup. When SEMS crashes it happens during destructing my AmB2BCallerSession derived class (~MyCallerDialog()). It mentions:

(8707) DEBUG: [b7257bb0] ~MyCallerDialog (MyApplication.cpp:373): MyCallerDialog::~MyCallerDialog() (8707) DEBUG: [b7257bb0] ~AmB2BSession (AmB2BSession.cpp:51): relayed_req.size() = 0 (8707) DEBUG: [b7257bb0] ~AmB2BSession (AmB2BSession.cpp:52): recvd_req.size() = 0 (8707) DEBUG: [b7257bb0] ~AmSipDialog (AmSipDialog.cpp:50): callid = [email protected] (8707) DEBUG: [b7257bb0] ~AmSipDialog (AmSipDialog.cpp:51): local_tag = 547A01EE-4A0D5DA7000A5A3A-B7459BB0 (8707) DEBUG: [b7257bb0] ~AmSipDialog (AmSipDialog.cpp:52): uac_trans.size() = 1 (8707) DEBUG: [b7257bb0] ~AmSipDialog (AmSipDialog.cpp:57): cseq = 10; method = INVITE (8707) DEBUG: [b7257bb0] ~AmSipDialog (AmSipDialog.cpp:60): uas_trans.size() = 0
*** glibc detected *** free(): invalid pointer: 0x081a5c10 ***

or

*** glibc detected: double free or corruption (!prev)

Crashes are not exactly reproducible, but happen after 10 and sometimes even 500 successful calls. Quite possibly I'm not covering all scenario's (e.g. LEG B busy) correctly. Any hints? Thanks in advance!
Best regards,

Tom

Some more information.
Now it ran over 1000 successful test calls and then it crashed with:

(31583) DEBUG: [b7288bb0] clean_sessions (AmSessionContainer.cpp:91): session 0xb60c2bb0 has been destroyed' (31583) DEBUG: [b7288bb0] ~MyCallerDialog (MyApplication.cpp:374): MyCallerDialog::~MyCallerDialog() (31583) DEBUG: [b7288bb0] ~AmB2BSession (AmB2BSession.cpp:51): relayed_req.size() = 0 (31583) DEBUG: [b7288bb0] ~AmB2BSession (AmB2BSession.cpp:52): recvd_req.size() = 0 (31583) DEBUG: [b7288bb0] ~AmSipDialog (AmSipDialog.cpp:50): callid = [email protected] (31583) DEBUG: [b7288bb0] ~AmSipDialog (AmSipDialog.cpp:51): local_tag = 74AB70FA-4A13D11E0007122E-B748ABB0 (31583) DEBUG: [b7288bb0] ~AmSipDialog (AmSipDialog.cpp:52): uac_trans.size() = 1 (31583) DEBUG: [b7288bb0] ~AmSipDialog (AmSipDialog.cpp:57): cseq = 10; method = INVITE (31583) DEBUG: [b7288bb0] ~AmSipDialog (AmSipDialog.cpp:60): uas_trans.size() = 0
*** glibc detected *** double free or corruption (out): 0x0835ff50 ***

This is what I get when I do a bt in gdb:

Core was generated by `sems -D 3 -E'.
Program terminated with signal 6, Aborted.
#0  0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7d34811 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7d35fb9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7d69dfa in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7d7168f in mallopt () from /lib/tls/i686/cmov/libc.so.6
#5  0xb7d71732 in free () from /lib/tls/i686/cmov/libc.so.6
#6  0xb7ef73b1 in operator delete () from /usr/lib/libstdc++.so.6
#7  0xb7ccc585 in ~MyCallerDialog (this=0x6) at MyApplication.cpp:380
#8 0x080d19b2 in AmSessionContainer::clean_sessions (this=0x8127a58) at AmSessionContainer.cpp:92 #9 0x080d2352 in AmSessionContainer::run (this=0x8127a58) at AmSessionContainer.cpp:129
#10 0x080eecb5 in AmThread::_start (_t=0x8127a58) at AmThread.cpp:70
#11 0xb7f32240 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#12 0xb7dd749e in clone () from /lib/tls/i686/cmov/libc.so.6

Is there anything I can do to prevent these crashes? Any clues?
Regards,

Tom
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to