[OpenSIPS-Devel] [ opensips-Bugs-2908798 ] crash on prepared statements

SourceForge.net noreply at sourceforge.net
Tue Dec 8 21:40:08 CET 2009


Bugs item #2908798, was opened at 2009-12-04 15:58
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2908798&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.5.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: crash on prepared statements

Initial Comment:
This crash happened in 1.5.3 - I don't know if it's been fixed / occurs in 1.6.0, because it happens really rarely (every 2 or so weeks):

Last entries in logs:
Nov 28 23:06:57 v-sip-presence-1 opensips[17985]: ERROR:db_mysql:db_mysql_connect: driver error(2003): Can't connect to MySQL server on 'mysql_host'' (111) 
Nov 28 23:06:57 v-sip-presence-1 last message repeated 2 times
Nov 28 23:06:57 v-sip-presence-1 opensips[17985]: ERROR:core:db_do_query: error while submitting query 
Nov 28 23:06:57 v-sip-presence-1 opensips[17985]: ERROR:presence:update_presentity: unsuccessful sql query 
Nov 28 23:06:57 v-sip-presence-1 opensips[17985]: ERROR:presence:handle_publish: when updating presentity 

then some more 'driver error...: cant' connect' from different processes
then:
Nov 28 23:07:55 v-sip-presence-1 opensips[17994]: ERROR:db_mysql:re_init_statement: failed while mysql_stmt_prepare() 
Nov 28 23:07:55 v-sip-presence-1 opensips[17994]: ERROR:db_mysql:db_mysql_do_prepared_query: failed to re-init statement! 
Nov 28 23:07:55 v-sip-presence-1 opensips[17994]: ERROR:presence:msg_presentity_clean: querying database for expired messages 
Nov 28 23:08:46 v-sip-presence-1 opensips[17990]: ERROR:presence:update_presentity: No E_Tag match 
Nov 28 23:08:47 v-sip-presence-1 opensips[17983]: NOTICE:presence:destroy: destroy module ... 

bt:

#0  0x00aed61d in db_mysql_val2bind (v=0xbf9c9024, binds=0x8181c48, i=4) at val.c:254
#1  0x00ae7b71 in db_mysql_do_prepared_query (conn=0x817d0d8, query=0xaf1b60, v=0xbf9c8fd4, n=8, uv=0x0, un=0) at dbase.c:438
#2  0x00ae9bf6 in db_mysql_insert (_h=0x817d0d8, _k=0xbf9c9128, _v=0xbf9c8fd4, _n=8) at dbase.c:858
#3  0x00b977fb in update_presentity (msg=0x81814c8, presentity=0x81827b8, body=0xbf9c91ec, new_t=1, sent_reply=0xbf9c91c4, sphere=0x0) at presentity.c:390
#4  0x00b9d35b in handle_publish (msg=0x81814c8, sender_uri=0x0, str2=0x0) at publish.c:492
#5  0x08054832 in do_action (a=0x817c640, msg=0x81814c8) at action.c:962
#6  0x0805178f in run_action_list (a=0x817c640, msg=0x81814c8) at action.c:139
#7  0x08053901 in do_action (a=0x817c6a8, msg=0x81814c8) at action.c:712
#8  0x0805178f in run_action_list (a=0x817c6a8, msg=0x81814c8) at action.c:139
#9  0x080538b8 in do_action (a=0x817ce60, msg=0x81814c8) at action.c:706
#10 0x0805178f in run_action_list (a=0x817b5c8, msg=0x81814c8) at action.c:139
#11 0x080519f5 in run_actions (a=0x817b5c8, msg=0x81814c8) at action.c:119
#12 0x08051a95 in run_top_route (a=0x817b5c8, msg=0x81814c8) at action.c:180
#13 0x08086d5b in receive_msg (
    buf=0x8154b60 "PUBLISH sip:2438211 at citsltd.newsip.voip-system.net SIP/2.0\r\nTo: <sip:2438211 at citsltd.newsip.voip-system.net>\r\nFrom: \"Kim Jennings\"<sip:2438211 at citsltd.newsip.voip-system.net>;tag=ef12ef0e8627f1f0\r\nVia"..., len=1129, rcv_info=0xbf9c9b0c) at receive.c:165
#14 0x080b8a2d in udp_rcv_loop () at udp_server.c:449
#15 0x080646b5 in main_loop () at main.c:779
#16 0x08066535 in main (argc=9, argv=0xbf9c9ce4) at main.c:1318

binds[4] seems to be not allocated / borked:

(gdb) print binds[4]
$8 = {length = 0x1e, is_null = 0x0, buffer = 0x7, error = 0x0, buffer_type = MYSQL_TYPE_LONGLONG, buffer_length = 0, row_ptr = 0x1b <Address 0x1b out of bounds>, offset = 0, length_value = 32, 
  param_number = 135780776, pack_length = 232, error_value = 43 '+', is_unsigned = 76 'L', long_data_used = 21 '\025', is_null_value = 8 '\b', store_param_func = 0x6, 
  fetch_result = 0x8154c32 <buf.4358+210>, skip_result = 0x16}

I don't know if there was any real problem with the database - there's nothing suggesting that in the monitoring logs.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2908798&group_id=232389



More information about the Devel mailing list