Out of curiosity, when you had copies of a corrupt database, did you try
running sqlite's "pragma integrity_check" sql command on them? If so did it
actually find the problems? For a desktop application at a previous company
I was at, we wrote some code that would occasionally save a backup copy of
its sqlite database file which it could roll back to in case of errors, and
we did a "pragma integrity_check" on the new backup before replacing the old
one. This worked in experiments where we'd randomly permute the bytes of the
database file, but we never got good data on how well it worked in the
field.
Also, I did a quick find in our source for handling the SQLITE_CORRUPT
return value from sqlite's statement step function, and it looks like the
only db class that handles it is SafeBrowsingDatabaseBloom. Does anyone know
if the corruption that happens in practice tends to actually make statements
fail with this error? If so it seems like it might be worth trying to make
other parts of our database code be more proactive about handling this
case.



On Fri, Mar 6, 2009 at 10:02 AM, Erik Kay <erik...@chromium.org> wrote:

>
> On Fri, Mar 6, 2009 at 9:33 AM, Brett Wilson <bre...@google.com> wrote:
> > Getting the database has helped in a few cases where it turned out some
> > assumptions were being violated, but if the sqlite data structures are
> > corrupted, getting the DB has never been helpful to diagnose the root
> cause.
> >
> > It might help us make sqlite not crash for these types of corruption,
> > though.
> >
> > I think we should install an exception handler on the DB threads, and if
> we
> > get two crashes in a row from sqlite, recreate the DB.
>
> Yep.  This would be nice.  If these crashes are really this frequent,
> perhaps we should move the db out of the browser process. Or perhaps
> we could simply have an out of process validator that we could run if
> we got a single browser crash from sqlite.
>
> Erik
>
>
>
> > Brett
> >
> > On Mar 6, 2009 9:19 AM, "Erik Kay" <erik...@chromium.org> wrote:
> >
> >
> > One thing that would help is if some of the users who are running into
> > this would be willing to share their whole profile with us.
> >
> > While our best guess is that this is sqlite corruption, we don't know
> > for sure.  Even if it is sqlite corruption, having the specific db
> > might help us figure out how to more reliably detect it.
> >
> > Erik
> >
> > On Thu, Mar 5, 2009 at 10:39 PM, Finnur Thorarinsson <
> fin...@chromium.org>
> > wrote: > I suspect this...
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to