[asterisk-dev] [Code Review] 2834: res_pjsip: Fix crash when configuration system fails

Matt Jordan reviewboard at asterisk.org
Tue Sep 10 07:48:36 CDT 2013



> On Sept. 9, 2013, 8 p.m., Corey Farrell wrote:
> > 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.

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.


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2834/#review9639
-----------------------------------------------------------


On Sept. 7, 2013, 2:15 a.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2834/
> -----------------------------------------------------------
> 
> (Updated Sept. 7, 2013, 2:15 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/res_pjsip.c 398627 
> 
> Diff: https://reviewboard.asterisk.org/r/2834/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130910/babde525/attachment.htm>


More information about the asterisk-dev mailing list