[Asterisk-code-review] chan sip: Fix segfault during module unload (asterisk[13])
Michael Kuron
asteriskteam at digium.com
Sun Nov 27 16:01:49 CST 2016
Michael Kuron has posted comments on this change. ( https://gerrit.asterisk.org/4494 )
Change subject: chan_sip: Fix segfault during module unload
......................................................................
Patch Set 1:
Here's a bit more information on the second segfault (the first one is detailed on JIRA). That's the one I fix by turning off SA_RESTART on the SIGURG handler (it seemed like an oversight that this flag is present because it prevents all those pthread_kill(..., SIGURG) from actually stopping any blocking syscalls, which is their sole purpose).
When ast_tcptls_client_start ends with return NULL, the segfault happens immediately, and comes with what looks like a stack corruption. If you have any suggestions why that happens, I'm happy to try and fix that segfault as well. I think there is potentially another race condition that could still trigger the segfault even without the SA_RESTART flag: if the module unload is executed (and consequently, pthread_kill(..., SIGURG) is run) after the threadinfo has been created but before the thread has reached ast_connect in ast_tcptls_client_start, the blocking syscall is never interrupted and runs into the stack-corrupting segfault after it times out.
--
To view, visit https://gerrit.asterisk.org/4494
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I76fd9d47d56e4264e2629bce8ec15fecba673e7b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Michael Kuron <m.kuron at gmx.de>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Michael Kuron <m.kuron at gmx.de>
Gerrit-HasComments: No
More information about the asterisk-code-review
mailing list