[Home]

Summary:ASTERISK-03004: Unknown sip user, crash asterisk res_config_mysql
Reporter:apignard (apignard)Labels:
Date Opened:2004-12-15 12:12:12.000-0600Date Closed:2011-06-07 14:00:39
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Resources/res_features
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Asterisk crash after a certain time when maybe too many unknown user try to register.

I have first see this crash when moving on res_realtime. I leave the server a few hours without mysql configuration and asterisk crash. I'm not sure it's only a res_realtime bug (or res_mysql)

Here is gdb bt :
#0  0x425f6aa3 in net_clear () from /usr/lib/libmysqlclient.so.12
(gdb) bt
#0  0x425f6aa3 in net_clear () from /usr/lib/libmysqlclient.so.12
#1  0x425dd2e5 in simple_command () from /usr/lib/libmysqlclient.so.12
#2  0x425df68d in mysql_send_query () from /usr/lib/libmysqlclient.so.12
#3  0x425dfab0 in mysql_real_query () from /usr/lib/libmysqlclient.so.12
#4  0x425c7b47 in realtime_mysql (database=0x42f25be0 "asterisk",
   table=0x42f25ae0 "sip", ap=0x3 <Address 0x3 out of bounds>)
   at res_config_mysql.c:117
ASTERISK-1  0x08058f44 in ast_load_realtime (family=0x3 <Address 0x3 out of bounds>)
   at config.c:434
ASTERISK-2  0x427191bf in realtime_peer (peername=0x42f2721a "10001", sin=0x3)
   at chan_sip.c:1100
ASTERISK-3  0x42715689 in find_peer (peer=0x42f2721a "10001", sin=0x0)
   at chan_sip.c:1174
ASTERISK-4  0x427203eb in register_verify (p=0x81b27e8, sin=0x42f2f780,
   req=0x42f2f790, uri=0x42f2f9ad "sip:213.161.201.200", ignore=3)
   at chan_sip.c:4902
ASTERISK-5  0x4271c515 in handle_request (p=0x81b27e8, req=0x42f2f790, sin=0x42f2f780,
   recount=0x3, nounlock=0x42f2f718) at chan_sip.c:7741
ASTERISK-6 0x42717a8f in sipsock_read (id=0x8118de0, fd=12, events=1, ignore=0x0)
   at chan_sip.c:7839
ASTERISK-7 0x08052b90 in ast_io_wait (ioc=0x8117100, howlong=3) at io.c:267
ASTERISK-8 0x427120bc in do_monitor (data=0x0) at chan_sip.c:7989
ASTERISK-9 0x400279b4 in start_thread () from /lib/tls/libpthread.so.0

No other special problem was notice.

How to reproduce it ?
I have setup 4-5 SIP devices with unknown user and leave them try to register for 1-2 days. If more unknown user with fastest retry, problem will appear fastly

User 10001 is not a sip user. User 10000 & 10001 is 2 ports analog SIP device. On my first crash this device wasn't connected and only X-LITE,IAX & GrandStream BT100 user was on this server.
Comments:By: Mark Spencer (markster) 2004-12-15 15:22:28.000-0600

Please try res_config_odbc instead of res_config_mysql, also build with "make clean ; make valgrind" so we can get a real backtrace.  Thanks.

By: Mark Spencer (markster) 2004-12-16 16:07:56.000-0600

Hello, if you are still having this bug, please try ODBC instead of MySQL.  If you have lost interest in the bug then let us know and we'll close it.

By: apignard (apignard) 2004-12-16 21:31:48.000-0600

Hello,

I have email Matthew Boehm to tell him maybe to look at this bugtrack and we've exchange mail about it. I have to recompile with suppress one line and i will post report here. I will setup another server this week end with ODBC instead of MySQL. Please note that's this crash can take time to reproduce. One day, this happen 3 times in 1 hour, but another week, no crash.

I'm unable to make test before saturday, sorry for delay.

I have forgot to post debug info, so here is :

Dec 15 11:53:13 DEBUG[7655]: MySQL RealTime: Retrieve SQL: SELECT * FROM sip WHERE name = '10000'
Dec 15 11:53:13 DEBUG[7655]: MySQL RealTime: Everything is fine.
Dec 15 11:53:13 NOTICE[7655]: Registration from '10000<sip:10000@213.161.x.x>' failed for '213.161.x
.x'
Dec 15 11:53:13 DEBUG[7655]: Didn't get a frame from channel: SIP/8290dd7679-9b8b
Dec 15 11:53:13 DEBUG[7655]: Bridge stops bridging channels SIP/8290dd7679-9b8b and SIP/gw0-9366
Dec 15 11:53:13 DEBUG[7655]: MySQL RealTime: Retrieve SQL: SELECT * FROM sip WHERE name = '10001'
Dec 15 11:53:13 DEBUG[7655]: update_user_counter(0170707070) - decrement outUse counter
Dec 15 11:53:13 DEBUG[7655]: MySQL RealTime: Retrieve SQL: SELECT * FROM sip WHERE name = '0170707070'
Dec 15 11:53:13 DEBUG[7655]: MySQL RealTime: Everything is fine.
Dec 15 11:53:13 ERROR[7655]: MySQL RealTime: Attempted to reconnect. Failed. Check debug for more info.

By: apignard (apignard) 2004-12-19 19:17:13.000-0600

After 2 days of running, no crash, i have recompile with removing this line (as suggest Matthew Boehm) and make valgrind :

629: ast_log(LOG_DEBUG, "MySQL RealTime: Server Error: %s\n", mysql_error(&mysql));

The bug can still exist since crash are very random.
If you care of keep this ticket open, you can close it and will reopen or submit when a new crash will occur.

If it's crash again, i will post result and then try with ODBC.

By: Clod Patry (junky) 2004-12-21 00:26:05.000-0600

Gonna close it for now.
If it crashes again(we hope not), just re-open, and provide enough informations.

Thanks.