Hello,

Ok, that wasn't of really much help :)
Please try the attached patch and let me know if OpenSIPS still crashes.

Regards,

Vlad Paiu
OpenSIPS Developer


On 09/14/2011 03:53 PM, Dani Popa wrote:
Hi,

(gdb) frame 0
#0 0xb6c2c3ee in get_rules_doc (user=0xbfb603ac, domain=0xbfb603bc, type=2, rules_doc=0xb6c6a2a4) at xcap_auth.c:527
527             body.len = strlen(body.s);
(gdb) p row_vals[0]
value has been optimized out
(gdb)

On 09/14/11 15:43, Vlad Paiu wrote:
Hello,

In frame 0, could you please do
    p row_vals[0]

and paste here the output ?

Regards,

Vlad Paiu
OpenSIPS Developer


On 09/14/2011 02:53 PM, Dani Popa wrote:
Hi,

My opensips used for presence stoped with Segmentation fault.

root@test:/home# gdb opensips_1_6/opensips core
GNU gdb (GDB) 7.3-debian
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/opensips_1_6/opensips...done.
[New LWP 14277]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by `/usr/local/sbin/opensips -P /var/run/opensips_presence/opensips_presence.pid -m'.
Program terminated with signal 11, Segmentation fault.
#0 0xb6c2c3ee in get_rules_doc (user=0xbfb603ac, domain=0xbfb603bc, type=2, rules_doc=0xb6c6a2a4) at xcap_auth.c:527
527             body.len = strlen(body.s);
(gdb) bt
#0 0xb6c2c3ee in get_rules_doc (user=0xbfb603ac, domain=0xbfb603bc, type=2, rules_doc=0xb6c6a2a4) at xcap_auth.c:527
#1  0x081f6bfc in mem_pool ()
Backtrace stopped: Not enough registers or memory available to unwind further

The core file has 256M, if you need it, i'll post it on web, but please let me know.

Thanks,
Dani

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Index: modules/presence_xml/xcap_auth.c
===================================================================
--- modules/presence_xml/xcap_auth.c	(revision 8328)
+++ modules/presence_xml/xcap_auth.c	(working copy)
@@ -518,13 +518,32 @@
 	row = &result->rows[xcap_doc_col];
 	row_vals = ROW_VALUES(row);
 
-	body.s = (char*)row_vals[0].val.string_val;
+	switch (row_vals[0].type) {
+		case DB_STRING:
+			LM_DBG("extracted db_string\n");
+			body.s = (char*)row_vals[0].val.string_val;
+			if (body.s)
+				body.len = strlen(body.s);
+			break;
+		case DB_STR:
+			LM_DBG("extracted db_str\n");
+			body = row_vals[0].val.str_val;
+			break;
+		case DB_BLOB:
+			LM_DBG("extracted db_blob\n");
+			body = row_vals[0].val.blob_val;
+			break;
+		default:
+			LM_ERR("unexpected column type %d\n",row_vals[0].type);
+			goto error;
+	}
+
 	if(body.s== NULL)
 	{
 		LM_ERR("Xcap doc NULL\n");
 		goto error;
 	}	
-	body.len = strlen(body.s);
+
 	if(body.len== 0)
 	{
 		LM_ERR("Xcap doc empty\n");
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to