[my previous message to list didn't get approved?  trying again...]

Hi,

Since sqlite 3.7.10, a Debian software package (bogofilter-sqlite) began
to see (always reproducible) failures during its test suite, but only on
64-bit platforms:

https://buildd.debian.org/status/logs.php?pkg=bogofilter&ver=1.2.2%2Bdfsg1-1%2Bb1

I've found that new code in mem1.c enabled by HAVE_MALLOC_USABLE_SIZE
was causing this regression, and disabling the malloc_usable_size test
in configure.ac produces a sqlite library that doesn't exhibit this problem.

Below is a gdb backtrace of the problem occurring.  This comes from a
core dump generated during bogofilter-sqlite's test suite;  I wasn't
able to reproduce it when running bogofilter directly under gdb:

> Core was generated by `../bogofilter -C -D -n -B ./maildir.20120409/good'.
> Program terminated with signal 6, Aborted.
> #0  0x00007f15b0db01b5 in *__GI_raise (sig=<value optimized out>) at 
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
>       in ../nptl/sysdeps/unix/sysv/linux/raise.c
> (gdb) bt
> #0  0x00007f15b0db01b5 in *__GI_raise (sig=<value optimized out>) at 
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1  0x00007f15b0db2fc0 in *__GI_abort () at abort.c:92
> #2  0x00007f15b0defc00 in malloc_printerr (action=2, str=0x7f15b0ea4555 
> "free(): invalid pointer", ptr=0x6854) at malloc.c:6272
> #3  0x00007f15b19c580e in sqlite3_free (p=0x1697cb0) at sqlite3.c:19059
> #4  0x00007f15b1a1cd5d in sqlite3NestedParse (pParse=0x16995c0, 
> zFormat=<value optimized out>) at sqlite3.c:81448
> #5  0x00007f15b1a2ee50 in sqlite3CreateIndex (pParse=0x16995c0, pName1=<value 
> optimized out>, pName2=<value optimized out>, pTblName=<value optimized out>, 
> pList=0x1697ba0, 
>     onError=99, pStart=0x0, pEnd=0x0, sortOrder=0, ifNotExist=0) at 
> sqlite3.c:84080
> #6  0x00007f15b1a2f197 in sqlite3AddPrimaryKey (pParse=0x16995c0, pList=0x0, 
> onError=<value optimized out>, autoInc=0, sortOrder=<value optimized out>) at 
> sqlite3.c:82382
> #7  0x00007f15b1a1a23f in yy_reduce (yyp=0x1699860, yymajor=<value optimized 
> out>, yyminor=..., pParse=<value optimized out>) at sqlite3.c:110062
> #8  sqlite3Parser (yyp=0x1699860, yymajor=<value optimized out>, yyminor=..., 
> pParse=<value optimized out>) at sqlite3.c:45631
> #9  0x00007f15b1a1c491 in sqlite3RunParser (pParse=0x16995c0, 
>     zSql=0x42c9c8 "CREATE TABLE bogofilter (   key   BLOB PRIMARY KEY,   
> value BLOB);CREATE INDEX bfidx ON bogofilter(key,value);", pzErrMsg=<value 
> optimized out>)
>     at sqlite3.c:111992
> #10 0x00007f15b1a1ea1a in sqlite3Prepare (db=0x1685f50, zSql=<value optimized 
> out>, nBytes=-1, saveSqlFlag=<value optimized out>, pReprepare=0x0, 
> ppStmt=<value optimized out>, 
>     pzTail=0x7fff650edd28) at sqlite3.c:94249
> #11 0x00007f15b1a1eb49 in sqlite3LockAndPrepare (db=0x1685f50, zSql=<value 
> optimized out>, nBytes=-1, saveSqlFlag=0, pOld=0x0, ppStmt=0x7fff650edd20, 
> pzTail=0x7fff650edd28)
>     at sqlite3.c:94341
> #12 0x00007f15b1a1f015 in sqlite3_prepare (db=0x6854, zSql=0x6854 <Address 
> 0x6854 out of bounds>, nBytes=6, ppStmt=0x6854, pzTail=<value optimized out>) 
> at sqlite3.c:94404
> #13 0x00007f15b1a22f5c in sqlite3_exec (db=0x1685f50, 
>     zSql=0x42c9c8 "CREATE TABLE bogofilter (   key   BLOB PRIMARY KEY,   
> value BLOB);CREATE INDEX bfidx ON bogofilter(key,value);", xCallback=0, 
> pArg=<value optimized out>, 
>     pzErrMsg=<value optimized out>) at sqlite3.c:90862
> #14 0x0000000000417c47 in sqlexec (db=0x1685f50, cmd=0x42c9c8 "CREATE TABLE 
> bogofilter (   key   BLOB PRIMARY KEY,   value BLOB);CREATE INDEX bfidx ON 
> bogofilter(key,value);")
>     at ../../src/datastore_sqlite.c:144
> #15 0x0000000000418338 in db_open (dummyenv=0xffffffffffffffff, 
> bfp=0x1685140, mode=DS_WRITE) at ../../src/datastore_sqlite.c:344
> #16 0x00000000004078ba in ds_open (dbe=0xffffffffffffffff, bfp=0x1685140, 
> open_mode=DS_WRITE) at ../../src/datastore.c:157
> #17 0x0000000000416ea0 in open_wordlist (list=0x16850d0, mode=DS_WRITE) at 
> ../../src/wordlists.c:120
> #18 0x0000000000417179 in open_wordlists (mode=DS_WRITE) at 
> ../../src/wordlists.c:228
> #19 0x00000000004050d3 in bogomain (argc=6, argv=0x7fff650ee028) at 
> ../../src/bogomain.c:62
> #20 0x000000000040304b in main (argc=6, argv=0x7fff650ee028) at 
> ../../src/main.c:31
> (gdb) 

Thanks,
Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to