[OpenSIPS-Devel] [ opensips-Bugs-3563203 ] do_routing function crash without group id parameter

SourceForge.net noreply at sourceforge.net
Fri Oct 12 15:48:55 CEST 2012


Bugs item #3563203, was opened at 2012-08-30 01:34
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3563203&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.7.x
Status: Open
Resolution: Works For Me
Priority: 3
Private: No
Submitted By: piero ferraresso (red02)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: do_routing function crash without group id parameter

Initial Comment:
I\'m using opensips v. 1.7.2-TLS on a Debian 6.04 machine. 
If I call the function do_routing without specifing the group id parameter - do_routing(\"\",\"1\") for example - opensips crah (segfault at 0 ip 081399d8 sp bfed0480 error 4 in opensips[8048000+150000]).
If I insert the group id - do_routing(\"0\",\"1\") for example - all works fine.
Where do I wrong? 
 
Thanks in advance 

     Piero Ferraresso 

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

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-10-12 06:48

Message:
Hi Piero,

in GDB, in frame 0, could you do:

p _h
p *_h
p _h->table->s

Thanks and regards,
Bogdan

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

Comment By: piero ferraresso (red02)
Date: 2012-10-11 06:37

Message:
I've got the some problem also with the latest stable release (1.8.1.-TLS).

Piero 

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-09-18 03:51

Message:
Post the opensips logs (with debug 6) corresponding to the INVITE
processing.

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-09-18 03:50

Message:
Still working (even if db_virtual):

Sep 18 14:49:33 [12557] DBG:core:parse_to_param: tag=fuzyi
Sep 18 14:49:33 [12557] DBG:core:parse_to: end of header reached, state=29
Sep 18 14:49:33 [12557] DBG:core:parse_to: display={"bogdan"},
ruri={sip:bogdan at opensips.org}
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_query: f call 
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_query: f call handle size
= 2
Sep 18 14:49:33 [12557] DBG:db_virtual:try_reconnect: try reconnect
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_query: flags1 = 3
Sep 18 14:49:33 [12557] DBG:core:db_new_result: allocate 48 bytes for
result set at 0x7cf908
Sep 18 14:49:33 [12557] DBG:db_mysql:db_mysql_get_columns: 1 columns
returned from the query
Sep 18 14:49:33 [12557] DBG:core:db_allocate_columns: allocate 28 bytes for
result columns at 0x7cfb88
Sep 18 14:49:33 [12557] DBG:db_mysql:db_mysql_get_columns:
RES_NAMES(0x7cfb90)[0]=[groupid]
Sep 18 14:49:33 [12557] DBG:db_mysql:db_mysql_get_columns: use DB_INT
result type
Sep 18 14:49:33 [12557] DBG:db_mysql:db_mysql_convert_rows: no rows
returned from the query
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_query: curent_con = 0
Sep 18 14:49:33 [12557] ERROR:drouting:get_group_id: no group for user
"bogdan"@"opensips.org"
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_free_result: f call 
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_free_result: f call
handle size = 2
Sep 18 14:49:33 [12557] DBG:db_virtual:try_reconnect: try reconnect
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_free_result: flags1 = 3
Sep 18 14:49:33 [12557] DBG:core:db_free_columns: freeing result columns at
0x7cfb88
Sep 18 14:49:33 [12557] DBG:core:db_free_rows: freeing 0 rows
Sep 18 14:49:33 [12557] DBG:core:db_free_result: freeing result set at
0x7cf908
Sep 18 14:49:33 [12557] DBG:db_virtual:db_virtual_free_result: curent_con =
0
Sep 18 14:49:33 [12557] ERROR:drouting:do_routing: failed to get group id
Sep 18 14:49:33 [12557] DBG:core:buf_init: initializing...
----DR failed !!
Sep 18 14:49:33 [12557] DBG:core:destroy_avp_list: destroying list (nil)


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

Comment By: piero ferraresso (red02)
Date: 2012-09-18 02:34

Message:
This is my actual configuration:

#db_default_url="virtual://set1"  # parallel
db_default_url="virtual://set2"   # failover
#db_default_url="virtual://set3"  # round

#Setting module-specific parameters 

# DB_virtual
modparam("db_virtual", "db_probe_time", 10)#default 10 sec
modparam("db_virtual", "db_max_consec_retrys", 3)#default 10 consecutive
times

modparam("db_virtual", "db_urls", "define set1 PARALLEL")
modparam("db_virtual", "db_urls",
"mysql://opensips:xxx@sqlnode1/opensips17")
modparam("db_virtual", "db_urls",
"mysql://opensips:xxx@sqlnode2/opensips17")

modparam("db_virtual", "db_urls", "define set2 FAILOVER")
modparam("db_virtual", "db_urls",
"mysql://opensips:xxx@localhost/opensips17")
modparam("db_virtual", "db_urls",
"mysql://opensips:xxx@sqlnode1/opensips17")
modparam("db_virtual", "db_urls",
"mysql://opensips:xxx@sqlnode2/opensips17")

modparam("db_virtual", "db_urls", "define set3 ROUND")
modparam("db_virtual", "db_urls",
"mysql://opensips:xx@sqlnode1/opensips17")
modparam("db_virtual", "db_urls",
"mysql://opensips:xx@sqlnode2/opensips17")


# Dynamic Routing + Load Balancer

modparam("drouting", "use_domain", 0)
modparam("drouting", "probing_interval", 60)
modparam("drouting", "probing_from", "sip:pinger at si.unimib.it")
modparam("drouting", "probing_method", "OPTIONS")
modparam("drouting", "probing_reply_codes", "501, 403, 404")

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-09-18 00:13

Message:
Please post the db virtual configuration you are using for the DR module.
And one again, if you get a core file, extract please the backtrace from
it.

Regards,
Bogdan

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

Comment By: piero ferraresso (red02)
Date: 2012-09-17 05:14

Message:
Yes, It seems to depend on using the virtual db module. 

Piero

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-09-17 01:39

Message:
I tried to reproduce this, using 1.7 :

	if (!do_routing("","1")) {
		xlog("----DR failed !!\n");
		exit;
	}

But with no success - I get error messages with no crash:

Sep 17 12:34:54 [6354] DBG:core:parse_to_param: tag=fuzyi
Sep 17 12:34:54 [6354] DBG:core:parse_to: end of header reached, state=29
Sep 17 12:34:54 [6354] DBG:core:parse_to: display={"bogdan"},
ruri={sip:bogdan at opensips.org}
Sep 17 12:34:54 [6354] DBG:core:db_new_result: allocate 48 bytes for result
set at 0x7cc598
Sep 17 12:34:54 [6354] DBG:db_mysql:db_mysql_get_columns: 1 columns
returned from the query
Sep 17 12:34:54 [6354] DBG:core:db_allocate_columns: allocate 28 bytes for
result columns at 0x7cc5e0
Sep 17 12:34:54 [6354] DBG:db_mysql:db_mysql_get_columns:
RES_NAMES(0x7cc5e8)[0]=[groupid]
Sep 17 12:34:54 [6354] DBG:db_mysql:db_mysql_get_columns: use DB_INT result
type
Sep 17 12:34:54 [6354] DBG:db_mysql:db_mysql_convert_rows: no rows returned
from the query
Sep 17 12:34:54 [6354] ERROR:drouting:get_group_id: no group for user
"bogdan"@"opensips.org"
Sep 17 12:34:54 [6354] DBG:core:db_free_columns: freeing result columns at
0x7cc5e0
Sep 17 12:34:54 [6354] DBG:core:db_free_rows: freeing 0 rows
Sep 17 12:34:54 [6354] DBG:core:db_free_result: freeing result set at
0x7cc598
Sep 17 12:34:54 [6354] ERROR:drouting:do_routing: failed to get group id
Sep 17 12:34:54 [6354] DBG:core:buf_init: initializing...
----DR failed !!


Maybe it is something particular to your case, so please provide an
backtrace.

Regards,
Bogdan

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-09-11 02:51

Message:
Hi Piero,

Could you try without the db_virtual module (direct query to mysql) to see
if you still have this issue ?

Thanks and regards,
Bogdan

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

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



More information about the Devel mailing list