[OpenSIPS-Devel] [opensips] Usrloc fails to fetch contacts (#566)

Ionut Ionita notifications at github.com
Fri Jul 3 10:04:14 CEST 2015


I am using nathelper with usrloc in DB_ONLY mode in opensips 2.1 . I am having 2 domains (tables): location and location2. Location2 contains one contact entry and location none. I have set nathelper to do a SIP ping, but when get_all_ucontacts function from usrloc i get segmentation fault since it frees a null result.
```
#0  0xb7785424 in __kernel_vsyscall ()
#1  0xb75c2607 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xb75c5a33 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x0811e041 in qm_free (qm=qm at entry=0xb7392008, p=p at entry=0xb73cb480, file=file at entry=0x81e074b "db/db_res.c", func=func at entry=0x81e077c <__FUNCTION__.7909> "db_free_result", line=line at entry=116) at mem/q_malloc.c:450
#4  0x08175bee in db_free_result (_r=_r at entry=0xb73cb480) at db/db_res.c:116
#5  0xb72b29e9 in db_mysql_free_result (_h=0xb73c67e4, _r=0xb73cb480) at dbase.c:921
#6  0xb6ea48c5 in get_all_db_ucontacts (part_max=<optimized out>, part_idx=<optimized out>, flags=<optimized out>, len=-4, buf=0x0) at dlist.c:323
#7  get_all_ucontacts (buf=0x0, len=0, flags=0, part_idx=0, part_max=1) at dlist.c:504
#8  0xb6e852d4 in nh_timer (ticks=1, timer_idx=0x0) at nathelper.c:1272
#9  0x080f2817 in handle_timer_job () at timer.c:565
#10 0x0819f915 in handle_io (idx=<optimized out>, event_type=<optimized out>, fm=<optimized out>) at net/net_udp.c:264
#11 io_wait_loop_epoll (h=<optimized out>, t=<optimized out>, repeat=<optimized out>) at net/../io_wait_loop.h:190
#12 udp_rcv_loop (si=si at entry=0xb73c6cb8) at net/net_udp.c:307
#13 0x081a1e3d in udp_start_processes (chd_rank=chd_rank at entry=0x82299a4 <chd_rank>, startup_done=startup_done at entry=0x0) at net/net_udp.c:447
#14 0x0805da18 in main_loop () at main.c:722
#15 main (argc=5, argv=0xbfca4574) at main.c:1253
```
```
#6  0xb6ea48c5 in get_all_db_ucontacts (part_max=<optimized out>, part_idx=<optimized out>, flags=<optimized out>, len=-4, buf=0x0) at dlist.c:323
323                     ul_dbf.free_result(ul_dbh, res);
```

More than this, if this bug is fixed, mysql returs the following error
```
Jul  3 10:45:09 [5949] INFO:db_mysql:switch_state_to_disconnected: disconnect event for 0xb738a360
Jul  3 10:45:09 [5949] INFO:db_mysql:reset_all_statements: reseting all statements on connection: (0xb73857e4) 0xb738a360
Jul  3 10:45:09 [5949] INFO:db_mysql:connect_with_retry: re-connected successful for 0xb738a360
```


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/566
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150703/d7495fcf/attachment-0001.htm>


More information about the Devel mailing list