Re: [sqlite] Assertion in Sqlite 3.7.x on Cygwin using WAL

2011-09-25 Thread Artyom Beilis
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


Re: [sqlite] Assertion in Sqlite 3.7.x on Cygwin using WAL

2011-09-23 Thread Artyom Beilis
I'll get to my Windows PC at Sunday and I'll do it 


Thanks

 
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


[sqlite] Assertion in Sqlite 3.7.x on Cygwin using WAL

2011-09-22 Thread Artyom Beilis
Hello,

This simple script:

pragma journal_mode=wal;
CREATE TABLE IF NOT EXISTS sessions (
  sid varchar(32) primary key not null
);

begin;
INSERT OR REPLACE INTO sessions values('0123456789abcdef0123456789abcde1');
-- There it fails after insert or replace before commit

commit;

Fails on Cygwin and passess without problems using
windows builds.

With normal build the script reports

  unable to open database file


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)

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/VDBE Execution Trace:
   0 Expire   000  00 
   1 Halt 000  00 
VDBE Execution Trace:
   0 Trace000  00 
   1 Noop 000  00 
   2 Goto 0   120  00 
  12 Transaction  000  00 
  13 TableLock010 sqlite_master 00 
  14 Goto 030  00 
   3 OpenRead 010 500 sqlite_master
   4 Rewind   0   100  00 
  10 Close000  00 
  11 Halt 000  00 
VDBE Execution Trace:
   0 JournalMode  015  00 
REG[1] =   t3[wal](8)
   1 ResultRow110  00 
REG[1] =   t3[wal](8)
wal
   2 Halt 000  00 
VDBE Execution Trace:
   0 Trace000  00 
   1 Goto 0   480  00 
  48 Transaction  010  00 
  49 VerifyCookie 000  00 
  50 TableLock011 sqlite_master 00 
  51 Goto 020  00 
   2 ReadCookie   032  00 
REG[3] =  i:0
   3 If   380  00 
REG[3] =  i:0
   4 Integer  130  00 
REG[3] =  i:1
   5 SetCookie023  00 
REG[3] =  i:1
   6 Integer  130  00 
REG[3] =  i:1
   7 SetCookie053  00 
REG[3] =  i:1
   8 CreateTable  020  00 
REG[2] =  i:2
   9 OpenWrite010 500 
  10 NewRowid 010  00 
REG[1] =  i:1
  11 Null 030  00 
REG[3] =  NULL
  12 Insert   031  08 
REG[3] =  NULL
REG[1] =  i:1
  13 Close000  00 
  14 CreateIndex  040  00 
REG[4] =  i:3
  15 OpenWrite110 500 sqlite_master
  16 NewRowid 150  00 
REG[5] =  i:2
  17 String8  060 index 00 
REG[6] =   t5[index](8)
  18 String8  070 sqlite_autoindex_sessions_1 00 
REG[7] =   t27[sqlite_autoinde](8)
  19 String8  080 sessions 00 
REG[8] =   t8[sessions](8)
  20 Copy 490  00 
REG[4] =  i:3
REG[9] =  i:3
REG[9] =  i:3
  21 Null 0   100  00 
REG[10] =  NULL
  22 MakeRecord   65   11 aaada 00 
REG[11] =  z47[0617431D0100696E64657873716C6974..C...indexsqlit](8)
  23 Insert   1   115  18 
REG[11] =  z47[0617431D0100696E64657873716C6974..C...indexsqlit](8)
REG[5] =  i:2
  24 Close100  00 
  25 Close000  00 
  26 Null 0   120  00 
REG[12] =  NULL
  27 OpenWrite210 500 sqlite_master
  28 MustBeInt1   310  00 
REG[1] =  i:1
  29 NotExists2   311  00 pk
REG[1] =  i:1
  30 Rowid2   120  00 
REG[12] =  i:1
  31 NotNull 12   330  00 
REG[12] =  i:1
  33 NotExists2   32   12  00 
REG[12] =  i:1
  34 String8  0   130 table 00 
REG[13] =   t5[table](8)
  35 String8  0   140 sessions 00 
REG[14] =   t8[sessions](8)
  36 String8  0   150 sessions 00 
REG[15] =   t8[sessions](8)
  37 Copy 2   160  00 
REG[2] =  i:2
REG[16] =  i:2
REG[16] =  i:2
  38 String8  0   170 CREATE TABLE sessions (
  sid varchar(32) primary key not null
) 00 
REG[17] =   t64[CREATE TABLE se](8)
  39 NotExists2   40   12  00 
REG[12] =  i:1
  40 MakeRecord  135   18 aaada 00 
REG[18] =  z93[07171D1D01810D7461626C6573657373...tablesess](8)
  41 Insert   2   18   12  00 
REG[18] =  z93[07171D1D01810D7461626C6573657373...tablesess](8)
REG[12] =  i:1
  42 Goto 0   320  00 
  32 Goto 0   430  00 
  43 Close200  00 
  44 Integer  1   190  00 
REG[19] =  i:1
  45 SetCookie01   19  00 
REG[19] =  i:1
  46 ParseSchema  000 tbl_name='sessions' 00 
VDBE Execution 

Re: [sqlite] Assertion in Sqlite 3.7.x on Cygwin using WAL

2011-09-22 Thread Richard Hipp
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