[asterisk-bugs] [Asterisk 0012346]: null pointer in chan_skinny when 'regcontext' used

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Apr 2 04:53:33 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12346 
====================================================================== 
Reported By:                candlerb
Assigned To:                mvanbaak
====================================================================== 
Project:                    Asterisk
Issue ID:                   12346
Category:                   Channels/chan_skinny
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 111962 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-01-2008 03:57 CDT
Last Modified:              04-02-2008 04:53 CDT
====================================================================== 
Summary:                    null pointer in chan_skinny when 'regcontext' used
Description: 
Uncomment the 'regcontext' example line from skinny.conf, wait for a Cisco
phone to connect, and Asterisk dumps core.

GDB output:

...
[New Thread -1215501408 (LWP 12516)]
    -- Starting Skinny session from 10.69.255.249
    -- Added extension '110' priority 1 to skinnyregistrations

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215501408 (LWP 12516)]
ast_add_extension2 (con=0x86d1a88, replace=1, extension=0xb78ce1c0 "110",
    priority=Variable "priority" is not available.
) at pbx.c:6056
6056                            if (x->exten) { /* this test for safety
purposes */
(gdb) bt
http://bugs.digium.com/view.php?id=0  ast_add_extension2 (con=0x86d1a88,
replace=1, extension=0xb78ce1c0
"110",
    priority=Variable "priority" is not available.
) at pbx.c:6056
http://bugs.digium.com/view.php?id=1  0x080e4f71 in ast_add_extension
(context=0x363840
"skinnyregistrations",
    replace=141620640, extension=0x870f5a0 "??p\b", priority=141620640,
    label=0x870f5a0 "??p\b", callerid=0x870f5a0 "??p\b",
    application=0x870f5a0 "??p\b", data=0x870f5a0, datad=0x870f5a0,
    registrar=0x870f5a0 "??p\b") at pbx.c:5859
http://bugs.digium.com/view.php?id=2  0x00359a6f in handle_message
(req=0x870f180, s=0x870e600)
    at
/home/candlerb/svn/asterisk/branches/1.6.0/include/asterisk/utils.h:502
http://bugs.digium.com/view.php?id=3  0x0035b88f in skinny_session
(data=0x870e600) at chan_skinny.c:5585
http://bugs.digium.com/view.php?id=4  0x08122445 in dummy_start (data=0x86d1a88)
at utils.c:870
http://bugs.digium.com/view.php?id=5  0x005793cc in start_thread () from
/lib/tls/libpthread.so.0
http://bugs.digium.com/view.php?id=6  0x004d21ae in clone () from
/lib/tls/libc.so.6
(gdb) print x
$1 = (struct match_char *) 0x0

I wondered if this was perhaps because I had no [skinnyregistrations]
section in extensions.conf, but I added one and it made no difference.

====================================================================== 

---------------------------------------------------------------------- 
 candlerb - 04-02-08 04:53  
---------------------------------------------------------------------- 
I stopped Asterisk, rebuilt with DONT_OPTIMIZE as described and restarted
Asterisk under gdb. Initially when the phone reconnected by itself it was
successful. However I then unplugged and replugged the phone into its PoE
switch to power cycle it, and then Asterisk crashed as before.

*CLI> [New Thread -1215399008 (LWP 30597)]
    -- Starting Skinny session from 10.69.255.249
    -- Added extension '111' priority 1 to skinnyregistrations
    -- Device 'SEP00195659657A' successfully registered
Adding button: 9, 1
Device capability set to '12'
[New Thread -1215644768 (LWP 30606)]
    -- Starting Skinny session from 10.69.255.249

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215644768 (LWP 30606)]
0x080e7f81 in add_pri (con=0x92bfed0, tmp=0x9300db8, el=0x0, e=0x92fe8a0,
    replace=1) at pbx.c:6056
6056                            if (x->exten) { /* this test for safety
purposes */
(gdb) bt
http://bugs.digium.com/view.php?id=0  0x080e7f81 in add_pri (con=0x92bfed0,
tmp=0x9300db8, el=0x0,
e=0x92fe8a0,
    replace=1) at pbx.c:6056
http://bugs.digium.com/view.php?id=1  0x080e850c in ast_add_extension2
(con=0x92bfed0, replace=1,
    extension=0xb78ab110 "111", priority=1, label=0x0, callerid=0x0,
    application=0x2e9d16 "Noop", data=0x9300da8, datad=0x805a970,
    registrar=0x2e99b8 "Skinny") at pbx.c:6225
http://bugs.digium.com/view.php?id=2  0x080e7766 in ast_add_extension
(context=0x2ef2e0
"skinnyregistrations",
    replace=1, extension=0xb78ab110 "111", priority=1, label=0x0,
    callerid=0x0, application=0x2e9d16 "Noop", data=0x9300da8,
    datad=0x805a970, registrar=0x2e99b8 "Skinny") at pbx.c:5859
http://bugs.digium.com/view.php?id=3  0x002d83c3 in register_exten (l=0x92c11b8)
at chan_skinny.c:1697
http://bugs.digium.com/view.php?id=4  0x002d879b in skinny_register
(req=0x92fd470, s=0x92fcc60)
    at chan_skinny.c:1757
http://bugs.digium.com/view.php?id=5  0x002e0966 in handle_register_message
(req=0x92fd470, s=0x92fcc60)
    at chan_skinny.c:3852
http://bugs.digium.com/view.php?id=6  0x002e6a36 in handle_message
(req=0x92fd470, s=0x92fcc60)
    at chan_skinny.c:5291
http://bugs.digium.com/view.php?id=7  0x002e7c78 in skinny_session
(data=0x92fcc60) at chan_skinny.c:5585
http://bugs.digium.com/view.php?id=8  0x08126286 in dummy_start (data=0x92ff6a0)
at utils.c:870
http://bugs.digium.com/view.php?id=9  0x005793cc in start_thread () from
/lib/tls/libpthread.so.0
http://bugs.digium.com/view.php?id=10 0x004d21ae in clone () from
/lib/tls/libc.so.6
(gdb) info threads
* 30 Thread -1215644768 (LWP 30606)  0x080e7f81 in add_pri
(con=0x92bfed0,
    tmp=0x9300db8, el=0x0, e=0x92fe8a0, replace=1) at pbx.c:6056
  29 Thread -1215399008 (LWP 30597)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  28 Thread -1215153248 (LWP 30596)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  27 Thread -1214907488 (LWP 30595)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  26 Thread -1214661728 (LWP 30594)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  25 Thread -1214375008 (LWP 30593)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  24 Thread -1214129248 (LWP 30592)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  23 Thread -1213883488 (LWP 30591)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  22 Thread -1213637728 (LWP 30590)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  21 Thread -1213391968 (LWP 30589)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  20 Thread -1213146208 (LWP 30588)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  19 Thread -1212900448 (LWP 30587)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  18 Thread -1212654688 (LWP 30586)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  17 Thread -1212408928 (LWP 30585)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  16 Thread -1212163168 (LWP 30584)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  15 Thread -1211917408 (LWP 30583)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  14 Thread -1211671648 (LWP 30582)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  13 Thread -1211425888 (LWP 30581)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  12 Thread -1211180128 (LWP 30580)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  11 Thread -1210934368 (LWP 30579)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  10 Thread -1210688608 (LWP 30578)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  9 Thread -1210442848 (LWP 30577)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  8 Thread -1210197088 (LWP 30576)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  7 Thread -1209951328 (LWP 30575)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  6 Thread -1209705568 (LWP 30574)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  5 Thread -1209447520 (LWP 30573)  0x003ef7a2 in _dl_sysinfo_int80 ()
---Type <return> to continue, or q <return> to quit---
   from /lib/ld-linux.so.2
  4 Thread -1209201760 (LWP 30572)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  3 Thread -1208956000 (LWP 30571)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
  1 Thread -1208952608 (LWP 30567)  0x003ef7a2 in _dl_sysinfo_int80 ()
   from /lib/ld-linux.so.2
(gdb) print x
$1 = (struct match_char *) 0x0
(gdb)

FWIW, platform is CentOS 4.6 (kernel 2.6.9-67.0.7.EL), and the steps I'm
running to start Asterisk are:

# gdb /usr/sbin/asterisk
run -cnvvv

Just to be sure, I repeated the whole process as follows:

- unplug phone and stop asterisk
- start asterisk as shown above; wait for asterisk to give CLI> prompt
- plug in phone

It was successful this time:

*CLI> [New Thread -1215263840 (LWP 30675)]
    -- Starting Skinny session from 10.69.255.249
    -- Added extension '111' priority 1 to skinnyregistrations
    -- Device 'SEP00195659657A' successfully registered
Adding button: 9, 1
Device capability set to '12'

I then unplugged the phone and plugged it back in:

    -- ast_get_srv: SRV lookup for '_sip._UDP.sipgate.co.uk' mapped to
host sipgate.co.uk, port 5060
    -- ast_get_srv: SRV lookup for '_sip._UDP.sipgate.co.uk' mapped to
host sipgate.co.uk, port 5060
[New Thread -1215509600 (LWP 30681)]
    -- Starting Skinny session from 10.69.255.249

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215509600 (LWP 30681)]
0x080e7f81 in add_pri (con=0x8c9e878, tmp=0x8cdca30, el=0x0, e=0x8cdd6d8,
    replace=1) at pbx.c:6056
6056                            if (x->exten) { /* this test for safety
purposes */
(gdb)

So it's pretty repeatable, if not on the very first connection. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-02-08 04:53  candlerb       Note Added: 0084912                          
======================================================================




More information about the asterisk-bugs mailing list