Hi all, I'm noticing a new failure with SQLite 3.7.3 as compared to the previous version I was using, 3.6.23.1.
Error message: -------------- Assertion failed: (memIsValid(&u.bq.r.aMem[i])), function sqlite3VdbeExec, file .../sqlite3.c, line 64507. Information from the time of error: ----------------------------------- (gdb) print i 0 (gdb) print *u.bq.r.aMem { u = { i = 1, nZero = 1, pDef = 0x1, pRowSet = 0x1, pFrame = 0x1 }, r = 0, db = 0x83a218, z = 0x0, n = 0, flags = 4228, type = 0 '\0', enc = 0 '\0', pScopyFrom = 0x0, pFiller = 0x0, xDel = 0, zMalloc = 0x0 } (gdb) print pc 31 (gdb) print u.bq { pC = 0x2714e8, res = 2561376, r = { pKeyInfo = 0x1fbb58, nField = 2, flags = 12, rowid = 343597383684, aMem = 0xa052d8 } } Repeatability: -------------- Every time. u.bq.r.aMem->flags is always 4228 (==0x1084), u.bq.r.aMem->u.i is always 1, u.bq.r.aMem->db varies as expected and all other fields of u.bq.r.aMem are zeroes. Background: ----------- I am using SQLite in an iPhone application I'm developing. I am using the amalgamation from sqlite.org so that I know what I have; I am not using the version of SQLite supplied by Apple in their SDK. The previous version I had was 3.6.23.1; I updated to 3.7.3 because I wanted the very useful sqlite3_register_function_v2() API which is new in that release. The same assertion fires when I run my app in the iPhone simulator or execute the same query on the same database from the sqlite3 shell program. I am compiling sqlite3.c with GCC 4.2. Obviously when I execute the same query on a version of sqlite built without the -DSQLITE_DEBUG it cannot fail the assertion since the assertion is not built. I can confirm however that it executes without any detected memory access violation and the result set is what I would expect. It is important for me to understand if this is an assertion mis-fire in the debug case (and not a real problem) or a lucky escape in the release case (and therefore a real problem, unless I can guarantee my customers are all similarly lucky). The failing query is explained as follows: addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- ------------- 0 Trace 0 0 0 00 1 OpenEphemeral 9 3 0 keyinfo(1,-BINARY) 00 2 Integer 1 1 0 00 3 Variable 1 2 0 :row 00 4 MustBeInt 2 0 0 00 5 IfPos 2 7 0 00 6 Integer 0 2 0 00 7 Add 1 2 3 00 8 IfPos 1 10 0 00 9 Integer -1 3 0 00 10 Goto 0 118 0 00 11 OpenRead 0 31 0 0 00 12 OpenRead 1 21 0 3 00 13 OpenRead 2 27 0 3 00 14 OpenRead 10 30 0 keyinfo(2,BINARY,BINARY) 00 15 OpenRead 3 13 0 4 00 16 OpenRead 4 8 0 2 00 17 OpenRead 5 24 0 2 00 18 OpenRead 6 2 0 3 00 19 OpenRead 7 25 0 2 00 20 OpenRead 8 2 0 3 00 21 Rewind 0 95 0 00 22 Rowid 0 4 0 00 23 MustBeInt 4 94 0 00 24 NotExists 1 94 4 00 25 SCopy 4 5 0 00 26 IsNull 5 94 0 00 27 Column 1 2 6 00 28 IsNull 6 94 0 00 29 Affinity 6 1 0 d 00 30 SeekGe 10 94 5 2 00 31 IdxGE 10 94 5 2 01 32 IdxRowid 10 7 0 00 33 Seek 2 7 0 00 34 Column 2 2 8 00 35 MustBeInt 8 93 0 00 36 NotExists 3 93 8 00 37 Column 3 3 9 00 38 MustBeInt 9 93 0 00 39 NotExists 4 93 9 00 40 Integer 0 10 0 00 41 MustBeInt 4 90 0 00 42 NotExists 5 90 4 00 43 Integer 1 10 0 00 44 Integer 0 12 0 00 45 Column 5 1 11 00 46 MustBeInt 11 87 0 00 47 NotExists 6 87 11 00 48 Integer 1 12 0 00 49 Integer 0 13 0 00 50 Rowid 1 11 0 00 51 MustBeInt 11 84 0 00 52 NotExists 7 84 11 00 53 Integer 1 13 0 00 54 Integer 0 14 0 00 55 Column 7 1 11 00 56 MustBeInt 11 81 0 00 57 NotExists 8 81 11 00 58 Integer 1 14 0 00 59 Column 4 1 15 00 60 Column 6 1 9 00 61 String8 0 8 0 00 62 Concat 8 9 11 00 63 Column 6 2 8 00 64 Concat 8 11 16 00 65 Column 8 1 7 00 66 String8 0 18 0 00 67 Concat 18 7 11 00 68 Column 8 2 18 00 69 Concat 18 11 17 00 70 MakeRecord 15 3 11 00 71 Column 1 1 19 00 72 Sequence 9 20 0 00 73 Move 11 21 1 00 74 MakeRecord 19 3 22 00 75 IdxInsert 9 22 0 00 76 IfZero 3 79 0 00 77 AddImm 3 -1 0 00 78 Goto 0 81 0 00 79 Last 9 0 0 00 80 Delete 9 0 0 00 81 IfPos 14 84 0 00 82 NullRow 8 0 0 00 83 Goto 0 58 0 00 84 IfPos 13 87 0 00 85 NullRow 7 0 0 00 86 Goto 0 53 0 00 87 IfPos 12 90 0 00 88 NullRow 6 0 0 00 89 Goto 0 48 0 00 90 IfPos 10 93 0 00 91 NullRow 5 0 0 00 92 Goto 0 43 0 00 93 Next 10 31 0 00 94 Next 0 22 0 01 95 Close 0 0 0 00 96 Close 1 0 0 00 97 Close 2 0 0 00 98 Close 10 0 0 00 99 Close 3 0 0 00 100 Close 4 0 0 00 101 Close 5 0 0 00 102 Close 6 0 0 00 103 Close 7 0 0 00 104 Close 8 0 0 00 105 OpenPseudo 11 11 3 00 106 Sort 9 116 0 00 107 AddImm 2 -1 0 00 108 IfNeg 2 110 0 00 109 Goto 0 115 0 00 110 Column 9 2 11 00 111 Column 11 0 15 20 112 Column 11 1 16 00 113 Column 11 2 17 00 114 ResultRow 15 3 0 00 115 Next 9 107 0 00 116 Close 11 0 0 00 117 Halt 0 0 0 00 118 Transaction 0 0 0 00 119 VerifyCookie 0 41 0 00 120 TableLock 0 31 0 SignedCards 00 121 TableLock 0 21 0 Cards 00 122 TableLock 0 27 0 CardsPlayers 00 123 TableLock 0 13 0 TeeSets 00 124 TableLock 0 8 0 Courses 00 125 TableLock 0 24 0 CardsPlayerA 00 126 TableLock 0 2 0 Players 00 127 TableLock 0 25 0 CardsPlayerB 00 128 Goto 0 11 0 00 Any advice/recommendations will be greatly appreciated. Best Regards, Phil Willoughby -- Managing Director, StrawberryCat Limited StrawberryCat Limited is registered in England and Wales with Company No. 7234809. The registered office address of StrawberryCat Limited is: 107 Morgan Le Fay Drive Eastleigh SO53 4JH _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users