From 35dcd0e89231faa9af59bc24edafbd09dd28d240 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 2 Jun 2017 09:31:27 +0000 Subject: [PATCH] Extend even further the logging designed to find problems in the pointer-map structure. Call abort() to dump a core as soon as such a problem is seen. FossilOrigin-Name: f131677dcb4937e0dd62626afa91756aa28079e92acd6e9e127f6f676aa334f9 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/btree.c | 10 +++++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 7df12fad09..7622016606 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Generate\sextra\slog\smessages\sin\sresponse\sto\sirregularites\sin\sthe\spointer-map\nused\sby\s"BEGIN\sCONCURRENT"\stransactions. -D 2017-05-31T17:06:13.603 +C Extend\seven\sfurther\sthe\slogging\sdesigned\sto\sfind\sproblems\sin\sthe\spointer-map\nstructure.\sCall\sabort()\sto\sdump\sa\score\sas\ssoon\sas\ssuch\sa\sproblem\sis\sseen. +D 2017-06-02T09:31:27.185 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -350,7 +350,7 @@ F src/auth.c 79f96c6f33bf0e5da8d1c282cee5ebb1852bb8a6ccca3e485d7c459b035d9c3c F src/backup.c faf17e60b43233c214aae6a8179d24503a61e83b F src/bitvec.c c77b7f5759e413c1c8b53267d633c952e66db79c1171964c7e24c0f92f5019cf F src/btmutex.c 0e9ce2d56159b89b9bc8e197e023ee11e39ff8ca -F src/btree.c 322cd2e8aa98c5e44fb9fc756e15fe86c093bdba2e8c4465541098a56b1dd0a7 +F src/btree.c 63ae7953340839b84a1462f01414debebf8a178867085189280698f0cf724219 F src/btree.h 14e99cc2b666beb60322173c761d16b668ec2e07c18bbb74e8a49fe85946f8a0 F src/btreeInt.h 7429915fc8f51bbd78b7ac023aa4afbe5b9660fc1e6970f144b07540a34a4623 F src/build.c ba3f389668754c407805bbc5f8ab140f063ba6b04a6a86f63006b63b3c7319a8 @@ -1591,7 +1591,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9ad846e57bd427adc7c29768cabca18905f7f978168e0642a5917d894fda8bfd -R 524ad4cfe044e13975f9c2307068a2ae +P f7e3e2bc88f110d9282ce5d2fa58580c585faeb57cb707253f05001e5f4bd91b +R 0cc4cace2096d9ccd320cd1d9a64685a U dan -Z b8c7e688cb5faa52956d652176272c93 +Z 40b70ad4ffb9dd03aeca52705a79b953 diff --git a/manifest.uuid b/manifest.uuid index 063e7cf439..c8b24c331b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f7e3e2bc88f110d9282ce5d2fa58580c585faeb57cb707253f05001e5f4bd91b \ No newline at end of file +f131677dcb4937e0dd62626afa91756aa28079e92acd6e9e127f6f676aa334f9 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 183e3db17c..e495aa3297 100644 --- a/src/btree.c +++ b/src/btree.c @@ -657,6 +657,7 @@ static void btreeCheckPtrmap(BtShared *p, int nPage, const char *zLog){ (n>4 ? (int)pMap->aPtr[4].eType : -1), (n>4 ? (int)pMap->aPtr[4].parent : -1) ); + abort(); break; } } @@ -8806,6 +8807,8 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ invalidateIncrblobCursors(p, pCur->pgnoRoot, pCur->info.nKey, 0); } + btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(0)"); + /* Make the page containing the entry to be deleted writable. Then free any ** overflow pages associated with the entry and finally remove the cell ** itself from within the page. */ @@ -8815,6 +8818,8 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ dropCell(pPage, iCellIdx, info.nSize, &rc); if( rc ) return rc; + btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(1)"); + /* If the cell deleted was not located on a leaf page, then the cursor ** is currently pointing to the largest entry in the sub-tree headed ** by the child-page of the cell that was just deleted from an internal @@ -8840,6 +8845,8 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ if( rc ) return rc; } + btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(2)"); + /* Balance the tree. If the entry deleted was located on a leaf page, ** then the cursor still points to that page. In this case the first ** call to balance() repairs the tree, and the if(...) condition is @@ -8863,6 +8870,8 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ rc = balance(pCur); } + btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(3)"); + if( rc==SQLITE_OK ){ if( bSkipnext ){ assert( bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB) ); @@ -8882,7 +8891,6 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ } } } - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeInsert()"); return rc; } -- 2.47.3