GNOME Bugzilla – Bug 607257
Add checks for event->comp_data != NULL
Last modified: 2010-06-11 14:54:10 UTC
Another case of a pointer not being checked for NULL. (gdb) p event->comp_data $3 = (ECalModelComponent *) 0x0 (gdb) bt
+ Trace 220111
Created attachment 151631 [details] [review] check if event->comp_data is non-NULL
Any clues on how to reproduce this?
(In reply to comment #2) > Any clues on how to reproduce this? No, sorry.
I did get similar crash in 2.28.3. Nothing specific, copied event to local calendar, changed the time of events and at last clicked on calendar preview. Backtrace was generated from '/usr/bin/evolution.bin' [?1034h[Thread debugging using libthread_db enabled] [New Thread 0xaa67eb70 (LWP 6119)] [New Thread 0xace17b70 (LWP 6115)] [New Thread 0xad618b70 (LWP 6113)] [New Thread 0xaf61cb70 (LWP 6111)] [New Thread 0xafe1db70 (LWP 6110)] [New Thread 0xb0e1fb70 (LWP 6109)] [New Thread 0xb061eb70 (LWP 6108)] [New Thread 0xade19b70 (LWP 5737)] [New Thread 0xb0e60b70 (LWP 5651)] 0xffffe424 in __kernel_vsyscall ()
+ Trace 221469
Thread 1 (Thread 0xb556a760 (LWP 5637))
Inferior 1 [process 5637] will be detached. Quit anyway? (y or n) [answered Y; input not from terminal] ---- Critical and fatal warnings logged during execution ---- ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** GdkPixbuf **: gdk_pixbuf_composite: assertion `dest_x >= 0 && dest_x + dest_width <= dest->width' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** GdkPixbuf **: gdk_pixbuf_composite: assertion `dest_x >= 0 && dest_x + dest_width <= dest->width' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed ** Gtk **: gtk_action_set_visible: assertion `GTK_IS_ACTION (action)' failed
I believe we can use this check, though it'll be better to add there some g_warning or g_return_if_fail call, to know that something was wrong. Thomas, would you mind to create a larger patch with such runtime warnings added on "all" places where->comp_data is used for actual master? It can be also with some utility function like: gboolean check_comp_data ( *event, const gchar *func_name) { if (!event || !event->comp_data) g_warning ("%s: comp_data on event %p is NULL", func_name); return event && event->comp_data; } which would be called on each place with check_comp_data (event, G_STRFUNC) or you can make a define: #define check_comp_data(e) check_comp_data_call (e, G_STRFUNC) and rename the above function to check_comp_data_call and use just check_comp_data (event) on all other places.
You've more similar bugs and patches on different places in bugzilla already, if I recall correctly, thus with the above we can fix them all in once and mark them as a duplicate of this one.
(In reply to comment #6) > You've more similar bugs and patches on different places in bugzilla already, > if I recall correctly, thus with the above we can fix them all in once and mark > them as a duplicate of this one. I've uploaded the current patches I put on top of the gnome-2-28 branch via stg to http://www.t-mittelstaedt.de/evo-eds-patches-2-28.tar.gz http://www.t-mittelstaedt.de/evo-patches-2-28.tar.gz They are usually named like "issue_<bug_number>...". I am very happy with evolution right now, can't remember when it crashed the last time. thomas
(In reply to comment #7) > http://www.t-mittelstaedt.de/evo-eds-patches-2-28.tar.gz - bug #529331 - in 2.30.0 - bug #556001 - hmm, slightly in doubt here, sound to me similar to bug #573240 - bug #579360 - empty file, in 2.26.2 - bug #595389 - empty file, in 2.28.something - bug #603854 + _i - moved to bug #603506, in 2.29.91 > http://www.t-mittelstaedt.de/evo-patches-2-28.tar.gz - bug #529331 - in 2.30.0 - bug #544187 - what is that? a patch in a closed bug? please follow last comment there - bug #599459 - I'm not sure on this as well - bug #604172 - moved to bug #589568, pretty hard to reproduce, isn't it? - bug #607257 - this one :) - bug #613764 - only because of above bug #529331 OK, here are your patches, though it's not what I was asking for. :) Are you able to build the gnome-2-30 branch and produce patch for this bug with improvements I suggested in comment #5? No problem if you cannot right now, I can do it.
*** Bug 599459 has been marked as a duplicate of this bug. ***
Created attachment 161009 [details] [review] evo patch for evolution; I thought of something like this. I added two simple functions to e-calendar-view.c/.h, and a macro for each, and then used them all around the calendar sources, either before accessing index of the array(s) (the above duplicate bug) or before accessing event->comp_data. I didn't add index check on places where is traversed whole array.
Created commit 5a124a6 in evo master (2.31.2+) I believe there are more outstanding bug reports which are affected by same symptoms, and which will be transformed from a crash to a critical warning by the above patch. Let's see.
Created attachment 161094 [details] [review] adaptation for master patch to gnome-2-28 branch (In reply to comment #11) > Created commit 5a124a6 in evo master (2.31.2+) > > I believe there are more outstanding bug reports which are affected by same > symptoms, and which will be transformed from a crash to a critical warning by > the above patch. Let's see. Okay, adapted your patch to my quite current gnome-2-28 branch version. Have uploaded the diffs, just in case someone is interested. Haven't seen any problems so far after restart.
Comment on attachment 161094 [details] [review] adaptation for master patch to gnome-2-28 branch OK, thanks, there is not planned any update for 2.28, but as you said, maybe someone else will use it.
*** Bug 621305 has been marked as a duplicate of this bug. ***