It wasn't that simple because for some reason the script
worked when it was running under gdb, but finally I've got it.

(Note I added "different kind" if assertion to get this stack dump"

  if(!(isExclusive==0 || isCreate)) {   // same as assert() but trigger sefault 
instead of abort)
          *(int*)(100)=30;
  }
  assert(isExclusive==0 || isCreate); // original problematic assert


--------------------------------------


This is the stack trace



#0  0x00415a46 in winOpen (pVfs=0x4a9d80, zName=0x0, id=0x5d8a88, flags=8217, 
pOutFlags=0x0) at sqlite3.c:34059
34059             *(int*)(100)=30;
(gdb) bt
#0  0x00415a46 in winOpen (pVfs=0x4a9d80, zName=0x0, id=0x5d8a88, flags=8217, 
pOutFlags=0x0) at sqlite3.c:34059
#1  0x00415e4b in winOpen (pVfs=0x4a9d80, zName=0x0, id=0x5d8a88, flags=8222, 
pOutFlags=0x0) at sqlite3.c:34178
#2  0x0040b61d in sqlite3OsOpen (pVfs=0x4a9d80, zPath=0x0, pFile=0x5d8a88, 
flags=8222, pFlagsOut=0x0) at sqlite3.c:14469
#3  0x0041e971 in pagerOpentemp (pPager=0x5d8978, pFile=0x5d8a88, 
vfsFlags=8222) at sqlite3.c:40938
#4  0x0041f8f3 in openSubJournal (pPager=0x5d8978) at sqlite3.c:41614
#5  0x0041fa27 in subjournalPage (pPg=0x61bb98) at sqlite3.c:41646
#6  0x00421ec5 in pager_write (pPg=0x61bb98) at sqlite3.c:42941
#7  0x00422338 in sqlite3PagerWrite (pDbPage=0x61bb98) at sqlite3.c:43053
#8  0x00435082 in insertCell (pPage=0x61bfbc, i=0, pCell=0x61c030 
"$\003M\0010123456789abcdef0123456789abcde1\001", sz=37,
    pTemp=0x0, iChild=0, pRC=0x22b2d8) at sqlite3.c:53765
#9  0x004384e4 in sqlite3BtreeInsert (pCur=0x609868, pKey=0x5e7b68, nKey=36, 
pData=0x4ad54b, nData=0, nZero=0, appendBias=0,
    seekResult=0) at sqlite3.c:55033
#10 0x004545e6 in sqlite3VdbeExec (p=0x60b138) at sqlite3.c:68094
#11 0x00446d95 in sqlite3Step (p=0x60b138) at sqlite3.c:61957
#12 0x00447053 in sqlite3_step (pStmt=0x60b138) at sqlite3.c:62030
#13 0x0040350b in shell_exec (db=0x5d82b8,
    zSql=0x60b0d8 "INSERT OR REPLACE INTO sessions 
values('0123456789abcdef0123456789abcde1');",
    xCallback=0x401d40 <shell_callback>, pArg=0x22b7ec, pzErrMsg=0x22b788) at 
shell.c:1107
#14 0x00407596 in process_input (p=0x22b7ec, in=0x61166330) at shell.c:2468
#15 0x0040867e in main (argc=2, argv=0x61245da4) at shell.c:2926

 
Artyom Beilis
--------------
CppCMS - C++ Web Framework:   http://cppcms.sf.net/
CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/


>________________________________
>From: Richard Hipp <d...@sqlite.org>
>To: Artyom Beilis <artyom...@yahoo.com>; General Discussion of SQLite Database 
><sqlite-users@sqlite.org>
>Sent: Thursday, September 22, 2011 3:23 PM
>Subject: Re: [sqlite] Assertion in Sqlite 3.7.x on Cygwin using WAL
>
>
>
>
>
>2011/9/21 Artyom Beilis <artyom...@yahoo.com>
>
>
>>While building with -DSQLITE_DEBUG
>>it reports an assertion:
>>
>>assertion "isExclusive==0 || isCreate" failed: file "sqlite3.c", line 34058, 
>>function: winOpen
>>(Version 3.7.8)
>>
>
>
>Can you send us a stack trace at the point of the assert()?
> 
>
>>This does not happen on Windows builds of the same sources.
>>
>>
>>I've attached the script and VDBE traces under cygwin and windows builds.
>>
>>Cygwin version: 1.7.9(0.237/5/3)
>>
>>
>>
>>Artyom Beilis
>>--------------
>>CppCMS - C++ Web Framework:   http://cppcms.sf.net/
>>CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/
>>_______________________________________________
>>sqlite-users mailing list
>>sqlite-users@sqlite.org
>>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>
>
>-- 
>D. Richard Hipp
>d...@sqlite.org
>
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to