After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664370 - Crash when putting same component into icalcomponent
Crash when putting same component into icalcomponent
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Calendar
3.2.x (obsolete)
Other Linux
: High critical
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
: 669601 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-11-19 08:11 UTC by Pierre-Antoine Roiron
Modified: 2015-04-29 15:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log file obtained with the command : CALDAV_DEBUG=all evolution >& evolution.log (120 bytes, text/plain)
2011-11-19 08:11 UTC, Pierre-Antoine Roiron
  Details
copy of gdb's output with the command : gdb evolution (5.89 KB, text/plain)
2011-11-19 08:12 UTC, Pierre-Antoine Roiron
  Details
copy of gdb's output (debug libs installed) with the command : gdb evolution (15.70 KB, text/plain)
2011-11-21 09:56 UTC, Pierre-Antoine Roiron
  Details
evo patch based on Kai's change (1.84 KB, patch)
2012-01-05 13:16 UTC, Milan Crha
committed Details | Review

Description Pierre-Antoine Roiron 2011-11-19 08:11:41 UTC
Created attachment 201697 [details]
log file obtained with the command : CALDAV_DEBUG=all evolution >& evolution.log

Hi, this is my first bug report, feel free to ask missing elements or details! I did my best to provide all these infos, but the solving of it is out of my reach. Patchers, thank you for your time.

Configuration:
-fedora 16 fresh install, up-to-date, french translated system (home directories are translated, like "Download"->"Téléchargements")
-gnome 3.2, translated home directories (like Music,Download).
-evolution 3.2.1 :evolution was populated using the archive made with evolution's version of fedora 15, before the fresh install of fedora 16.

How to reproduce :
a) open evolution
b) calendar page : select a calendar
c) right click "save as"
d) save as .ics or .csv (same behavior)
e)crash
OR
a) open evolution
b) fill the publishing info for a calendar (in my case, classic ftp with id)
c) publish the calendar info with the "Action" menu (.iCal format)
d) crash

Behaviour expected :
Evolution should'nt crash and should generate a file with all the events.

Behaviour and analysis:
In both case a file is generated with the right name, and filled with events before evolution crashes. The file is not corrupted and filled with the right number of events, however it's the same one repetead on and on (same UID, time stamps, etc...). It seems to be a random event in the calendar because it's not the same each time I reproduce the bug, nor the first, nor the last, neither is it the last edited event.

Severity :
Rated critical because of the crash and the important loss of data (if you hope making a backup or sharing calendars).
Priority :
Rated high because it doesn't impact the other functions.

Attached :
- log file obtained with the command : CALDAV_DEBUG=all evolution >& evolution.log
- copy of gdb's output with the command : gdb evolution
Comment 1 Pierre-Antoine Roiron 2011-11-19 08:12:37 UTC
Created attachment 201698 [details]
copy of gdb's output with the command : gdb evolution
Comment 2 André Klapper 2011-11-20 23:04:54 UTC
Thanks for taking the time to report this bug.

(In reply to comment #0)
> Created an attachment (id=201697) [details]
> log file obtained with the command : CALDAV_DEBUG=all evolution >&
> evolution.log

That's basically empty - plus there is no CalDAV server involved anyway I guess. :)

(In reply to comment #1)
> Created an attachment (id=201698) [details]
> copy of gdb's output with the command : gdb evolution

That's more interesting. I have seen this crash before.
Unfortunately, that stack trace is missing some elements that will help a lot to solve the problem, so it will be hard for the developers to fix that crash. Can you get us a stack trace with debugging symbols (evolution, evolution-data-server, glib2, gtk3)? Please see http://live.gnome.org/GettingTraces for more information on how to do so and reopen this bug. Thanks in advance!
Comment 3 Pierre-Antoine Roiron 2011-11-21 09:56:01 UTC
Created attachment 201794 [details]
copy of gdb's output (debug libs installed) with the command : gdb evolution
Comment 4 Pierre-Antoine Roiron 2011-11-21 10:01:39 UTC
I installed evolution's debuginfo packages and tits dependencies and obtained the attached file.
However, at the end f the process, gdb warned me that I should install a bunch of new debuginfo packages. These additional packages I can't install ecuse of a conflict, whichi is a bug filed here :https://bugzilla.gnome.org/attachment.cgi?id=201794

I hope this new trace will be enough (it seems like files and line numbers appear, which is a good hint if I understood what a trace is made for).
Comment 5 André Klapper 2011-11-21 10:43:46 UTC
Looks good, thanks!
Comment 6 Kai 2012-01-05 11:51:48 UTC
I also experience a crash of evolution 3.2.2 instantly after every startup and first drawing of the main window.
It appears to be related to ICal publisching and can be avoided by these workarounds:
* Disable Plugins on startup: "evolution --disable-eplugin"
* "break" the publishing plugin "/usr/lib/evolution/3.2/plugins# mv liborg-gnome-publish-calendar.so liborg-gnome-publish-calendar.so.OFF"

I believe it is the same as https://bugzilla.redhat.com/show_bug.cgi?id=753908 and this bug report.

Here is my backtrace:
  • #0 pvl_head
    from /usr/lib/libical.so.0
  • #1 icalcomponent_free
    from /usr/lib/libical.so.0
  • #2 icalcomponent_free
    from /usr/lib/libical.so.0
  • #3 publish_calendar_as_ical
    from /usr/lib/evolution/3.2/plugins/liborg-gnome-publish-calendar.so
  • #4 ??
    from /usr/lib/evolution/3.2/plugins/liborg-gnome-publish-calendar.so
  • #5 ??
    from /usr/lib/evolution/3.2/plugins/liborg-gnome-publish-calendar.so
  • #6 ??
    from /usr/lib/evolution/3.2/plugins/liborg-gnome-publish-calendar.so
  • #7 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #8 start_thread
    at pthread_create.c line 304
  • #9 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #10 ??

I suspect that this is a double free incident, caused by inserting the same element (head of list == "objects->data")
multipe times into the output ical (typo) in the copy loop. 

This was introduced 2011-06-14 with commit 38790d8478e906a5c59d0c4a5216f297f305bfeb into
http://git.gnome.org/browse/evolution/tree/plugins/publish-calendar/publish-format-ical.c

I propose this patch:
--- publish-format-ical.c.orig	2012-01-05 12:23:38.873216536 +0100
+++ publish-format-ical.c	2012-01-05 12:24:15.283405192 +0100
@@ -110,7 +110,7 @@
 		tdata.client = client;
 
 		for (iter = objects; iter; iter = iter->next) {
-			icalcomponent *icalcomp = objects->data;
+			icalcomponent *icalcomp = iter->data;
 			icalcomponent_foreach_tzid (icalcomp, insert_tz_comps, &tdata);
 			icalcomponent_add_component (top_level, icalcomp);
 		}

I have not compiled or tested this, but appreciate your help in reviewing and integrating my idea/analysis.
Comment 7 Milan Crha 2012-01-05 12:29:45 UTC
Thanks for the update. You got the core of the issue. I did few similar typos in the code, quite stupid typos. Bad of me. The other issue, which is not covered by your change, is that the top_level will then hold separate icalcomponent from 'objects', but these 'objects' are also freed later in the code, thus there is needed to do a copy of the icalcomp, before passing it to top_level. I'll search around the code and fix all related places.

Thanks for finding the issue, I would not expect it being that.
Comment 8 Milan Crha 2012-01-05 13:16:08 UTC
Created attachment 204686 [details] [review]
evo patch based on Kai's change

for evolution;

I found only these three places. The rest usages I looked at seems to be correct. I hopefully didn't overlook more such places.
Comment 9 Milan Crha 2012-01-05 13:24:36 UTC
Created commit ea4c16f in evo master (3.3.4+)
Created commit 50bf460 in evo gnome-3-2 (3.2.3+)
Comment 10 Pierre-Antoine Roiron 2012-01-06 09:48:40 UTC
Thank you Milan Crha and Kai!
Comment 11 Milan Crha 2015-04-29 15:34:11 UTC
*** Bug 669601 has been marked as a duplicate of this bug. ***