The crash occur with sqlite 3.7.8 on line below: u.bp.pC->nullRow = (u8)u.bp.res;
u.bp.pC did not reference a valid address. here is the stack (gdb) bt #0 0x00055000 in sqlite3VdbeExec (p=0x18e9d8) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:68038 #1 0x000096d2 in sqlite3_step (pStmt=0x18e9d8) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:61954 #2 0x0000c7f2 in sqlite3_exec (db=0xa85408, zSql=0x786688 "SELECT name, rootpage, sql FROM 'main'.sqlite_master ORDER BY rowid", xCallback=0x3cfa5 <sqlite3InitCallback+1>, pArg=0x2fdfdec0, pzErrMsg=0x0) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:88791 #3 0x0003ce7a in sqlite3InitOne (db=0xa85408, iDb=0, pzErrMsg=0xa84410) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:91809 #4 0x0003ca6a in sqlite3Init (db=0xa85408, pzErrMsg=0xa84410) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:91875 #5 0x0000b9f2 in sqlite3ReadSchema [inlined] () at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:91912 #6 0x0000b9f2 in sqlite3LocateTable (pParse=0xa84408, isView=0, zName=0x786788 "base_version", zDbase=0x0) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:79437 #7 0x0003a604 in selectExpander (pWalker=0x2fdfe050, p=0x786708) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:95581 #8 0x00038560 in sqlite3WalkSelect (pWalker=0x2fdfe050, p=0x786708) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:71787 #9 0x00037bcc in sqlite3SelectPrep (pParse=0xa84408, p=0x786708, pOuterNC=<variable not found>) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:95776 #10 0x0002a296 in sqlite3Select (pParse=0xa84408, p=0x786708, pDest=0x2fdfe2c4) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:96116 #11 0x000220e2 in yy_reduce (yypParser=0xab8208, yyruleno=112) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:107894 #12 0x000200ce in sqlite3Parser (yyp=0xab8208, yymajor=1, pParse=<value temporarily unavailable, due to optimizations>) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:108862 #13 0x0000daa4 in sqlite3RunParser (pParse=0xa84408, zSql=0x68f87 "SELECT * FROM base_version", pzErrMsg=0x2fdfe430) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:109699 #14 0x000520b0 in sqlite3Prepare (db=0xa85408, zSql=0x68f87 "SELECT * FROM base_version", nBytes=<value temporarily unavailable, due to optimizations>, saveSqlFlag=1, pReprepare=0x0, ppStmt=0x2fdfe4a8, pzTail=0x0) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:92089 #15 0x0000cfb6 in sqlite3LockAndPrepare (db=0xa85408, zSql=0x68f87 "SELECT * FROM base_version", nBytes=-1, saveSqlFlag=1, pOld=0x0, ppStmt=0x2fdfe4a8, pzTail=0x0) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:92181 #16 0x0000d084 in sqlite3_prepare_v2 (db=<value temporarily unavailable, due to optimizations>, zSql=<value temporarily unavailable, due to optimizations>, nBytes=<value temporarily unavailable, due to optimizations>, ppStmt=<value temporarily unavailable, due to optimizations>, pzTail=0x0) at /Volumes/hfsdata/sqliteTest/sqlite/sqlite3.c:92256 #17 0x0000232c in getDatabaseVersion [inlined] () at /Volumes/hfsdata/sqliteTest/Classes/MainViewController.m:19 ..... #38 0x000021bc in main (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at /Volumes/hfsdata/sqliteTest/main.m:14 (gdb) On 3 Nov 2011, at 8:39am, Price,Ray wrote: > I'm having a VERY odd problem with Sqlite at the moment. I have an application that works fine and has been working find for over a year, but since updating to xcode 4 and the ios 5 SDK Sqlite crashes regularly, but ONLY on older devices still running iOS 3.1.3. > > However, if I compile the sqlite3.c module WITHOUT optimizations, the crash goes away, but this is obviously FAR from ideal. > > Has anyone else experienced this? First, well done for identifying your workaround. I use Xcode and iOS and I've had situations where compiling without optimization cures crashes. But they haven't involved SQLite code. I don't know how much optimization improves sqlite's speed. Might help a lot, might not. One problem with sqlite is that it has to compile on a lot of platforms with a lot of compilers and it's impossible to get rid of all warnings under those conditions. If possible play with each of the optimization levels and find out which level is causing the problems. If you can figure out what part of the C code is causing the problem, or post an extract from the crash log which gives symbol names, someone here might be able to figure out what to fix in the code. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users