Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#647 Segfault on shutdown in db_mysql

1.10.x
open
modules (454)
5
2013-06-06
2013-04-25
Ryan Bullock
No

I am seeing a segfault on shutdown in the db_mysql module. My guess is that is is related to a flush to db on shutdown somewhere, we are using bulk inserts so that may be related.

Kernel message:
opensips[18804]: segfault at 0 ip 00007fa545fb0089 sp 00007fff45002280 error 6 in db_mysql.so[7fa545fa3000+11000]

Going off the kernel message and an objdump of db_mysql.so, seems to be in the db_mysql_val2bind() function. I am working on getting a full core + back trace.

Discussion

  • Ryan Bullock
    Ryan Bullock
    2013-04-25

    • milestone: --> 1.9.x
     
  • Ryan Bullock
    Ryan Bullock
    2013-05-02

     
    Attachments
  • Ryan Bullock
    Ryan Bullock
    2013-05-02

    Backtrace attached.

     
    • assigned_to: nobody --> vladut-paiu
     
  • Hello Ryan,

    I see this is related to the query buffering part.

    Is this for a normal shutdown, or for a shutdown after a crash ?
    Seems that somehow ( very oddly ) the prepared statement was not properly allocated.. Can you replicate this somehow ? If yes, I'd like to send you a patch that would print some extra debugging.

    Best Regards,
    Vlad

     
  • Ryan Bullock
    Ryan Bullock
    2013-05-08

    Hey vlad this was a shutdown down after a crash, so the crash in a different process may be the cause. Although it would be nice if it didn't cause another segfault (and another core) when that happens.

    If you have a patch to get more debug information I can get that into place for when the next crash happens.

     
  • Ryan Bullock
    Ryan Bullock
    2013-06-06

    Update:

    Seeing this on normal shutdown/restarts as well. Attached are two back traces that occurred when stop opensips normally.

    Opensips info:
    version: opensips 1.9.0-notls (x86_64/linux)
    flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-FUTEX-ADAPTIVE_WAIT
    ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
    poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
    svnrevision: 2:9970M
    @(#) $Id: main.c 9790 2013-02-15 10:14:34Z bogdan_iancu $
    main.c compiled on 15:30:40 Jun 3 2013 with gcc 4.7.2

    I do have some patches applied for improved couchbase support on this build and we used a increased size for SQL_BUF_LEN (we were running into problems with bulk inserts being to large with the default).

     
    Attachments