<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2834/">https://reviewboard.asterisk.org/r/2834/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On September 9th, 2013, 8 p.m. UTC, <b>Corey Farrell</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Please take a look at Joshua's patch on ASTERISK-22474. Your patch partially addresses test #1 from that ticket; core stop gracefully from test #1 gave me a segfault with your patch. Your patch also does not fix test #2.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hm. I didn't run into the core stop gracefully issue, but then again, my module load order was probably different than yours.
I'm fine deferring this to the patch on ASTERISK-22474.</pre>
<br />
<p>- Matt</p>
<br />
<p>On September 7th, 2013, 2:15 a.m. UTC, Matt Jordan wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Matt Jordan.</div>
<p style="color: grey;"><i>Updated Sept. 7, 2013, 2:15 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">While playing around with Asterisk, I managed to tell it to load res_pjsip and friends with no sorcery wizards loaded. This resulted in the following crash:
Thread 1 (Thread 0x7f1af1ada760 (LWP 6119)):
#0 ast_threadpool_push (pool=0x0, task=0x7f1aba1d0880 <sync_task>, data=0x7fff1e4157a0)
at threadpool.c:896
#1 0x00007f1aba1d2aec in ast_sip_push_task_synchronous (serializer=0x0,
sip_task=0x7f1aba1d0f70 <unregister_service>, task_data=0x7fff1e415858) at res_pjsip.c:1694
#2 0x00007f1aba1d2b7c in ast_sip_unregister_service (module=0x7f1aba3e4180) at res_pjsip.c:1050
#3 0x00007f1aba1d7820 in ast_sip_destroy_distributor () at res_pjsip/pjsip_distributor.c:368
#4 0x00007f1aba1d0c7a in load_module () at res_pjsip.c:1886
#5 load_module () at res_pjsip.c:1803
#6 0x000000000051420f in start_resource (mod=0x1771800) at loader.c:971
#7 0x0000000000514a5a in start_resource (mod=<optimized out>) at loader.c:964
#8 load_resource_list (load_order=0x7fff1e415a80, global_symbols=1, mod_count=0x7fff1e415a9c)
at loader.c:1174
#9 0x000000000051661a in load_modules (preload_only=<optimized out>) at loader.c:1322
#10 0x000000000042ffdd in main (argc=<optimized out>, argv=<optimized out>) at asterisk.c:4431
Basically, since sorcery can't load the configuration, you jump to the error: label and call ast_sip_destroy_distributor with no threadpool allocated. Kerblooey.
This patch checks for this in ast_sip_unregister_service, which feels like the most appropriate place as you shouldn't push a task to unregister a service if you don't have a serializer/threadpool. I'm open to other suggestions on where to catch this however.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/12/res/res_pjsip.c <span style="color: grey">(398627)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2834/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>