La aplicación funciona bien en el modo de depuración pero se bloquea en el modo de lanzamiento con sqlite

I have a problem with an app developed using Xcode. It runs well in Debug but crashes in Release on a SQLite statement:

if (sqlite3_prepare_v2(database, sql, -1, &init_statement, NULL) != SQLITE_OK) {
NSAssert1(NO, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
}
if (sqlite3_step(init_statement) == SQLITE_ROW) {
... }

In Release mode it crashed at the line sqlite3_step(init_statement) == SQLITE_ROW con este error:

Programa recibido señal: "EXC_BAD_ACCESS".

The following is the message I got before crashing:

[Switching to process 7939 thread 0x1f03]

There is no problem found in Debug mode.

Gracias por cualquier ayuda!

preguntado el 01 de febrero de 12 a las 22:02

Como estas init_statement? -

Sounds like compiler optimizations might be exposing a previously hidden bug. Does the static analyzer issue any warnings? -

sqlite3_stmt *init_statement = nil; -

After Analyze, 26 messages were issued in sqlite3.c, including some "Dead store"s and "Logic error"s with "Switch Branch" Badges. sqlite3.c is with a "question mark" badge under a sub-project of my current project. I thought sqlite3.c is okay since it was not changed. Do those messages matter? -

This is resolved by turning off the compiler's optimization of a sub-project. Not so sure about the reason. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.