Me thinkst you're corrupting your stack or memory.
I'd be willing to bet big money that this is your program causing this as there are 1000's of people running that exact same call without any problem at all (like me and I've been using it like crazy across multiple versions of SQLite) If you can try using something like efence which may help detect it. I assume you're on a Unix flavor? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems ________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Christian [siriu...@gmx.de] Sent: Thursday, October 27, 2011 4:51 AM To: sqlite-users@sqlite.org Subject: EXT :[sqlite] Segmentation Fault on SQLITE3_exex Hello everybody, I'm facing a strange issue and believe that my setup is somehow wrong. From time to time my program crashes with segfault when calling: if (sqlite3_exec (db, "BEGIN TRANSACTION", 0, 0, 0) != SQLITE_OK) { //error } The stacktrace points to this function: static void pthreadMutexEnter(sqlite3_mutex *p){ assert( p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p) ); #ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX { pthread_t self = pthread_self(); if( p->nRef>0 && pthread_equal(p->owner, self) ){ p->nRef++; }else{ pthread_mutex_lock(&p->mutex); assert( p->nRef==0 ); p->owner = self; p->nRef = 1; } } #else /* Use the built-in recursive mutexes if they are available. */ pthread_mutex_lock(&p->mutex); //!HERE IT GETS a SEGFAULT! #if SQLITE_MUTEX_NREF assert( p->nRef>0 || p->owner==0 ); p->owner = pthread_self(); p->nRef++; #endif } Any ideas why this happens, or how I could workaround the issue? The query works like 300 times and then suddenly crashes, I checked this with version 3.6.22 (as library) and the actual sources (3.7.8 _ 3007008). Best regards, Chris. -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users