summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMichael Kuron <m.kuron@gmx.de>2016-11-26 17:57:03 +0100
committerMichael Kuron <m.kuron@gmx.de>2016-11-26 18:16:54 +0100
commit0cc8351484ffbad5c5d7294f68016a83de00b7c6 (patch)
tree7901d67272338d6a42c37f5dc810024ceff1e661 /main
parent5027b0d5e631e22616cb4545ee4369b3dcab03cf (diff)
chan_sip: Fix segfault during module unload
If a TCP/TLS connection was pending (not accepted and not timed out) during unload of chan_sip, Asterisk would segfault when trying to send a signal to a thread whose thread ID hadn't been recorded yet. This commit fixes that by recording the thread ID before calling the blocking connect() syscall. This was a regression introduced by 776a14386a55b5425c7e9617eff8af8b45427144. The above wasn't enough to fix the segfault, which was now delayed to the point where connect() timed out. Therefore, it was necessary to also remove the SA_RESTART flag from the SIGURG sigaction so that pthread_kill() could be used to interruput the connect() syscall. This was a regression introduced by 5d313f51b982a18f7321adcf7c7a4e822d8b2714. ASTERISK-26586 #close Change-Id: I76fd9d47d56e4264e2629bce8ec15fecba673e7b
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index fa919936b..746823ef5 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1799,7 +1799,6 @@ static void _urg_handler(int num)
static struct sigaction urg_handler = {
.sa_handler = _urg_handler,
- .sa_flags = SA_RESTART,
};
static void _hup_handler(int num)