#1033 closed defect (fixed)
Assertion error when shutting down PJSIP while TCP/TLS connect is in progress and a transaction is waiting (thanks Tamàs Solymosi for the report)
Reported by: | bennylp | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-1.6 |
Component: | pjsip | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: |
Description
Assertion in sip_transaction.c when the transaction layer is being unloaded and a transaction is still pending/waiting for transport operation to complete, for example when TCP/TLS transport is connecting to the destination.
Typical stack trace:
17 pj_thread_local_get() ..\pjlib\src\pj\os_core_symbian.cpp:699 0x789f0dd4 16 lock_tsx() ..\pjsip\src\pjsip\sip_transaction.c:902 0x78973914 15 send_msg_callback() ..\pjsip\src\pjsip\sip_transaction.c:1642 0x7897543c 14 stateless_send_transport_cb() ..\pjsip\src\pjsip\sip_util.c:1074 0x78987c40 13 transport_send_callback() ..\pjsip\src\pjsip\sip_transport.c:610 0x78978e60 12 on_data_sent() ..\pjsip\src\pjsip\sip_transport_tls.c:1009 0x78981204 11 tls_destroy() ..\pjsip\src\pjsip\sip_transport_tls.c:662 0x7898067c 10 tls_destroy_transport() ..\pjsip\src\pjsip\sip_transport_tls.c:621 0x78980578 9 destroy_transport() ..\pjsip\src\pjsip\sip_transport.c:941 0x78979878 8 pjsip_tpmgr_destroy() ..\pjsip\src\pjsip\sip_transport.c:1258 0x7897a250 7 pjsip_endpt_destroy() ..\pjsip\src\pjsip\sip_endpoint.c:595 0x789643bc 6 pjsua_destroy() ..\pjsip\src\pjsua-lib\pjsua_core.c:1596 0x7892c4f8
Change History (7)
comment:1 Changed 15 years ago by bennylp
comment:2 Changed 15 years ago by bennylp
Initial fix in r3071:
- added cancellation mechanism, where transaction can ignore the send message completion callback if it has been destroyed
comment:3 Changed 15 years ago by bennylp
- Resolution set to fixed
- Status changed from new to closed
comment:4 Changed 15 years ago by bennylp
comment:5 Changed 15 years ago by bennylp
- Resolution fixed deleted
- Status changed from closed to reopened
Reopened:
It's been reported that r3071 caused transaction to refuse to send ACK
comment:6 Changed 15 years ago by bennylp
- Resolution set to fixed
- Status changed from reopened to closed
In r3090:
- Fixed the problem above that caused ACK not to be sent. This happened when TCP switching is used, and the TCP fails to send the request.
comment:7 Changed 15 years ago by nanang
In r3114:
- Fixed send_msg_callback of transaction.c to reset 'cont' flag to stop (re)transmitting when transaction has been unregistered.
Note: See
TracTickets for help on using
tickets.
Additional info:
This happens because when the transport is being destroyed, it will cancel all pending send operations on this transport instance. This cancellation then reach the transaction instance, which will try to cancel and unregister itself from the transaction layer module. But unfortunately, at this point the transaction layer module had been destroyed beforehand because it has higher priority number than the transport layer module, causing the assertion.
A different but similar stack trace on Linux:
Steps to reproduce this: