evolution crashed with SIGSEGV in strtoul() due to NULL flags column in folders.db

Bug #339169 reported by Stas Sușcov
36
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evolution
Fix Released
Critical
evolution (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Symptoms
=======

Evolution segfaults when opening a folder, with
#1 0x00007ffff48771ab in read_uids_flags_callback at camel-db.c:892
#2 0x00007ffff462ab57 in sqlite3_exec () from /usr/lib/libsqlite3.so.0

in the backtrace

This may occur at startup if INBOX has the problem.

StacktraceTop:
 ?? () from /lib/tls/i686/cmov/libc.so.6
 strtoul () from /lib/tls/i686/cmov/libc.so.6
 ?? () from /usr/lib/libcamel-1.2.so.14
 sqlite3_exec () from /usr/lib/libsqlite3.so.0
 camel_db_select () from /usr/lib/libcamel-1.2.so.14
Title: evolution crashed with SIGSEGV in strtoul()

Cause
=====

libcamel doesn't handle NULL flags fields in record summaries, but inserts them while pulling down new messages, so a power failure after learning about a message but before setting the flags corrupts that mail summary.

Workarounds
==========

* Remove folders.db to make it be recreated.
* Remove rows from the faulty table which have flags set to NULL (note NULL, not 0 - 0 is fine)
* Apply the patch from upstream.

Revision history for this message
Stas Sușcov (sushkov) wrote :
Revision history for this message
Stas Sușcov (sushkov) wrote :

Anybody else has the same problem?
For about a week I can't start evolution.

It hangs on "Opening my imap folder from the server" then dies throwing all above.
:(

Revision history for this message
Apport retracing service (apport) wrote : Symbolic stack trace

StacktraceTop:*__GI_____strtoul_l_internal (nptr=0x0, endptr=0x0,
*__GI_strtoul (nptr=0x0, endptr=0x0, base=10)
read_uids_flags_callback (ref=0xb3521094, ncol=2,
sqlite3_exec (db=0x93765e0,
camel_db_select (cdb=0x9376430,

Revision history for this message
Apport retracing service (apport) wrote : Symbolic threaded stack trace
Revision history for this message
Apport retracing service (apport) wrote : Stack trace with source code
Changed in evolution:
importance: Undecided → Medium
Revision history for this message
Pedro Villavicencio (pedro) wrote : Re: evolution crashed with SIGSEGV in strtoul()

Thanks for the report, that's known upstream you can track it here: http://bugzilla.gnome.org/show_bug.cgi?id=573125

Changed in evolution:
assignee: nobody → desktop-bugs
status: New → Triaged
Changed in evolution:
status: Unknown → In Progress
Revision history for this message
Stas Sușcov (sushkov) wrote : Re: [Bug 339169] Re: evolution crashed with SIGSEGV in strtoul()

Thanks a lot for clearing this out.

On Tue, Mar 10, 2009 at 7:26 PM, Bug Watch Updater
<email address hidden> wrote:
> ** Changed in: evolution
>       Status: Unknown => In Progress
>
> --
> evolution crashed with SIGSEGV in strtoul()
> https://bugs.launchpad.net/bugs/339169
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
() Campania Panglicii în ASCII
/\ http://stas.nerd.ro/ascii/

Revision history for this message
Stas Sușcov (sushkov) wrote :

Btw, so a solution is to remove ~/.evolution and start again adding
accounts from the beginning?

Thanks.

On Tue, Mar 10, 2009 at 8:37 PM, Stas Sushkov <email address hidden> wrote:
> Thanks a lot for clearing this out.
>
> On Tue, Mar 10, 2009 at 7:26 PM, Bug Watch Updater
> <email address hidden> wrote:
>> ** Changed in: evolution
>>       Status: Unknown => In Progress
>>
>> --
>> evolution crashed with SIGSEGV in strtoul()
>> https://bugs.launchpad.net/bugs/339169
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>
>
>
> --
> ()  Campania Panglicii în ASCII
> /\  http://stas.nerd.ro/ascii/
>

--
() Campania Panglicii în ASCII
/\ http://stas.nerd.ro/ascii/

Revision history for this message
Jerome Warnier (jwarnier) wrote : Re: evolution crashed with SIGSEGV in strtoul()

Using http://www.gnome.org/~sragavan/evolution-rebuild-summarydb stated that my DB was corrupt:
$ ./evolution-rebuild-summarydb
Rebuilding Table ./local/folders.db
Rebuilding Table ./vfolder/folders.db
Rebuilding Table ./<email address hidden>/folders.db
SQL error: database disk image is malformed

I'm using IMAP, so all my e-mail is stored on the server. I then completely deleted my local cache directory: ~/.<email address hidden>/.
I started Evolution, which resynchronized all my e-mail and is working again.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

could you please comment that on the upstream report? thanks.

Revision history for this message
Jerome Warnier (jwarnier) wrote :

Done.

Revision history for this message
Robert Collins (lifeless) wrote :

The problem is with a uid or flags which is NULL - the strings passed in are 0x0 pointers, and the parsing code appears to barf.

Revision history for this message
Robert Collins (lifeless) wrote :

There is a patch in the upstream bug; its also possible to clean the DB by removing rows where the flags is NULL, evolution will grab the needed data again.

summary: - evolution crashed with SIGSEGV in strtoul()
+ evolution crashed with SIGSEGV in strtoul() due to NULL flags column in
+ folders.db
description: updated
Revision history for this message
Robert Collins (lifeless) wrote :
Revision history for this message
Robert Collins (lifeless) wrote :
Revision history for this message
Robert Collins (lifeless) wrote :
Revision history for this message
Robert Collins (lifeless) wrote :

The debdiff should apply trivially to lucid too, which is needed to pass the 'test in the development branch' aspect of SRU.

Revision history for this message
Robert Collins (lifeless) wrote :

I've built a package for karmic - available in https://edge.launchpad.net/~lifeless/+archive/ppa

Changed in evolution:
importance: Unknown → Critical
Revision history for this message
Artur Rona (ari-tczew) wrote :

The patch is obsolete. Please update it for maverick, test and give feedback. Then resubscribe ubuntu-sponsors.

Artur Rona (ari-tczew)
tags: added: patch
Artur Rona (ari-tczew)
summary: - evolution crashed with SIGSEGV in strtoul() due to NULL flags column in
- folders.db
+ [natty] evolution crashed with SIGSEGV in strtoul() due to NULL flags
+ column in folders.db
summary: - [natty] evolution crashed with SIGSEGV in strtoul() due to NULL flags
- column in folders.db
+ evolution crashed with SIGSEGV in strtoul() due to NULL flags column in
+ folders.db
Artur Rona (ari-tczew)
tags: added: natty-sponsor
Changed in evolution:
status: In Progress → Fix Released
Changed in evolution (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.