The Evolution Mail & Calendaring Tool

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

Reported by Stas Sușcov on 2009-03-07
36
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evolution
Fix Released
Critical
evolution (Ubuntu)
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.

Stas Sușcov (sushkov) wrote :
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.
:(

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,

Changed in evolution:
importance: Undecided → Medium

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

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/

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/

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.

Pedro Villavicencio (pedro) wrote :

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

Jerome Warnier (jwarnier) wrote :

Done.

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.

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
Robert Collins (lifeless) wrote :
Robert Collins (lifeless) wrote :
Robert Collins (lifeless) wrote :
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.

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
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) on 2010-09-22
tags: added: patch
Artur Rona (ari-tczew) on 2010-09-27
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) on 2010-09-28
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  Edit
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.