SQLite Forum

Crashed at sqlite3LeaveMutexAndCloseZombie+452
Login

Crashed at sqlite3LeaveMutexAndCloseZombie+452

(1) By Eric Yeh (EricYeh) on 2021-06-29 04:46:16 updated by 1.1 [link] [source]

I am using "3.22.0", and there's an occasional crash when sqlite3Clsoe() is called.

Part of backtrace:  
sqlite3LeaveMutexAndCloseZombie+452  
sqlite3Clsoe+640

Then I tracked the code, this should have been caused by a NULL pointer passed to functionDestory():

p = sqliteHashData(i); // P may be NULL in some case  
do{  
  functionDestroy(dp, p);  
  pNext = p->pNext;  
  sqlite3DbFree(db, p);  
  p = pNext;  
}while (p);  

So I intend to change this do-while to while-do to avoid this crash.  
Dose anyone have the similar situation?

Crashed at sqlite3LeaveMutexAndCloseZombie+452

(1.1) By Eric Yeh (EricYeh) on 2021-06-29 06:56:02 edited from 1.0 updated by 1.2 [link] [source]

I am using "3.22.0", and there's an occasional crash when sqlite3Close() is called.

Part of backtrace:  
sqlite3LeaveMutexAndCloseZombie+452  
sqlite3Close+640

Then I tracked the code, this should have been caused by a NULL pointer passed to functionDestory():

p = sqliteHashData(i); // P may be NULL in some case  
do{  
  functionDestroy(dp, p);  
  pNext = p->pNext;  
  sqlite3DbFree(db, p);  
  p = pNext;  
}while (p);  

So I intend to change this do-while to while-do to avoid this crash.  
Dose anyone have the similar situation?

Crashed at sqlite3LeaveMutexAndCloseZombie+452

(1.2) By Eric Yeh (EricYeh) on 2021-06-29 12:06:34 edited from 1.1 [source]

I am using "3.22.0", and there's an occasional crash when sqlite3Close() is called.

Part of backtrace:
sqlite3LeaveMutexAndCloseZombie+452
sqlite3Close+640

Then I tracked the code, this should have been caused by a NULL pointer passed to functionDestory():

p = sqliteHashData(i); // P may be NULL in some case
do{
functionDestroy(dp, p);
pNext = p->pNext;
sqlite3DbFree(db, p);
p = pNext;
}while (p);

So I intend to change this do-while to while-do to avoid this crash.
Does anyone have the similar situation?

(2) By Dan Kennedy (dan) on 2021-06-29 17:18:01 in reply to 1.2 [link] [source]

3.22 is 3.5 years old. Lots of bugs fixed since then. I don't recall anything like this though.

If you don't upgrade, it might be worth running your app under valgrind or asan or similar. There shouldn't be NULL values in that hash table. Something is going awry.

Dan.

(3) By Eric Yeh (EricYeh) on 2021-06-30 03:17:28 in reply to 2 updated by 3.1 [link] [source]

Hi Dan,

Thanks for you reply.  
Upgrade is a good idea to solve this problem completely, we will consider that.

But I think before that I need to have some internal evaluation and discussion in my team.  
Currently I will try to change the do-while to while-do to see whether it works for my situation.

(3.1) By Eric Yeh (EricYeh) on 2021-06-30 03:19:27 edited from 3.0 in reply to 2 [link] [source]

Hi Dan,

Thanks for your reply.
Upgrade is a good idea to solve this problem completely, we will consider that.

But I think before that I need to have some internal evaluation and discussion in my team.
Currently I will try to change the do-while to while-do to see whether it works for my situation.