[sr-dev] [tracker] Task opened: htable segfault

sip-router bugtracker at sip-router.org
Tue Oct 28 15:18:21 CET 2014


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Savolainen Dmitri (snen) 

Attached to Project - sip-router
Summary - htable segfault 
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - it take a place while trying to reload htable from DB (at startup or by htable.reload command) if key_name column type is INT.

<code>
(gdb) bt
#0  0x00007f60a412685f in __strlen_sse42 () from /lib64/libc.so.6
#1  0x00007f608b53234e in ht_db_load_table (ht=0x7f608c5c09d8, dbtable=0x7f608c5c09f0, mode=0) at ht_db.c:207
#2  0x00007f608b52b0f6 in ht_db_load_tables () at ht_api.c:880
#3  0x00007f608b542943 in mod_init () at htable.c:193
#4  0x0000000000590de0 in init_mod (m=0x7f60a001fd10) at sr_module.c:966
#5  0x0000000000590b42 in init_mod (m=0x7f60a00210b8) at sr_module.c:963
#6  0x0000000000590b42 in init_mod (m=0x7f60a0021d58) at sr_module.c:963
#7  0x0000000000590b42 in init_mod (m=0x7f60a0022870) at sr_module.c:963
#8  0x0000000000590b42 in init_mod (m=0x7f60a00240c0) at sr_module.c:963
#9  0x0000000000590b42 in init_mod (m=0x7f60a00249c8) at sr_module.c:963
#10 0x0000000000590b42 in init_mod (m=0x7f60a00254a8) at sr_module.c:963
#11 0x0000000000590b42 in init_mod (m=0x7f60a0025d90) at sr_module.c:963
#12 0x0000000000590b42 in init_mod (m=0x7f60a0026a40) at sr_module.c:963
#13 0x0000000000590b42 in init_mod (m=0x7f60a0027070) at sr_module.c:963
#14 0x0000000000590b42 in init_mod (m=0x7f60a00274a8) at sr_module.c:963
#15 0x0000000000590b42 in init_mod (m=0x7f60a0027830) at sr_module.c:963
#16 0x0000000000590b42 in init_mod (m=0x7f60a0027d58) at sr_module.c:963
#17 0x0000000000590b42 in init_mod (m=0x7f60a0028448) at sr_module.c:963
#18 0x0000000000590b42 in init_mod (m=0x7f60a0028948) at sr_module.c:963
#19 0x0000000000590b42 in init_mod (m=0x7f60a0028f28) at sr_module.c:963
#20 0x00000000005910e5 in init_modules () at sr_module.c:995
#21 0x00000000004aa326 in main (argc=11, argv=0x7fffa43a86f8) at main.c:2501
</code>

may be it will be better convert any key type to string or just print warning and prevent crash
<code>
diff --git a/modules/htable/ht_db.c b/modules/htable/ht_db.c
index 28af3a8..0eea317 100644
--- a/modules/htable/ht_db.c
+++ b/modules/htable/ht_db.c
@@ -198,6 +198,11 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
        do {
                for(i=0; i<RES_ROW_N(db_res); i++)
                {
+                        if (  RES_ROWS(db_res)[i].values[0].type!=DB1_STRING){
+                            LM_ERR("key type must be string\n");
+                            goto error;
+                        }
+
                        /* not NULL values enforced in table definition ?!?! */
                        kname.s = (char*)(RES_ROWS(db_res)[i].values[0].val.string_val);
                        if(kname.s==NULL) {

</code>

More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=486

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the sr-dev mailing list