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

Possible race between media deinitialization and media initialization #3965

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

nanangizz
Copy link
Member

A crash has been reported in destroying PJSUA with several concurrent calls, call stack trace is:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000028
Triggered by Thread:  0

Thread 0 Crashed:
0   (pjmedia_transport_simulate_lost + 28)
1   (call_media_init_cb + 168)
2   (call_media_init_cb + 168)
3   (ice_init_complete_cb + 252)
4   (timer_cb + 108)
5   (pj_timer_heap_poll + 616)
6   (pjsip_endpt_handle_events2 + 96)
7   (pjsua_handle_events + 84)
8   (busy_sleep + 88)
9   (pjsua_destroy2 + 1620)

Asynchronous ICE initialization callback seems to be invoked after the ICE transport is destroyed. As the ICE initialization callback is called by pjsua_destroy2() context (as shown in the stack trace above), simply adding media deinitialization check should be sufficient for this issue.

@nanangizz nanangizz merged commit 90e848f into master Jul 18, 2024
36 checks passed
@nanangizz nanangizz deleted the race-pjsua_destroy-ice_init_complete branch July 18, 2024 07:33
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.

None yet

3 participants