[Home]

Summary:ASTERISK-02954: [patch] res_config_mysql.c causes core dump
Reporter:Brian Jones (bjones)Labels:
Date Opened:2004-12-09 17:27:22.000-0600Date Closed:2008-01-15 15:16:31.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) sipfix.diff.txt
Description:Realtime config dumps core after making sql query.  Also, the supplied makefile patch fails on hunk 2, had to enter it manually.

I have a ethereal trace if needed.
Comments:By: Brian West (bkw918) 2004-12-09 18:34:40.000-0600

Ya know a little bit of information would be helpful such as a backtrace.

bkw

By: Russell Bryant (russell) 2004-12-10 06:23:57.000-0600

Also, please try this with a fresh checkout from CVS.  If you still have the issue, please provide a backtrace.

By: Brian Jones (bjones) 2004-12-10 08:42:24.000-0600

drumkilla, could you please point me to some instructions on how to do a backtrace.  I'm not a programmer... just trying to help out.

By: Brian Jones (bjones) 2004-12-10 08:59:53.000-0600

BTW, I just tried with a fresh checkout of CVS head (same version as reported) and it still segfaults.

By: Russell Bryant (russell) 2004-12-10 09:38:35.000-0600

Sure!  I do very much appreciate your help.

cd /usr/src/asterisk
make clean; make valgrind; make install

run asterisk with -g so you get a core dump... let it seg fault

gdb ./asterisk core.<pid>

<pid> is the process id of the instance of Asterisk that just died on you.

Once you are in gdb, type 'bt'.  The output from that command is what we are looking for.

If you have any problems with this, please contact me or one of the other bug marshalls on IRC (irc.freenode.net  #asterisk  #asterisk-bugs).

Thanks!

edited on: 12-10-04 09:40

By: Brian Jones (bjones) 2004-12-10 10:43:02.000-0600

Here you go.  Thanks for the help!

(gdb) bt
#0  0x0088da60 in strncpy () from /lib/tls/libc.so.6
#1  0x003943f2 in build_peer (name=0x0, v=0x8288a40, temponly=1) at chan_sip.c:8417
#2  0x00379654 in realtime_peer (peername=0x0, sin=0x82a11d8) at chan_sip.c:1093
#3  0x00379979 in find_peer (peer=0x0, sin=0x82a11d8) at chan_sip.c:1162
#4  0x0038923c in check_user_full (p=0x82a1060, req=0x23197d0, cmd=0x23199e4 "INVITE",
   uri=0x23199eb "sip:2563273505@69.73.15.158:5060", reliable=1, sin=0x23197c0, ignore=0, mailbox=0x0, mailboxlen=0)
   at chan_sip.c:5460
ASTERISK-1  0x0038991a in check_user (p=0x82a1060, req=0x23197d0, cmd=0x23199e4 "INVITE",
   uri=0x23199eb "sip:2563273505@69.73.15.158:5060", reliable=1, sin=0x23197c0, ignore=0) at chan_sip.c:5551
ASTERISK-2  0x003901c6 in handle_request (p=0x82a1060, req=0x23197d0, sin=0x23197c0, recount=0x23197ac, nounlock=0x23197b0)
   at chan_sip.c:7296
ASTERISK-3  0x00391fed in sipsock_read (id=0x82721c0, fd=10, events=1, ignore=0x0) at chan_sip.c:7753
ASTERISK-4  0x08053199 in ast_io_wait (ioc=0x8270918, howlong=1000) at io.c:267
ASTERISK-5  0x00392730 in do_monitor (data=0x0) at chan_sip.c:7903
ASTERISK-6 0x00a6098c in start_thread () from /lib/tls/libpthread.so.0
ASTERISK-7 0x008e216a in clone () from /lib/tls/libc.so.6

Please let me know if there is any other information I can get for you.

By: Brian Jones (bjones) 2004-12-10 17:30:19.000-0600

BTW, this is running on Fedora Core 2.

By: Russell Bryant (russell) 2004-12-10 18:57:00.000-0600

Thank you for providing a backtrace so quickly.

By: Russell Bryant (russell) 2004-12-10 19:01:55.000-0600

Please test this patch and let me know if it fixes your problem.

To apply a patch, save it and do the following ...

cd /usr/src/asterisk
patch -p0 < /path/to/sipfix.diff.txt
make clean; make valgrind; make install

Thanks

This patch has been properly disclaimed.

edited on: 12-12-04 09:51

By: Brian Jones (bjones) 2004-12-13 09:23:37.000-0600

That fixed it.  Thanks!

By: Mark Spencer (markster) 2004-12-13 10:29:37.000-0600

Fixed in CVS.  Thanks!

By: Russell Bryant (russell) 2004-12-13 15:58:59.000-0600

realtime issue - does not affect 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:16:31.000-0600

Repository: asterisk
Revision: 4442

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r4442 | markster | 2008-01-15 15:16:31 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix res_config_mysql crash (thanks drumkilla!) (bug ASTERISK-2954)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4442