From 7aba8fdef78724c09a89d382cb4373fbedf69d91 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 1 May 2010 11:19:07 +0000 Subject: [PATCH] Fix the sqlite3_mutex_alloc() interface to return NULL (not segfault) when operating in threadsafe mode. (This is a general-purpose bug fix which really ought to be ported to trunk.) FossilOrigin-Name: 64840a3caf569959c9d5e63bdbc0cf675fda3882 --- manifest | 24 +++++++++++++++++------- manifest.uuid | 2 +- src/mutex.c | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index fca9dd688f..43b0d3a294 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C Add\stest\scase\sdemonstrating\sdeadlock\sduring\srecovery\sof\svery\slarge\slog\sfiles.\sNo\sfix\syet. -D 2010-05-01T08:30:35 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Fix\sthe\ssqlite3_mutex_alloc()\sinterface\sto\sreturn\sNULL\s(not\ssegfault)\swhen\noperating\sin\sthreadsafe\smode.\s\s(This\sis\sa\sgeneral-purpose\sbug\sfix\swhich\nreally\sought\sto\sbe\sported\sto\strunk.) +D 2010-05-01T11:19:08 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -139,7 +142,7 @@ F src/mem2.c 2ee7bdacda8299b5a91cff9f7ee3e46573195c38 F src/mem3.c 9b237d911ba9904142a804be727cc6664873f8a3 F src/mem5.c eb7a5cb98915dd7a086fa415ce3a5a0f20d0acff F src/memjournal.c f3be374af30588de297dcf678925b2a4758e4135 -F src/mutex.c 581a272e09098040ca3ef543cb5f3d643eff7d50 +F src/mutex.c c04412513619b3a763f3484bb412336fa3a3fbd9 F src/mutex.h 6fde601e55fa6c3fae768783c439797ab84c87c6 F src/mutex_noop.c 5f58eaa31f2d742cb8957a747f7887ae98f16053 F src/mutex_os2.c 20477db50cf3817c2f1cd3eb61e5c177e50231db @@ -808,7 +811,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P d1fcccecdc8e9ac5d0d022914e51c545f4e1b04f -R 034d4495629d0958f2c325287d33624b -U dan -Z 43bb63963c222b2fa1b30185cbd547d7 +P 63ea318eb19d264667909c70185b8a5cdc4454c0 +R 2100e665be505fa1cf8f47333c26bc0b +U drh +Z 344033a82b2442e0392cbcdded1532fa +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFL3A4voxKgR168RlERAlUnAJ0S3R/Dfykt3Oi2UMidrwOa0L6Q6gCfe8MG +dPCr8yJsMbepoEqgAok4Aos= +=yH/M +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index abff647efb..3bed7c55fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -63ea318eb19d264667909c70185b8a5cdc4454c0 \ No newline at end of file +64840a3caf569959c9d5e63bdbc0cf675fda3882 \ No newline at end of file diff --git a/src/mutex.c b/src/mutex.c index 11d498c474..edddaf1011 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -77,6 +77,7 @@ int sqlite3MutexEnd(void){ ** Retrieve a pointer to a static mutex or allocate a new dynamic one. */ sqlite3_mutex *sqlite3_mutex_alloc(int id){ + if( !sqlite3GlobalConfig.bCoreMutex ) return 0; #ifndef SQLITE_OMIT_AUTOINIT if( sqlite3_initialize() ) return 0; #endif