SQLite Forum

Interpreting output from showdb
Login
Hi,

I'm analyzing a corrupt SQLite database file using the showdb tool. I'm not sure how to interpret the following output:

```
ERROR: page 641 used multiple times:
ERROR:    previous: overflow 1 from cell 0 of page 128
ERROR:    current:  overflow 1 from cell 0 of page 128
ERROR: page 604 used multiple times:
ERROR:    previous: overflow 1 from cell 1 of page 128
ERROR:    current:  overflow 1 from cell 1 of page 128
ERROR: page 667 used multiple times:
ERROR:    previous: overflow 1 from cell 2 of page 128
ERROR:    current:  overflow 1 from cell 2 of page 128
ERROR: page 555 used multiple times:
ERROR:    previous: overflow 1 from cell 3 of page 128
ERROR:    current:  overflow 1 from cell 3 of page 128
ERROR: page 172 used multiple times:
ERROR:    previous: overflow 1 from cell 4 of page 128
ERROR:    current:  overflow 1 from cell 4 of page 128
ERROR: page 204 used multiple times:
ERROR:    previous: overflow 1 from cell 5 of page 128
ERROR:    current:  overflow 1 from cell 5 of page 128
ERROR: page 592 used multiple times:
ERROR:    previous: overflow 1 from cell 6 of page 128
ERROR:    current:  overflow 1 from cell 6 of page 128
```

Also, I had to apply the following patch to avoid crashing on double free when running showdb:

```
>fossil diff
Index: tool/showdb.c
==================================================================
--- tool/showdb.c
+++ tool/showdb.c
@@ -793,10 +793,12 @@
   if( zPageUse[pgno]!=0 ){
     printf("ERROR: page %d used multiple times:\n", pgno);
     printf("ERROR:    previous: %s\n", zPageUse[pgno]);
     printf("ERROR:    current:  %s\n", zMsg);
     sqlite3_free(zPageUse[pgno]);
+    zPageUse[pgno] = 0;
   }
   zPageUse[pgno] = zMsg;
 }
```