From: drh Date: Sat, 30 Jan 2010 19:17:07 +0000 (+0000) Subject: Avoid a race condition in the sqlite3_release_memory() logic within pager.c. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20d8778d8202ab824d3534a38d045bc673772f54;p=thirdparty%2Fsqlite.git Avoid a race condition in the sqlite3_release_memory() logic within pager.c. FossilOrigin-Name: a718e6634795a48b5dd5c08833ab561e6381a62d --- diff --git a/manifest b/manifest index 1c62facc69..ef8711913d 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Remove\sall\scache\spages\sfrom\sthe\sLRU\slist\sprior\sto\sremoving\sthe\spager\sfrom\sthe\npager\slist\swhen\sclosing\sa\spager. -D 2010-01-30T19:00:55 +C Avoid\sa\srace\scondition\sin\sthe\ssqlite3_release_memory()\slogic\swithin\spager.c. +D 2010-01-30T19:17:07 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 79aeba12300a54903f1b1257c1e7c190234045dd F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -124,7 +124,7 @@ F src/os_common.h e8b748b2f2ecc8a498e50bfe5d8721f189c19d2a F src/os_os2.c 0c3a5802bc4fdb7cb5f66771552b081c4e48a216 F src/os_unix.c a810e2aefdaddacf479407f76f8f4ca381d231b2 F src/os_win.c 3a60bddd07ea6f8adb2314dd5996ac97b988f403 -F src/pager.c ce1e53959413c5e41b9242c3b28800a2bcb1e2ae +F src/pager.c 3b7e5e4e250deac18b1a0a9ef651debc0690d6ae F src/pager.h 4f051fd856de6fd3c19aef5f82eace54122b9173 F src/parse.y fc4bd35c6088901f7c8daead26c6fb11c87d22e7 F src/pragma.c 2e4bb2e76e48a32750529fdc4bfe86ac5f54e01b @@ -637,14 +637,14 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P c50e972f1bea2e357f64ffd5df868bf51d942e2d -R 36f835414aa04d98dddf953ed614b296 +P 9d13acc4493ee8be9e6cbf887cd7876d6239b952 +R 25875cbaa3332e847212b49923ec3929 U drh -Z fffc5f9ba8ca83294c88a45d2f860720 +Z 2718af45d2ca11e075da3a339f4d03bc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFLZIHqoxKgR168RlERArFRAJoD8+F7K7rddFbpXj9QxFnE7UaDXwCeINqB -ifiO8Ws6773K464iIx4YI3I= -=byhl +iD8DBQFLZIW2oxKgR168RlERApuGAKCA4g/+5TbRsKOnLtfTD7whFywjuQCcDhRS +xtMVTORcy2iXShF+utiz32I= +=WeIu -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index b8e10715b1..0f9415df4a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9d13acc4493ee8be9e6cbf887cd7876d6239b952 \ No newline at end of file +a718e6634795a48b5dd5c08833ab561e6381a62d \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index ede0aa1556..9b0177fadc 100644 --- a/src/pager.c +++ b/src/pager.c @@ -3294,7 +3294,6 @@ int sqlite3PagerReleaseMemory(int nReq){ while( rc==SQLITE_OK && (nReq<0 || nReleasedpPager; - assert(!pPg->needSync || pPg==pPager->lru.pFirst); - assert(pPg->needSync || pPg==pPager->lru.pFirstSynced); - savedBusy = pPager->pBusyHandler; pPager->pBusyHandler = 0; - rc = pager_recycle(pPager, &pRecycled); + rc = pager_recycle(pPager, &pPg); pPager->pBusyHandler = savedBusy; - assert(pRecycled==pPg || rc!=SQLITE_OK); if( rc==SQLITE_OK ){ /* We've found a page to free. At this point the page has been ** removed from the page hash-table, free-list and synced-list