I have a problem with SQLite locking when trying to allocate memory. I
don't know whether this is my problem, or something else. But the
problem occurs inside SQLite.
A backtrack shows:
/usr/local/lib/libsqlite3.so.0(sqlite3ParserAlloc+0x26) [0x4013d1c6]
/usr/local/lib/libsqlite3.so.0(sqlite3RunParser+0xa3) [0x40146033]
/usr/local/lib/libsqlite3.so.0(sqlite3_prepare+0x159) [0x40134fd9]
Which locks in this function, in the file parse.c:
void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
yyParser *pParser;
pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); // *
if( pParser ){
pParser->yyidx = -1;
}
return pParser;
}
* = locking line of code. During the 'malloc' stage, which is I think
passed into this function.
I have tried malloc in my own code, which will happily malloc up to
gigabytes in size.
This occurs after several calls to sqlite3_prepare, say 22 calls. In
each case I call 'sqlite3_finalize'. During a lock, the code waits
indefinitely and has to be killed. Called by Apache.
I am sure this is something I have done. But I do not know what would
effect the ability or SQLite to malloc memory.
If there are any users who have experienced this and may know what I can
do, I would be really glad to hear.
Kind regards,
Ben Clewett.
Apologies if this is wholly irrelevant.