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 544187 - Crash in e_cal_menu_target_new_select at e-cal-menu.c line 144
Crash in e_cal_menu_target_new_select at e-cal-menu.c line 144
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Tasks
2.22.x (obsolete)
Other All
: High blocker
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
: 542917 543579 545606 546449 546741 547286 547473 547576 547630 548242 548277 548542 549169 549616 550836 552313 552325 552693 552787 552962 553026 553310 554436 554439 554717 554719 554751 555822 556106 556880 557703 558682 558698 558707 558708 559234 560129 561517 561551 561552 561814 562021 562599 564088 567959 571055 576996 582289 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-07-22 15:44 UTC by Joaquin Martinez Gadea
Modified: 2010-12-28 07:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Changed the model code a bit. Tested it and seems to work fine. Will update the ChangeLog while committing. (10.05 KB, patch)
2008-08-22 11:09 UTC, Chenthill P
committed Details | Review
Check if total_rows > 0 (532 bytes, patch)
2010-01-22 23:40 UTC, Thomas
none Details | Review
More careful approach, just check for non-NULL-ness of closure.vals before accessing it! (740 bytes, patch)
2010-03-26 22:25 UTC, Thomas
none Details | Review
Even better. Check that the index is within range!! (1.37 KB, patch)
2010-03-27 00:46 UTC, Thomas
none Details | Review
e_table_sorting_utils_sort patch (2.89 KB, patch)
2010-03-27 02:09 UTC, Thomas
none Details | Review

Description Joaquin Martinez Gadea 2008-07-22 15:44:08 UTC
What were you doing when the application crashed?
I write a task in Evolution


Distribution: Debian lenny/sid
Gnome Release: 2.22.3 2008-06-30 (Debian)
BugBuddy Version: 2.22.0

System: Linux 2.6.25-2-vserver-amd64 #1 SMP Mon Jul 14 11:35:37 UTC 2008 x86_64
X Vendor: The X.Org Foundation
X Vendor Release: 10402000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Nuvola
Icon Theme: Mist

Memory status: size: 580820992 vsize: 580820992 resident: 51499008 share: 29073408 rss: 51499008 rss_rlim: 18446744073709551615
CPU usage: start_time: 1216740581 rtime: 428 utime: 387 stime: 41 cutime:3 cstime: 10 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/evolution'

[Thread debugging using libthread_db enabled]
[New Thread 0x7fc0846167a0 (LWP 6384)]
[New Thread 0x45cf4950 (LWP 6426)]
[New Thread 0x45cb3950 (LWP 6420)]
[New Thread 0x40d40950 (LWP 6409)]
0x00007fc07feb9edf in waitpid () from /lib/libpthread.so.0

Thread 1 (Thread 0x7fc0846167a0 (LWP 6384))

  • #0 waitpid
    from /lib/libpthread.so.0
  • #1 IA__g_spawn_sync
    at /tmp/buildd/glib2.0-2.16.3/glib/gspawn.c line 374
  • #2 IA__g_spawn_command_line_sync
    at /tmp/buildd/glib2.0-2.16.3/glib/gspawn.c line 682
  • #3 ??
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #4 nsProfileLock::FatalSignalHandler
    at nsProfileLock.cpp line 216
  • #5 <signal handler called>
  • #6 e_cal_menu_target_new_select
    at e-cal-menu.c line 144
  • #7 tasks_control_sensitize_commands
    at tasks-control.c line 217
  • #8 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #9 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #10 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #11 gtk_signal_emit
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 table_selection_change_cb
    at e-tasks.c line 191
  • #13 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #14 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #15 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #16 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2243
  • #17 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #18 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #19 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #20 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2243
  • #21 e_selection_model_array_insert_rows
    at e-selection-model-array.c line 132
  • #22 model_rows_inserted
    at e-table-selection-model.c line 157
  • #23 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #24 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #25 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #26 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2243
  • #27 e_cal_view_objects_added_cb
    at e-cal-model.c line 1467
  • #28 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #29 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #30 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #31 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2243
  • #32 objects_modified_cb
    at e-cal-view.c line 91
  • #33 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.16.3/gobject/gclosure.c line 490
  • #34 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2440
  • #35 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2199
  • #36 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.16.3/gobject/gsignal.c line 2243
  • #37 impl_notifyObjectsModified
    at e-cal-view-listener.c line 157
  • #38 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #39 ??
    from /usr/lib/libORBit-2.so.0
  • #40 ??
    from /usr/lib/libORBit-2.so.0
  • #41 giop_thread_queue_process
    from /usr/lib/libORBit-2.so.0
  • #42 ??
    from /usr/lib/libORBit-2.so.0
  • #43 IA__g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c line 2009
  • #44 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c line 2642
  • #45 IA__g_main_loop_run
    at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c line 2850
  • #46 bonobo_main
    from /usr/lib/libbonobo-2.so.0
  • #47 main
    at main.c line 793
  • #0 waitpid
    from /lib/libpthread.so.0


----------- .xsession-errors (9 sec old) ---------------------
(npviewer.bin:6350): Gtk-CRITICAL **: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
(npviewer.bin:6350): Gtk-CRITICAL **: gtk_widget_hide: assertion `GTK_IS_WIDGET (widget)' failed
(npviewer.bin:6350): Gtk-CRITICAL **: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
(npviewer.bin:6350): Gtk-CRITICAL **: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
CalDAV Eplugin starting up ...
evolution-shell-Message: Killing old version of evolution-data-server...
** (evolution:6384): DEBUG: mailto URL command: evolution %s
** (evolution:6384): DEBUG: mailto URL program: evolution
(evolution:6384): calendar-gui-CRITICAL **: e_cal_model_get_component_at: assertion `row >= 0 && row < priv->objects->len' failed
(evolution:6384): calendar-gui-CRITICAL **: e_cal_model_copy_component_data: assertion `comp_data != NULL' failed
--------------------------------------------------
Comment 1 Akhil Laddha 2008-07-23 04:27:34 UTC
possible dup of bug 335618
Comment 2 Milan Crha 2008-07-29 16:23:39 UTC
I'll use this bug to be the master bug for crashers in 2.22.3 and 2.23.x in this piece of code, because this trace has been caused by my change in bug #532597. The older bug is fixed (I believe).

-------------------------------------------------------------

The background:
In the above bug #532597, I added some pieces of code to recalculate cursor positions based on the sorter, not the model row numbers, thus when one sorts things and makes changes/deletes rows, after the patch the cursor doesn't jump "randomly" around the table. It was created for address book, but this "class"
is used in calendar/ETable/... too.

For the backtrace itself, I can reproduce it by these steps:
a) have some items with "% Completed" filled zero and one with say 100%.
b) have 10 items, sorted by "% Complete"
c) select second item, double click it, make some change other than in the
   sorting column and save.
d) item came as the last in the list of consecutive 0% completed values, only
   one item is below this, that with 100% complete
e) double click on it one more time (on its new position) and try save changes

The position of the item is crucial, because of going out of bounds (see the console warnings above).

-------------------------------------------------------------

Why this happens? It's because of design of e-cal-model, namely e_cal_view_objects_modified_cb calls e_cal_view_objects_added_cb with list of modified objects, which are removed from the model first in a way that e_table_model_row_deleted is called before the actual array is shorten, thus in e_selection_model_array_delete_rows we shorten the EBitArray, but the underlying sorter has still all items, thus we end up with cursor position out of bounds (that's the reason why this reediting item should be just before the last item in the sorting).

I can call e_table_model_changed after deleting, but it forgets the cursor/selection, which is not a good thing. I can delete item from the array before calling e_table_model_row_deleted, but free the ECalModelComponent object after this, which sort of works, but results in moving cursor somewhere else anyway (because if correctly choose the next item, but when inserting back, it will keep selected the next item, not that one I edited right now. It's the reason why I think the design of ECalModel is not so good). I also remember that I was playing with the ordering of these functions (g_ptr_array_remove and e_table_model_row_deleted), but it caused other issues, I do not remember exactly what, though).

Any Idea? I do not think checking for bounds in the add_uid_cb would be good considered as a fix, it's rather a workaround.
Comment 3 Milan Crha 2008-07-29 16:26:58 UTC
*** Bug 543579 has been marked as a duplicate of this bug. ***
Comment 4 Akhil Laddha 2008-07-31 04:20:25 UTC
*** Bug 545606 has been marked as a duplicate of this bug. ***
Comment 5 ctenorman 2008-08-04 02:33:08 UTC
If this is the same bug that I am dealing with, I find that the error does not occur when working with tasks within calendar mode, where tasks and notes are off at the right. Perhaps the reason for it not crashing in calendar view could fix it in the task view?
Comment 6 Milan Crha 2008-08-04 08:04:43 UTC
(In reply to comment #5)

I guess it's just because you sort the tasks in the right panel in the different way than in the tasks view.
Comment 7 ctenorman 2008-08-04 08:32:52 UTC
You have just made my day!!! All I had to do was switch my sorting view in task mode and the problem disappeared. Thank you so much!!!
Comment 8 Akhil Laddha 2008-08-06 03:28:27 UTC
*** Bug 546449 has been marked as a duplicate of this bug. ***
Comment 9 Milan Crha 2008-08-07 13:40:31 UTC
*** Bug 542917 has been marked as a duplicate of this bug. ***
Comment 10 André Klapper 2008-08-08 08:21:31 UTC
*** Bug 546741 has been marked as a duplicate of this bug. ***
Comment 11 Akhil Laddha 2008-08-12 03:49:55 UTC
*** Bug 547286 has been marked as a duplicate of this bug. ***
Comment 12 André Klapper 2008-08-12 23:24:22 UTC
lakhil: when triaging please correct the component. thanks.
Comment 13 André Klapper 2008-08-12 23:24:33 UTC
*** Bug 547473 has been marked as a duplicate of this bug. ***
Comment 14 Kandepu Prasad 2008-08-13 11:50:38 UTC
*** Bug 547576 has been marked as a duplicate of this bug. ***
Comment 15 André Klapper 2008-08-18 14:53:14 UTC
*** Bug 548277 has been marked as a duplicate of this bug. ***
Comment 16 André Klapper 2008-08-18 14:53:20 UTC
*** Bug 548242 has been marked as a duplicate of this bug. ***
Comment 17 André Klapper 2008-08-18 14:54:23 UTC
*** Bug 547630 has been marked as a duplicate of this bug. ***
Comment 18 André Klapper 2008-08-20 04:47:54 UTC
*** Bug 548542 has been marked as a duplicate of this bug. ***
Comment 19 Chenthill P 2008-08-22 11:09:15 UTC
Created attachment 117210 [details] [review]
Changed the model code a bit.  Tested it and seems to work fine. Will update the ChangeLog while committing.

mcrha, it would be better if you also test/review this patch.
Comment 20 Milan Crha 2008-08-22 15:35:54 UTC
I guess you should unref all from the 'list' at the end of e_cal_view_objects_modified_cb, shouldn't you?
it can be done with g_(s)list_foreach (list, (GFunc)g_object_unref, NULL);
instead of traversing yourself, as you did in the redo_queries.
That's the other thing, once you use GSList once GList, isn't it a bit confusing?

e-cal-model.c: In function ‘e_cal_view_objects_modified_cb’:
e-cal-model.c:1499: warning: ignoring return value of ‘g_list_prepend’, declared with attribute warn_unused_result
e-week-view.c: In function ‘model_comps_deleted_cb’:
e-week-view.c:407: warning: unused variable ‘i’

I tried with tasks and it doesn't crash, but when deleting, the cursor is positioned always on the first item entered in the model (probably). The intention of patch in mentioned bug #532597 was to keep cursor as close to the deleted position as possible.
Otherwise as I tested this, the patch fixes the issue.

I like that it keeps task at its position when I edit it, or resort to the right position. That's really great, thanks Chen. Just fix those things above and push it to trunk as soon as possible :)
Comment 21 Kandepu Prasad 2008-08-25 03:45:46 UTC
*** Bug 549169 has been marked as a duplicate of this bug. ***
Comment 22 Kandepu Prasad 2008-08-29 06:38:33 UTC
*** Bug 549616 has been marked as a duplicate of this bug. ***
Comment 23 Chenthill P 2008-09-01 10:01:56 UTC
The GList elements would be free'd in ECalView. 

Will use the gslist_foreach. I try to use GSList in the newly written code as there is no need for GList. Since the old code using GList in many ECal* API's it cant be changed completely. 

I tried to change the design of Model here to get this fixed. Not sure about the cursor thingy.

Will change the gslist_foreach thing and commit the patch.
Comment 24 Akhil Laddha 2008-09-05 04:20:12 UTC
*** Bug 550836 has been marked as a duplicate of this bug. ***
Comment 25 Chenthill P 2008-09-08 17:43:44 UTC
patch hsa been committed. 

http://svn.gnome.org/viewvc/evolution?view=revision&revision=36276 
Comment 26 Kandepu Prasad 2008-09-15 09:46:07 UTC
*** Bug 552325 has been marked as a duplicate of this bug. ***
Comment 27 Kandepu Prasad 2008-09-16 05:26:13 UTC
*** Bug 552313 has been marked as a duplicate of this bug. ***
Comment 28 Kandepu Prasad 2008-09-18 03:45:59 UTC
*** Bug 552693 has been marked as a duplicate of this bug. ***
Comment 29 Kandepu Prasad 2008-09-19 10:37:48 UTC
*** Bug 552787 has been marked as a duplicate of this bug. ***
Comment 30 Susana 2008-09-20 11:22:27 UTC
*** Bug 552962 has been marked as a duplicate of this bug. ***
Comment 31 André Klapper 2008-09-21 22:15:42 UTC
*** Bug 553026 has been marked as a duplicate of this bug. ***
Comment 32 Philip Withnall 2008-09-22 20:58:56 UTC
*** Bug 553310 has been marked as a duplicate of this bug. ***
Comment 33 André Klapper 2008-09-30 15:54:35 UTC
*** Bug 554436 has been marked as a duplicate of this bug. ***
Comment 34 André Klapper 2008-09-30 15:54:39 UTC
*** Bug 554439 has been marked as a duplicate of this bug. ***
Comment 35 Bharath Acharya 2008-10-02 17:01:54 UTC
*** Bug 554719 has been marked as a duplicate of this bug. ***
Comment 36 Bharath Acharya 2008-10-02 17:02:34 UTC
*** Bug 554717 has been marked as a duplicate of this bug. ***
Comment 37 Akhil Laddha 2008-10-03 05:03:47 UTC
*** Bug 554751 has been marked as a duplicate of this bug. ***
Comment 38 André Klapper 2008-10-13 15:59:51 UTC
*** Bug 556106 has been marked as a duplicate of this bug. ***
Comment 39 André Klapper 2008-10-19 17:01:19 UTC
*** Bug 555822 has been marked as a duplicate of this bug. ***
Comment 40 Kandepu Prasad 2008-10-19 18:09:25 UTC
*** Bug 556880 has been marked as a duplicate of this bug. ***
Comment 41 Matt McCutchen 2008-10-20 04:40:28 UTC
(Coming from bug 556880...)

Indeed, this is fixed in Evolution 2.24, but I can't use Evolution 2.24 because it breaks the "Include threads" setting of search folders.  Thus, I built a custom version of Evolution 2.22.3.1 with just the patch for this bug in the form of RPMs for Fedora 9.  I have posted the RPMs at http://mattmccutchen.net/rpm/ for the benefit of anyone else in the same situation.
Comment 42 Matt McCutchen 2008-10-22 02:01:27 UTC
Never mind my RPMs, they are broken: duplicate copies of calendar events appear.
Comment 43 Kandepu Prasad 2008-10-31 20:14:57 UTC
*** Bug 558682 has been marked as a duplicate of this bug. ***
Comment 44 Kandepu Prasad 2008-10-31 20:15:37 UTC
*** Bug 558698 has been marked as a duplicate of this bug. ***
Comment 45 Kandepu Prasad 2008-10-31 20:15:59 UTC
*** Bug 558707 has been marked as a duplicate of this bug. ***
Comment 46 Kandepu Prasad 2008-10-31 20:16:31 UTC
*** Bug 558708 has been marked as a duplicate of this bug. ***
Comment 47 Kandepu Prasad 2008-11-04 11:43:07 UTC
*** Bug 559234 has been marked as a duplicate of this bug. ***
Comment 48 André Klapper 2008-11-10 13:55:31 UTC
*** Bug 560129 has been marked as a duplicate of this bug. ***
Comment 49 André Klapper 2008-11-19 18:47:56 UTC
*** Bug 561552 has been marked as a duplicate of this bug. ***
Comment 50 André Klapper 2008-11-19 18:51:20 UTC
*** Bug 561517 has been marked as a duplicate of this bug. ***
Comment 51 André Klapper 2008-11-21 15:10:26 UTC
*** Bug 561814 has been marked as a duplicate of this bug. ***
Comment 52 Akhil Laddha 2008-11-24 03:30:55 UTC
*** Bug 562021 has been marked as a duplicate of this bug. ***
Comment 53 palfrey 2008-11-29 12:03:37 UTC
*** Bug 562599 has been marked as a duplicate of this bug. ***
Comment 54 Bruno Boaventura 2008-12-11 21:07:23 UTC
*** Bug 564088 has been marked as a duplicate of this bug. ***
Comment 55 Milan Crha 2008-12-16 12:12:09 UTC
*** Bug 561551 has been marked as a duplicate of this bug. ***
Comment 56 André Klapper 2009-02-09 18:04:21 UTC
*** Bug 571055 has been marked as a duplicate of this bug. ***
Comment 57 André Klapper 2009-03-05 09:05:06 UTC
*** Bug 574219 has been marked as a duplicate of this bug. ***
Comment 58 Fabio Durán Verdugo 2009-03-27 20:08:31 UTC
*** Bug 576996 has been marked as a duplicate of this bug. ***
Comment 59 André Klapper 2009-05-12 09:21:58 UTC
*** Bug 582289 has been marked as a duplicate of this bug. ***
Comment 60 Akhil Laddha 2009-10-12 04:09:33 UTC
bug 598037 against 2.28.x  with similar traces
Comment 61 Akhil Laddha 2010-01-08 11:00:08 UTC
*** Bug 567959 has been marked as a duplicate of this bug. ***
Comment 62 Thomas 2010-01-22 23:34:15 UTC
Just had another one of those crashes with 
(evolution:6585): calendar-gui-CRITICAL **: ecmt_value_at: assertion `row >= 0 && row < e_table_model_row_count (etm)' failed

total_rows is 0 in evolution/widgets/table/e-table-sorting-utils.c
Comment 63 Thomas 2010-01-22 23:40:24 UTC
Created attachment 152053 [details] [review]
Check if total_rows > 0
Comment 64 Thomas 2010-03-26 22:25:56 UTC
Created attachment 157230 [details] [review]
More careful approach, just check for non-NULL-ness of closure.vals before accessing it!
Comment 65 Thomas 2010-03-27 00:46:38 UTC
Created attachment 157236 [details] [review]
Even better. Check that the index is within range!!
Comment 66 Thomas 2010-03-27 02:09:35 UTC
Created attachment 157239 [details] [review]
e_table_sorting_utils_sort patch

Now got crashes. So why not extend the ETableSortClosure struct to contain
the maximal number of vals, so that user of the struct can check ranges.
Comment 67 Akhil Laddha 2010-03-29 04:18:43 UTC
may be we can take this patch under bug 598037 so that we don't have to reopen  bug 544187
Comment 68 Akhil Laddha 2010-12-28 07:01:20 UTC
*** Bug 557703 has been marked as a duplicate of this bug. ***