Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-14 Thread Pavel Ivanov
> Not sure if it's still important, but this is how it looks for me: Thank you, Nikolaus. Your disassembly proves that our guess was correct. Pavel On Fri, May 14, 2010 at 9:45 AM, Nikolaus Rath wrote: > Pavel Ivanov writes: Yeah, I'm around. I don't know what an "exact disassembly" is o

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-14 Thread Nikolaus Rath
Pavel Ivanov writes: >>> Yeah, I'm around. I don't know what an "exact disassembly" is or how to >>> provide one, but if someone tells me what to do then I'm most likely >>> willing to do it. > > Nikolaus, you can do it like this: >> gdb your_application > (gdb) disassemble pthreadMutexEnter > > I

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/13/2010 12:22 PM, Nikolaus Rath wrote: > Where can I find the corresponding ticket? The sqlite homepage seems to > have lost all references to the bug tracker... I know that bug reporting is > no longer open to the public, but I hope there is sti

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/13/2010 12:56 PM, Pavel Ivanov wrote: > Roger, '-g' flag doesn't necessarily mean SQLITE_DEBUG turned on and > doesn't mean all debugging stuff turned on. This flag (if we're > talking about gcc) We aren't talking about gcc, but rather Python's

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Pavel Ivanov
>> Correct. Also, it only happens when apsw is compiled with -g. > > The amalgamation is being used when you compiled APSW.  When you compile > APSW with debug and the amalgamation, two things happen.  Firstly assertions > are turned on in both APSW and SQLite. > ... > Secondly it enables SQLITE_DE

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Nikolaus Rath
Roger Binns writes: > On 05/13/2010 06:43 AM, Nikolaus Rath wrote: >> Yeah, I'm around. I don't know what an "exact disassembly" is or how to >> provide one, but if someone tells me what to do then I'm most likely >> willing to do it. > > We can test the hypothesis very easily. Find line 15472 in

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/13/2010 06:43 AM, Nikolaus Rath wrote: > Yeah, I'm around. I don't know what an "exact disassembly" is or how to > provide one, but if someone tells me what to do then I'm most likely > willing to do it. We can test the hypothesis very easily.

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-13 Thread Nikolaus Rath
Roger Binns writes: >> Although I see that it can return false in this case if another thread >> is inside pthreadMutexEnter and optimizer has switched order of >> assignment of the values to owner and nRef inside pthreadMutexEnter >> (it is allowed to do so because variables are not volatile). Is

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/12/2010 03:23 PM, Pavel Ivanov wrote: > pthreadMutexNotheld() checks that mutex is not held by current thread > - if mutex is held by another thread it will return true. Ooops, I got this completely wrong! > Although I see that it can return fa

Re: [sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-12 Thread Pavel Ivanov
> 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. pthreadMutexNotheld() checks that mutex is not held by current thread - if mutex is hel

[sqlite] Incorrect assertion in mutexes plus pcache1Alloc

2010-05-12 Thread Roger Binns
-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(