Hi Richard, I just did another test with my PowerFailureTest app. I launched it and the count of rows in it was 4402. Without even running the function to import my data that writes to the SQLite file, I cut the power (holding down the power button on my MBP).
When my Mac finally rebooted, I saw that the WAL file was 0 bytes, the SHM file was 32768 bytes, and the db.sqlite file was 10.5 MB (as it was before the test). But now when I launch the test app, These messages display in the console log: *02:42:38.630| WARNING: SQLite error (code 11): database corruption at line 60553 of [2ef4f3a5b1] {at errorLogCallback:125}* *02:42:38.631| WARNING: SQLite error (code 11): statement aborts at 18: [SELECT revs.doc_id, docid, revid, sequence FROM revs, docs WHERE docs.doc_id = revs.doc_id AND current=1 AND deleted=0 ORDER BY docid ASC, revid DESC LIMIT ? OFFSET ?] database disk i {at errorLogCallback:125}* *2017-04-18 02:42:38.630791-0600 PowerFailureTest[672:9264] Unknown error calling sqlite3_step (11: database disk image is malformed) rs* *2017-04-18 02:42:38.632178-0600 PowerFailureTest[672:9264] doc count: 408* So there's definitely some corruption going on. The file was fine before I cut the power. On Tue, Apr 18, 2017 at 2:23 AM, Richard Hipp <d...@sqlite.org> wrote: > On 4/18/17, Brendan Duddridge <brend...@gmail.com> wrote: > > In both cases though I can cause SQLite file corruption by cutting the > > power on my MacBook Pro. > > Corruption-by-power-loss problems tend to be very sensitive to timing. > If you are able to reliably generate the problem by leisurely cutting > power (holding down the power button) that suggests something else. > You might be able to create the same effect by issuing a SIGKILL on > the process (kill -9) at the same point that you would normally cut > the power. > > I'm thinking you have some problem similar to that which is described > in section 2.4 of https://www.sqlite.org/howtocorrupt.html > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users