]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a couple of assert() statments in btree.c that could fail with corrupt databases.
authordan <dan@noemail.net>
Fri, 25 Jan 2019 13:42:12 +0000 (13:42 +0000)
committerdan <dan@noemail.net>
Fri, 25 Jan 2019 13:42:12 +0000 (13:42 +0000)
FossilOrigin-Name: 5eb5e8289fa71e5e29e081d33d4a59c64b463bf6b06d7070c05c46d77d808ad4

manifest
manifest.uuid
src/btree.c
test/corruptL.test

index eeded3f3c7547f71cd8ea8d7b8c46f97abc6a6dd..ed68435855e8824065a1299deceb14a5cf1b9782 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sbuffer\soverread\sin\sfts3\sthat\scould\soccur\sin\sa\sprefix\squery\son\sa\scorrupted\sdatabase.
-D 2019-01-24T17:41:12.741
+C Fix\sa\scouple\sof\sassert()\sstatments\sin\sbtree.c\sthat\scould\sfail\swith\scorrupt\sdatabases.
+D 2019-01-25T13:42:12.343
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F Makefile.in 0e7c107ebcaff26681bc5bcf017557db85aa828d6f7fd652d748b7a78072c298
@@ -455,7 +455,7 @@ F src/auth.c 0fac71038875693a937e506bceb492c5f136dd7b1249fbd4ae70b4e8da14f9df
 F src/backup.c 78d3cecfbe28230a3a9a1793e2ead609f469be43e8f486ca996006be551857ab
 F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
 F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
-F src/btree.c 21eb929285901255cf0af2f8e2e9ee41c77e0620e031ddad3d065cfaf95583fd
+F src/btree.c f7ee98fca2c136020527050c00bb63b89cb663a1fad69160bdd332d9c73ce5da
 F src/btree.h febb2e817be499570b7a2e32a9bbb4b607a9234f6b84bb9ae84916d4806e96f2
 F src/btreeInt.h 620ab4c7235f43572cf3ac2ac8723cbdf68073be4d29da24897c7b77dda5fd96
 F src/build.c f07c0b154c23737d1699ee63bba31c8ca8b323e2446b957bc6bfec81a62295fc
@@ -757,7 +757,7 @@ F test/corruptH.test 79801d97ec5c2f9f3c87739aa1ec2eb786f96454
 F test/corruptI.test a17bbf54fdde78d43cf3cc34b0057719fd4a173a3d824285b67dc5257c064c7b
 F test/corruptJ.test 4d5ccc4bf959464229a836d60142831ef76a5aa4
 F test/corruptK.test 5ef338c560ca4dfb7360828da16f1829be4deba3b378cafdc7a1cdaf027eb5c4
-F test/corruptL.test 05e4e193bdd56896bae94d1d1f73a29ff41c9c2bafe32bd390d547c5bfa38f34
+F test/corruptL.test 4c0674edd28dfcf027f57b61944dd6f1ba61c6e98f4f6d72f0adafaef238b593
 F test/cost.test 51f4fcaae6e78ad5a57096831259ed6c760e2ac6876836e91c00030fad385b34
 F test/count.test cb2e0f934c6eb33670044520748d2ecccd46259c
 F test/countofview.test e3d4cd6900e4e4f074968ab24b8b87d3671cd624961bef40fd3a6b8f574343cf
@@ -1802,7 +1802,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 2d9cd06715092c312c8c0ec392696a0e90ed090b074e2082e0b830f1399aa941
-R aefdd33a1c83587ad3b0becf4339d1cc
+P d0d5689371577b2861d4a9464443d055f3256f3f51d89e0388233a4cbe2601ee
+R 86e5fe4bfae1d318cbbdc2a84c65ab72
 U dan
-Z df47a0dfd1efad16167473814c8098a6
+Z 4fafd1aea85fe91f1dc4e55e3b1f6edd
index c8a242b3f717d181390eb5d92c731450b848e799..d7dd384dc660527c6d472ae52ab7cb9f33c29b84 100644 (file)
@@ -1 +1 @@
-d0d5689371577b2861d4a9464443d055f3256f3f51d89e0388233a4cbe2601ee
\ No newline at end of file
+5eb5e8289fa71e5e29e081d33d4a59c64b463bf6b06d7070c05c46d77d808ad4
\ No newline at end of file
index 401f02eebaa8a0766abb21a08d407343b800de8e..2345bb006d558c783611602aa9466450aff86f86 100644 (file)
@@ -6110,7 +6110,7 @@ static int allocateBtreePage(
     TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
   }
 
-  assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
+  assert( CORRUPT_DB || *pPgno!=PENDING_BYTE_PAGE(pBt) );
 
 end_allocate_page:
   releasePage(pTrunk);
@@ -7175,7 +7175,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){
     CellArray b;
 
     assert( sqlite3PagerIswriteable(pNew->pDbPage) );
-    assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) );
+    assert( CORRUPT_DB || pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) );
     zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF);
     b.nCell = 1;
     b.pRef = pPage;
index ee16b9c1df601f4a05c73f845691d9687f38e2c5..638365d6e4ca5e12953b0cffa4be27e12d74ec5a 100644 (file)
@@ -376,4 +376,208 @@ do_catchsql_test 4.1 {
 } {1 {database disk image is malformed}}
 
 
+#-------------------------------------------------------------------------
+reset_db
+do_test 5.0 {
+  sqlite3 db {}
+  db deserialize [decode_hexdb {
+| size 192512 pagesize 4096 filename crash-9ae5502296c949.db
+| page 1 offset 0
+|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
+|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 2f   .....@  ......./
+|     32: 00 00 00 1b 00 00 00 13 00 00 00 03 00 00 00 04   ................
+|     48: 00 00 00 00 00 00 00 06 00 00 00 01 00 00 00 00   ................
+|     64: 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00   ................
+|     96: 00 00 00 00 0d 00 00 00 04 0e e2 00 0f 96 0f 44   ...............D
+|    112: 0f 10 0e e2 00 00 00 00 00 00 00 00 00 00 00 00   ................
+|   3808: 00 00 2c 04 06 17 15 11 01 41 69 6e 64 65 78 74   ..,......Aindext
+|   3824: 31 78 32 74 31 06 43 52 45 41 54 45 20 49 4e 44   1x2t1.CREATE IND
+|   3840: 45 58 20 74 31 78 32 20 4f 4e 20 74 31 28 62 29   EX t1x2 ON t1(b)
+|   3856: 32 03 06 17 15 11 01 4d 69 6e 64 65 78 74 31 78   2......Mindext1x
+|   3872: 31 74 31 05 43 52 45 41 54 45 20 49 4e 44 45 58   1t1.CREATE INDEX
+|   3888: 20 74 31 78 31 20 4f 4e 20 74 31 28 67 2b 68 2c    t1x1 ON t1(g+h,
+|   3904: 6a 2c 6b 29 50 02 06 17 2b 2b 01 59 74 61 62 6c   j,k)P...++.Ytabl
+|   3920: 65 73 71 6c 69 74 65 5f 73 65 71 75 65 6e 63 65   esqlite_sequence
+|   3936: 73 71 6c 69 74 65 5f 73 65 71 75 65 6e 63 65 04   sqlite_sequence.
+|   3952: 43 52 45 41 54 45 20 54 41 42 4c 45 20 73 71 6c   CREATE TABLE sql
+|   3968: 69 74 65 5f 73 65 71 75 65 6e 63 65 28 6e 61 6d   ite_sequence(nam
+|   3984: 65 2c 73 65 71 29 68 01 07 17 11 11 01 81 3b 74   e,seq)h.......;t
+|   4000: 61 62 6c 65 74 31 74 31 03 43 52 45 41 54 45 20   ablet1t1.CREATE 
+|   4016: 54 41 42 4c 45 20 74 31 28 61 20 49 4e 54 45 47   TABLE t1(a INTEG
+|   4032: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41   ER PRIMARY KEY A
+|   4048: 55 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 62 2c   UTOINCREMENT,.b,
+|   4064: 63 2c 64 2c 65 2c 66 2c 67 2c 68 2c 6a 2c 6b 2c   c,d,e,f,g,h,j,k,
+|   4080: 6c 2c 6d 2c 6e 2c 6f 2c 70 2c 71 2c 72 2c 73 29   l,m,n,o,p,q,r,s)
+| page 2 offset 4096
+|      0: 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01   ................
+|     16: 00 00 00 00 02 10 00 00 00 05 00 00 00 03 02 00   ................
+|     32: 00 00 00 05 00 00 00 03 02 00 00 00 00 05 00 00   ................
+|     48: 00 03 02 00 00 00 00 05 00 00 00 03 02 00 00 00   ................
+|     64: 00 05 00 00 00 03 02 00 00 00 00 05 00 00 00 03   ................
+|     80: 02 00 00 00 00 05 00 00 00 03 02 00 00 00 00 05   ................
+|     96: 00 00 00 03 02 00 00 00 00 05 00 00 00 03 05 00   ................
+|    112: 00 00 03 03 00 00 00 23 02 00 00 00 00 03 00 00   .......#........
+|    128: 00 23 02 00 00 00 00 03 00 00 00 23 02 00 00 00   .#.........#....
+|    144: 00 03 00 00 00 23 02 00 00 00 00 03 00 00 00 23   .....#.........#
+|    160: 05 00 00 00 06 05 00 00 00 06 02 00 00 00 00 03   ................
+|    176: 00 00 00 06 02 00 00 00 00 03 00 00 00 24 02 00   .............$..
+|    192: 00 00 00 03 00 00 00 24 02 00 00 00 00 03 00 00   .......$........
+|    208: 00 24 02 00 00 00 00 02 00 00 00 00 03 00 00 00   .$..............
+|    224: 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   $...............
+| page 3 offset 8192
+|      0: 05 00 00 00 09 0f d0 00 00 00 00 19 0f fb 0f f6   ................
+|     16: 0f f1 0f ec 0f e7 0f e2 0f dc 0f d6 0f d0 0f a0   ................
+|     32: 0f a0 0f a0 0f a0 0f a0 0f a0 0f a0 0f a0 0f a0   ................
+|   1072: 00 97 4c 0a 14 00 ae 7c 00 00 00 00 00 00 00 00   ..L....|........
+|   1088: 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00   ................
+|   4000: 0f ac 00 06 00 00 00 00 00 30 00 00 00 00 00 00   .........0......
+|   4048: 00 00 00 16 81 2a 00 00 00 14 81 16 00 00 00 12   .....*..........
+|   4064: 81 02 00 00 00 10 6e 00 00 00 0e 5a 00 00 00 0c   ......n....Z....
+|   4080: 46 00 00 00 0a 32 00 00 00 08 1e 00 00 00 18 0a   F....2..........
+| page 4 offset 12288
+|      0: 0d 00 00 00 01 0f f7 00 0f f7 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 07 01 03 11 02 74 31 00 be   ............t1..
+| page 5 offset 16384
+|      0: 0a 0f 7c 00 0a 0f 74 00 0f f9 0f eb 0f dd 0f cf   ..|...t.........
+|     16: 0f c1 0f b3 0f a4 0f 94 0f 84 0f 74 0f 74 0f 74   ...........t.t.t
+|     32: 0f 74 0f 74 0f 74 0f 74 0f 74 0f 74 0f 74 00 00   .t.t.t.t.t.t.t..
+|   3952: 00 00 00 00 07 05 00 00 00 02 00 be 0f 8c 00 08   ................
+|   3968: 00 00 00 00 07 05 00 00 00 02 00 aa 0f 9c 00 08   ................
+|   3984: 00 00 00 00 07 05 00 00 00 02 00 96 0f ac 00 08   ................
+|   4000: 00 00 00 00 07 05 00 00 00 02 00 82 0f ba 00 07   ................
+|   4016: 00 00 00 06 05 00 00 00 01 6e 0f c8 00 07 00 00   .........n......
+|   4032: 00 06 05 00 00 00 01 5a 0f d6 00 07 00 00 00 06   .......Z........
+|   4048: 05 00 00 00 01 46 0f e4 00 07 00 00 00 06 05 00   .....F..........
+|   4064: 00 00 01 32 0f f2 00 07 00 00 00 06 05 00 00 00   ...2............
+|   4080: 01 1e 00 00 00 07 00 00 00 06 05 00 00 00 01 0a   ................
+| page 6 offset 20480
+|      0: 02 00 00 00 01 0e 0d 00 00 00 00 24 0e 0d 0c 1a   ...........$....
+|     16: 06 55 04 66 02 77 00 88 00 00 00 00 00 00 00 00   .U.f.w..........
+|    128: 00 00 00 00 00 00 00 00 97 3d 04 ae 7c 01 00 00   .........=..|...
+|    624: 00 00 00 00 00 00 21 97 3d 04 ae 7c 01 00 00 00   ......!.=..|....
+|   1120: 00 00 00 00 00 20 97 3d 04 ae 7c 01 00 00 00 00   ..... .=..|.....
+|   1616: 00 00 00 00 1f 97 3d 04 ae 7c 01 00 00 00 00 00   ......=..|......
+|   2112: 00 00 00 1e 97 3d 04 ae 7c 01 00 00 00 00 00 00   .....=..|.......
+|   2608: 00 00 1d 97 3d 04 ae 7c 01 00 00 00 00 00 00 00   ....=..|........
+|   3088: 00 00 00 00 00 00 00 00 00 00 00 00 01 f3 00 00   ................
+|   3600: 23 97 3d 04 ae 7c 01 00 00 00 00 00 00 00 00 00   #.=..|..........
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 26   ...............&
+| page 8 offset 28672
+|      0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00   ......0..0......
+|   1072: 97 4d 1e 14 00 ae 7c 00 00 00 00 00 00 00 00 00   .M....|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03   ................
+| page 10 offset 36864
+|    256: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00   ......0..0......
+|   1072: 97 4d 32 14 00 ae 7c 00 00 00 00 00 00 00 00 00   .M2...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05   ................
+| page 12 offset 45056
+|      0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00   ......0..0......
+|   1072: 97 4d 46 14 00 ae 7c 00 00 00 00 00 00 00 00 00   .MF...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07   ................
+| page 14 offset 53248
+|      0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00   ......0..0......
+|   1072: 97 4d 5a 14 00 ae 7c 00 00 00 00 00 00 00 00 00   .MZ...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09   ................
+| page 16 offset 61440
+|      0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00   ......0..0......
+|   1072: 97 4d 6e 14 00 ae 7c 00 00 00 00 00 00 00 00 00   .Mn...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0b   ................
+| page 18 offset 69632
+|      0: 0d 00 00 00 01 04 2f 00 04 2f 00 00 00 00 00 00   ....../../......
+|   1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97   ................
+|   1072: 4d 81 02 14 00 ae 7c 00 00 00 00 00 00 00 00 00   M.....|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0d   ................
+| page 20 offset 77824
+|      0: 0d 00 00 00 01 04 2f 00 04 2f 00 00 00 00 00 00   ....../../......
+|   1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97   ................
+|   1072: 4d 81 16 14 00 ae 7c 00 00 00 00 00 00 00 00 00   M.....|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f   ................
+| page 22 offset 86016
+|      0: 0d 00 00 00 01 04 2f 00 04 2f 00 00 00 00 00 00   ....../../......
+|   1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97   ................
+|   1072: 4d 81 2a 14 00 ae 7c 00 00 00 00 00 00 00 00 00   M.*...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11   ................
+| page 24 offset 94208
+|      0: 0d 00 00 00 01 04 31 00 04 31 00 00 00 00 00 00   ......1..1......
+|   1072: 00 97 4c 0a 14 00 ae 7c 00 00 00 00 00 00 00 00   ..L....|........
+|   1088: 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00   ................
+| page 25 offset 98304
+|      0: 0d 00 00 00 01 04 2f 00 04 2f 00 00 00 00 00 00   ....../../......
+|   1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97   ................
+|   1072: 4d 81 3e 14 00 ae 7c 00 00 00 00 00 00 00 00 00   M.>...|.........
+|   1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00   ................
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13   ................
+| page 26 offset 102400
+|   2512: 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 00   ................
+| page 27 offset 106496
+|      0: 00 00 00 00 00 00 00 12 00 00 00 07 00 00 00 1d   ................
+|     16: 00 00 00 09 00 00 00 1f 00 00 00 0b 00 00 00 21   ...............!
+|     32: 00 00 00 0d 00 00 00 25 00 00 00 0f 00 00 00 19   .......%........
+|     48: 00 00 00 11 00 00 00 29 00 00 00 13 00 00 00 2b   .......).......+
+|     64: 00 00 00 15 00 00 00 2d 00 00 00 2e 00 00 00 17   .......-........
+| page 28 offset 110592
+|   2512: 00 00 00 00 00 00 00 1e 00 00 00 00 00 00 00 00   ................
+| page 30 offset 118784
+|   2512: 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00   .......2........
+| page 32 offset 126976
+|   2512: 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00   .......F........
+| page 34 offset 135168
+|   2512: 00 00 00 00 00 00 00 5a 00 00 00 00 00 00 00 00   .......Z........
+| page 35 offset 139264
+|      0: 0a 08 44 00 05 02 77 00 0e 11 0a 33 06 55 02 77   ..D...w....3.U.w
+|     16: 04 66 00 88 00 88 00 88 00 00 00 00 00 00 00 00   .f..............
+|    128: 00 00 00 00 00 00 00 00 04 66 01 ef 00 00 00 00   .........f......
+|    624: 00 00 00 00 00 00 00 97 3d 04 ae 7c 01 00 00 00   ........=..|....
+|   1120: 00 00 00 00 00 20 97 3d 04 ae 7c 01 00 00 00 00   ..... .=..|.....
+|   1616: 00 00 00 00 22 97 3d 04 ae 7c 01 00 00 00 00 00   ......=..|......
+|   2112: 00 00 00 1e 0c 22 01 ef 00 00 00 00 00 00 00 00   ................
+|   2608: 00 00 00 97 3d 04 ae 7c 01 00 00 00 00 00 00 00   ....=..|........
+|   3104: 00 1c 00 00 01 ef 00 00 00 00 00 00 00 00 00 00   ................
+|   3600: 00 97 3d 04 ae 7c 01 00 00 00 00 00 00 00 00 00   ..=..|..........
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a   ................
+| page 36 offset 143360
+|      0: 0a 08 44 00 04 02 77 00 06 55 02 77 04 66 0e 11   ..D...w..U.w.f..
+|     16: 00 88 00 88 00 88 0e 11 00 00 00 00 00 00 00 00   ................
+|    128: 00 00 00 00 00 00 00 00 04 76 01 ef 00 00 00 00   .........v......
+|    624: 00 00 00 00 00 00 00 97 3e 04 ae 7c 02 00 00 00   ........>..|....
+|   1120: 00 00 00 00 00 2a 97 3e 04 ae 7c 02 00 00 00 00   .....*.>..|.....
+|   1616: 00 00 00 00 2c 97 3e 04 ae 7c 02 00 00 00 00 00   ....,.>..|......
+|   2112: 00 00 00 28 00 00 05 cd 00 00 00 00 00 00 00 00   ...(............
+|   3600: 00 97 3e 04 ae 7c 02 00 00 00 00 00 00 00 00 00   ..>..|..........
+|   4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2f   .............../
+| page 38 offset 151552
+|   2512: 00 00 00 00 00 00 00 6e 00 00 00 00 00 00 00 00   .......n........
+| page 40 offset 159744
+|   2512: 00 00 00 00 00 00 00 00 82 00 00 00 00 00 00 00   ................
+| page 42 offset 167936
+|   2512: 00 00 00 00 00 00 00 00 96 00 00 00 00 00 00 00   ................
+| page 44 offset 176128
+|   2512: 00 00 00 00 00 00 00 00 aa 00 00 00 00 00 00 00   ................
+| page 47 offset 188416
+|   2512: 00 00 00 00 00 00 00 00 be 00 00 00 00 00 00 00   ................
+| end crash-9ae5502296c949.db
+}]} {}
+
+do_catchsql_test 5.1 {
+  INSERT INTO t1(b) VALUES(zeroblob(40000));
+} {1 {database disk image is malformed}}
+
+do_catchsql_test 5.2 {
+  DROP INDEX t1x2;
+} {0 {}}
+
+do_catchsql_test 5.3 {
+  INSERT INTO t1(b) VALUES(zeroblob(40000));
+} {1 {database disk image is malformed}}
+
+
+
 finish_test