[SR-Users] sqlops crash when connection does not exist

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 17 08:07:32 CET 2011


Hello,

I pushed a commit on the master that tries to make a graceful shutdown:

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2396dde7230e04f853e6936cfff9059661c55635

Maybe you can try it with your case again and see if all goes fine now, 
then it can be backported.

Thanks,
Daniel

On 11/16/11 7:48 AM, Daniel-Constantin Mierla wrote:
> Hello,
>
> looks like the issue is in the way shut down is done. In this specific 
> case, sqlops does not initialize properly due to misspell, causing 
> kamailio to shut down -- otherwise there is no issue with sqlops 
> itself. At shutdown, the destroy function of each module is called, 
> then the module structure is freed. Looks like mysql module is 
> destroyed first, then htable module is destroyed, which needs to 
> connect to sync back the content in memory to db tables, but the mod 
> exports structure for mysql is invalid now causing a fault access.
>
> I will make a patch for it.
>
> Cheers,
> Daniel
>
>
> On 11/16/11 5:07 AM, Juha Heinanen wrote:
>> i misspelled connection argument in sql_query and got crash:
>>
>> Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR: sqlops 
>> [sqlops.c:266]: invalid connection [sip-proxy]
>> Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR:<core>  
>> [route.c:1216]: fixing failed (code=-1) at 
>> cfg:/etc/sip-proxy/sip-proxy.cfg:281
>> Nov 10 17:19:15 sip kernel: [  990.129668] sip-proxy[4182]: segfault 
>> at 786e6570 ip b769de38 sp bf960ffc error 4 in 
>> libc-2.11.2.so[b762b000+140000]
>>
>> (gdb) where
>> #0  0xb769de38 in strcmp () from /lib/i686/cmov/libc.so.6
>> #1  0x080f54f9 in find_mod_export_record (mod=0xb750bb80 "db_mysql",
>>      name=0xb720d353 "db_bind_api", param_no=0, flags=0, 
>> mod_if_ver=0xbf96108c)
>>      at sr_module.c:657
>> #2  0x080f5756 in find_mod_export (mod=0xb750bb80 "db_mysql",
>>      name=0xb720d353 "db_bind_api", param_no=0, flags=0) at 
>> sr_module.c:722
>> #3  0xb720449c in db_bind_mod (mod=0xb6628944, mydbf=0x8) at db.c:209
>> #4  0xb66240d2 in ht_db_init_con () at ht_db.c:75
>> #5  0xb661b144 in destroy () at htable.c:225
>> #6  0x080f3684 in destroy_modules () at sr_module.c:782
>> #7  0x0809087c in cleanup (show_status=0) at main.c:564
>> #8  0x08091509 in shutdown_children (show_status=0, sig=<value 
>> optimized out>)
>>      at main.c:706
>> #9  0x080940f7 in main (argc=17, argv=0xbf961354) at main.c:2523
>>
>> -- juha
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list