amd64/167682: sqlite3 3.7.11 on FreeBSD 9.0-RELEASE amd64 (ports) segfaults with memstats compiled in _pthread_mutex_init_calloc_cb

Jerry Lundström jerry.lundstrom at iis.se
Mon May 7 14:00:27 UTC 2012


>Number:         167682
>Category:       amd64
>Synopsis:       sqlite3 3.7.11 on FreeBSD 9.0-RELEASE amd64 (ports) segfaults with memstats compiled in _pthread_mutex_init_calloc_cb
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-amd64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 07 14:00:25 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Jerry Lundström
>Release:        9.0-RELEASE
>Organization:
.SE
>Environment:
FreeBSD freebsd64-ods06 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Hi,

I've been trying to track a segfault in sqlite3 (3.7.11, ports package) when I use OpenDNSSEC 1.3.7 and SoftHSM 1.3.2.

I don't know if the issue is related to sqlite3 or to something in FreeBSD libc but it can be replicated by installing SoftHSM and OpenDNSSEC and then running "make check" in OpenDNSSEC (see https://wiki.opendnssec.org/display/OpenDNSSEC/Platforms#Platforms-FreeBSD9 for my setup).

NOTE: This only happens on amd64 and not 32bit system and I think it has something to do with tracking the size of the malloc's that sqlite3 memstatus needs.

(gdb) bt
#0  0x0000000801b7d400 in _pthread_mutex_init_calloc_cb () from /lib/libc.so.7
#1  0x0000000801b85ad5 in free () from /lib/libc.so.7
#2  0x0000000802f6908e in sqlite3HashClear () from /usr/local/lib/libsqlite3.so.8
#3  0x0000000802f74ccd in sqlite3SchemaClear () from /usr/local/lib/libsqlite3.so.8
#4  0x0000000802f76c35 in sqlite3ResetInternalSchema () from /usr/local/lib/libsqlite3.so.8
#5  0x0000000802f9d532 in sqlite3_close () from /usr/local/lib/libsqlite3.so.8
#6  0x0000000802813a4a in ~SoftSession (this=0x802527100) at ../../../src/lib/SoftSession.cpp:109
#7  0x0000000802812f2d in SoftHSMInternal::closeSession (this=0x8024bf600, hSession=Variable "hSession" is not available.
) at ../../../src/lib/SoftHSMInternal.cpp:180
#8  0x0000000000404168 in hsm_session_close ()
#9  0x000000000040427f in hsm_ctx_close ()
#10 0x0000000000406535 in hsm_close ()
#11 0x0000000000402c22 in main ()

Turning off MEMSTATUS for the sqlite3 ports package removes the problem.

I've reported this to the sqlite-users mailing list also.

Cheers,
Jerry
>How-To-Repeat:
It can be replicated by installing SoftHSM and OpenDNSSEC and then running "make check" in OpenDNSSEC (see https://wiki.opendnssec.org/display/OpenDNSSEC/Platforms#Platforms-FreeBSD9 for my setup).
>Fix:
Deselecting MEMSTATUS in the config for sqlite3 ports package and reinstalling.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-amd64 mailing list