[pyar] [X-Post sqlite-users] database disk image is malformed

Andres Riancho andres.riancho en gmail.com
Sab Sep 6 20:22:38 ART 2014


Lista,

    Les mando esto que tambien envie a la lista de sqlite-users para
ver si me pueden dar una mano.

    I'm using sqlite as the database backend for an open source
project and it works perfectly 99% of the time; however some users
have reported "database disk image is malformed" errors [1][2].

    At the moment the w3af project has a really clean wrapper around
sqlite [3] which allows many threads to talk with the sqlite database
by:
        * Making sure only one SQLiteExecutor thread has an open
connection to the DB
        * All the client threads queue the queries and the thread with
the connection runs them

    The DB stores a considerable amount of rows, in a short period of
time, but I don't believe that's an issue.

    I've read through the how to corrupt document [0] and nothing
seemed to match with what I'm doing. So, my questions are:

        * Do you see anything wrong with my wrapper? [3]
        * Is it possible to debug "database disk image is malformed"
(at the python level, maybe an attribute of the exception?) to better
understand what is causing the issues?
        * I'm setting [4] "PRAGMA synchronous=OFF" for increased
performance. Can this trigger malformed errors?

    Not a sqlite expert... am I missing something big?

[0] https://www.sqlite.org/howtocorrupt.html
[1] https://github.com/andresriancho/w3af/search?q=database+disk+image+is+malformed&type=Issues&utf8=%E2%9C%93
[2] https://github.com/andresriancho/w3af/issues/4905
[3] https://github.com/andresriancho/w3af/blob/master/w3af/core/data/db/dbms.py
[4] https://github.com/andresriancho/w3af/blob/master/w3af/core/data/db/dbms.py#L293

Regards,
-- 
Andrés Riancho
Project Leader at w3af - http://w3af.org/
Web Application Attack and Audit Framework
Twitter: @w3af
GPG: 0x93C344F3


More information about the pyar mailing list