Open lotawei opened 5 years ago
We'll need more information to help diagnose the problem. Stack traces are always helpful.
Hi, I have similar crash: [self.fmdbConnection inTransaction:^(FMDatabase db, BOOL rollback) { FMResultSet rs = [db executeQuery:@"select 1 from (select count() as a from TABLE1) join (select count(*) as b from MESSAGEINDEX_docsize) on a = b"]; if (![rs next]) // there will be crash { [db executeUpdate:@"INSERT INTO MESSAGEINDEX(MESSAGEINDEX) VALUES('rebuild')"]; } }]; [self.fmdbConnection close];
Stack trace from crashing thread: Thread 4 name: Thread 4: 0 libsystem_kernel.dylib 0x00000001b7c047e0 pread + 8 1 libsqlite3.dylib 0x000000019f933db0 seekAndRead + 76 (sqlite3.c:40142) 2 libsqlite3.dylib 0x000000019f885e50 unixRead + 208 (sqlite3.c:40234) 3 libsqlite3.dylib 0x000000019f8a840c readDbPage + 180 (sqlite3.c:24270) 4 libsqlite3.dylib 0x000000019f93d6d4 getPageNormal + 496 (sqlite3.c:65416) 5 libsqlite3.dylib 0x000000019f947ffc getAndInitPage + 96 (sqlite3.c:65531) 6 libsqlite3.dylib 0x000000019f8c6a4c sqlite3VdbeExec + 20924 (sqlite3.c:0) 7 libsqlite3.dylib 0x000000019f8c08f0 sqlite3_step + 308 (sqlite3.c:92004) 8 MyTarget 0x000000010a4dec44 -[FMResultSet nextWithError:] + 60 (FMResultSet.m:166)
Could you please help what it could be?
when use fmdb like this 。。。
and location fmdb crash in this function
- (BOOL)nextWithError:(NSError **)outErr
crashed in int rc = sqlite3_step([_statement statement]);
so i am feel uncertained