Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion in sending BYE after transaction timeout #4107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nanangizz
Copy link
Member

@nanangizz nanangizz commented Oct 17, 2024

When a request within dialog gets timeout, the invite session will terminate the session, and in the attempt of sending BYE, an assertion is raised:

src/pjsip-ua/sip_inv.c:287: pjsip_inv_add_ref: Assertion `inv && inv->ref_cnt' failed.

with call stack:

pjsip_inv_add_ref()
pjsip_inv_send_msg()
handle_uac_tsx_response()
mod_inv_on_tsx_state()
pjsip_dlg_on_tsx_state()
tsx_set_state()
tsx_on_state_calling()
tsx_timer_callback()
pj_timer_heap_poll()

Thanks to Taisto Qvist for the report.

After investigation, the transaction timeout handler in the invite sesion shift the invite sesion state to DISCONNECTED before sending BYE. The DISCONNECTED state will decrement the reference counter and may destroy the invite session.

The transaction timeout handler code is actually quite old, it did not raise an assertion because the invite session destructor is not as complex as now (basically it was only decrementing the dialog's session counter, code here).

@TheQue42
Copy link

Would you mind adding a Reason header to the BYE, so that its easier to detect why it was triggered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants