Hi Doug,
This is what I see in the console:
(gdb) print *db
$2 = {
nDb = 2,
aDb = 0x177a750c,
flags = 32,
errCode = 5,
autoCommit = 1 '\001',
temp_store = 0 '\0',
nTable = 1,
pDfltColl = 0x1770f300,
lastRowid = 0,
priorNewRowid = 0,
magic = -1607883113,
nChange = 0,
nTotalChange = 0,
init = {
iDb = 0,
newTnum = 1,
busy = 0 '\0'
},
pVdbe = 0x0,
activeVdbeCnt = 0,
xTrace = 0,
pTraceArg = 0x0,
xProfile = 0,
pProfileArg = 0x0,
pCommitArg = 0x0,
xCommitCallback = 0,
pRollbackArg = 0x0,
xRollbackCallback = 0,
pUpdateArg = 0x0,
xUpdateCallback = 0,
xCollNeeded = 0,
xCollNeeded16 = 0,
pCollNeededArg = 0x0,
pErr = 0x17715590,
zErrMsg = 0x0,
zErrMsg16 = 0x0,
xAuth = 0,
pAuthArg = 0x0,
xProgress = 0,
pProgressArg = 0x0,
nProgressOps = 0,
pNext = 0x0,
aFunc = {
keyClass = 3 '\003',
copyKey = 0 '\0',
count = 36,
first = 0x17737ef0,
xMalloc = 0x44f304 <sqlite3MallocX>,
xFree = 0x44f2b0 <sqlite3FreeX>,
htsize = 64,
ht = 0x1b12c00
},
aCollSeq = {
keyClass = 3 '\003',
copyKey = 0 '\0',
count = 2,
first = 0x17576f60,
xMalloc = 0x44f304 <sqlite3MallocX>,
xFree = 0x44f2b0 <sqlite3FreeX>,
htsize = 8,
ht = 0x1770d7d0
},
busyHandler = {
xFunc = 0x2a2ae4 <sqlite3ErrStr+932>,
pArg = 0x177a7420,
nBusy = -1
},
busyTimeout = 3000,
aDbStatic = {{
zName = 0x2a4f44 "main",
pBt = 0x1778a6b0,
inTrans = 0 '\0',
safety_level = 3 '\003',
pAux = 0x0,
xFreeAux = 0,
pSchema = 0x177434f0
}, {
zName = 0x2a4f4c "temp",
pBt = 0x0,
inTrans = 0 '\0',
safety_level = 1 '\001',
pAux = 0x0,
xFreeAux = 0,
pSchema = 0x17507660
}}
}
(gdb) print zSql
$3 = 0x1774fec0 "SELECT * FROM main.sqlite_master WHERE name =
'documents';"
Also:
nBytes = -1
ppStmt = 0x0
pzTail = 0x0
I realized that I was initializing 'ppStmt' to NULL by mistake
before calling sqlite3_prepare(). Removing the initialization cleared
the error.
Thanks Doug.
-- Tito
On 24/04/2006, at 12:41, Doug Nebeker wrote:
What does the code look like that is calling sqlite3_prepare? The
crash
point is just dereferening a pointer that you passed in, and it looks
like the pointer value must be bad.
int sqlite3_prepare(
sqlite3 *db, /* Database handle. */
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared
statement */
const char** pzTail /* OUT: End of parsed string */
){
Parse sParse;
char *zErrMsg = 0;
int rc = SQLITE_OK;
int i;
/* Assert that malloc() has not failed */
assert( !sqlite3MallocFailed() );
assert( ppStmt );
*ppStmt = 0; <<<<<<<<<< the crash occurs here...
Any ideas why this is happening?
Thanks,
-- Tito
To find out more about Reuters visit www.about.reuters.com
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be the
views of Reuters Ltd.