-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From a user backtrace when SQLite is compiled with assertions on, it looks
like an assertion is incorrect.  The raw backtrace is later.

pcache1Alloc() contains this code:

    pcache1LeaveMutex();
    p = sqlite3Malloc(nByte);
    pcache1EnterMutex();

pcache1EnterMutex() is a macro for sqlite3_mutex_enter(pcache1.mutex) which
in turn calls pthreadMutexEnter which starts with this assertion:

assert( p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p) );

The mutex is not recursive.  However if another thread had acquired the
mutex during the call to sqlite3Malloc above then the mutex would indeed be
held by that other thread causing the assertion to fail.

Raw backtrace:

> #0  0x00f2c422 in __kernel_vsyscall ()
> #1  0x001a5651 in raise () from /lib/tls/i686/cmov/libc.so.6
> #2  0x001a8a82 in abort () from /lib/tls/i686/cmov/libc.so.6
> #3  0x0019e718 in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
> #4  0x002f312b in pthreadMutexEnter (p=0x3af1a0)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:15631
> #5  0x002dc302 in sqlite3_mutex_enter (p=0x0)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:14936
> #6  0x002e201e in pcache1Alloc (nByte=1160)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:31158
> #7  0x003060ed in pcache1AllocPage (p=0x9095908, iKey=1, createFlag=2)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:31191
> #8  pcache1Fetch (p=0x9095908, iKey=1, createFlag=2)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:31560
> #9  0x002eb682 in sqlite3PcacheFetch (pCache=0x919c998, pgno=<value optimized 
> out>, createFlag=1, 
>     ppPage=0xb7646f8c) at 
> /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:30639
> #10 0x0030ff4b in sqlite3PagerAcquire (pPager=0x919c8f0, pgno=1, 
> ppPage=0xb7646f8c, noContent=0)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:36014
> #11 0x00310382 in btreeGetPage (pBt=0x919c478, pgno=<value optimized out>, 
> ppPage=0xb7647018, 
>     noContent=0) at 
> /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:40095
> #12 0x00313fc0 in lockBtree (p=0x919c438, wrflag=<value optimized out>)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:40805
> #13 sqlite3BtreeBeginTrans (p=0x919c438, wrflag=<value optimized out>)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:41055
> #14 0x00354bbf in sqlite3VdbeExec (p=<value optimized out>)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:56074
> #15 0x0035fbc8 in sqlite3Step (pStmt=0x963fde8)
>     at /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:51732
> #16 sqlite3_step (pStmt=0x963fde8) at 
> /home/nikratio/tmp/python-apsw-3.6.23.1-r1/sqlite3/sqlite3.c:51792
> #17 0x0037028e in APSWCursor_step (self=0x913d950) at src/cursor.c:730
> #18 0x00371554 in APSWCursor_execute (self=0x913d950, args=
>     ('SELECT inode FROM contents WHERE name=? AND parent_inode=?', [<buffer 
> at remote 0x968a0c0>, 1314661905L])) at src/cursor.c:999

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvrJsoACgkQmOOfHg372QSk6QCfcNWmxnYtdYZY0zovx0xvzvA5
yM4AnitMX/elyC+i3zBQ9xhD6hLNYs7w
=pbPi
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to