sanhua.zh wrote: > I am debugging db corruption. After I get some corrupted db, I found that > they all corrupted by writing null data. > > 0x1000f8000 + 2778664 sqlite3KnownError,main.c,line 3192 > 0x1000f8000 + 2554560 unixWrite,os_unix.c,line 3335 > 0x1000f8000 + 2821984 sqlite3WalCheckpoint,wal.c,line 1798 > > You can see the SQLite checkpointing. That is the reason why my database > corrupt.
The checkpoint operations just copies data from the WAL file to the actual database file. For this to be a bug in the database, you'd have to catch it writing those zero bytes to the WAL file first. Unless you do, we can conclude that the zero bytes were never written by the database; the WAL file got corrupted for other reasons (probably broken flash). Regards, Clemens