Hi.

in sqlite3.3.8(latest)
 ./configure --prefix=/sw CFLAGS=-g CPPFLAGS=-g

1 thread : 1 db model

Error on many thread's request(about 1k/sec) to same db file.

This problem repeated sometimes.

I use sqlite3_commit_hook, sqlite3_rollback_hook, sqlite3_update_hook and sqlite3_set_authorizer APIs.

------------------- source code ----------------------------------
void client_safe_exit( struct thread_t *self )
{
        db_close( &self->db );
}

int db_close( struct db_t *db )
{
        int     result;

        if ( db->opened == TRUE )
        {
                db_err_free( db );
                /*XXXXXXXXXXX ERROR */
                result = sqlite3_close( db->db );
                db->opened = FALSE;
                db->db = NULL;
                return result;
        }
        return SQLITE_OK;
}
------------------- gdb back trace result ------------------------

sqlitedbms(21573,0x1820600) malloc: *** Deallocation of a pointer not malloced: 0x50a0e1; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x3500000c
[Switching to process 21573 thread 0x3f7f]
0x00226aba in sqlite3_close (db=0x521670) at ./src/main.c:155
155           pNext = pFunc->pNext;
(gdb) q
The program is running.  Exit anyway? (y or n) t^Hy^H^C
Please answer y or n.
The program is running.  Exit anyway? (y or n) n
Not confirmed.
(gdb) bt
#0  0x00226aba in sqlite3_close (db=0x521670) at ./src/main.c:155
#1  0x00003996 in db_close (db=0x1811824) at libsqlite3.c:101
#2  0x000056c2 in client_safe_exit (self=0x1811600) at proc.c:706
#3  0x00005d12 in client (data=0x1811600) at proc.c:379
#4  0x90023d87 in _pthread_body ()
(gdb) bt full
#0  0x00226aba in sqlite3_close (db=0x521670) at ./src/main.c:155
        pFunc = (FuncDef *) 0x35000000
        pNext = (FuncDef *) 0x35000000
        i = (HashElem *) 0x52aff0
        j = 2
#1  0x00003996 in db_close (db=0x1811824) at libsqlite3.c:101
        result = 889192448
        db = (struct db_t *) 0x1811824
#2  0x000056c2 in client_safe_exit (self=0x1811600) at proc.c:706
        self = (struct thread_t *) 0x1811600
#3  0x00005d12 in client (data=0x1811600) at proc.c:379
        pollfd = {
  fd = 16,
  events = 27,
  revents = 19
}
        poll_res = 889192448
        read_res = 889192448
        auth_res = 889192448
        db_res = 74352
        result = 889192448
        http_res = 889192448
        data = (void *) 0x1811600
#4  0x90023d87 in _pthread_body ()
No symbol table info available.
(gdb)


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to