Crash in the Calendar Monitor when rapidly batch-deleting newly created calendars that contain events in them, while run under debugger
This is the successor to #846 (closed) in the sense that it has somewhat similar reproduction steps, however it is a completely different issue, a segmentation fault instead of that infamous failed assertion.
To reproduce, on my desktop machine running on main
:
- Build and launch with GNOME Builder's debugger mode
(the issue surprisingly does not seem to happen as easily without gdb running, on my machine; that might just be "luck") - Create a bunch of new local calendars
(I tend to create 10 to 20 of them just to be sure, but it might not be needed if you're "lucky") - In one or more of those calendars, create some test events (just type in some garbage "blah blah" summary/title for the events) in the month view.
This step is important, as it seems to be required for the crash to easily occur on my machine, deleting empty calendars doesn't seem to trigger it as easily.
Segmentation fault crash backtrace:
Thread 1 "gnome-calendar" received signal SIGSEGV, Segmentation fault.
0x00005555555cbb45 in set_complete (self=0x0, complete=0) at ../src/core/gcal-calendar-monitor.c:1043
1043 if (self->complete == complete)
> bt full
#0 0x00005555555cbb45 in set_complete (self=0x0, complete=0) at ../src/core/gcal-calendar-monitor.c:1043
__func__ = "set_complete"
#1 0x00005555555cc593 in complete_in_idle_cb (user_data=0x7fffb0001bd0) at ../src/core/gcal-calendar-monitor.c:1226
self = 0x0
idle_data = 0x7fffb0001bd0
__func__ = "complete_in_idle_cb"
#2 0x00007ffff711ac97 in g_main_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff711cda7 in g_main_context_iterate_unlocked.isra () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007ffff711d463 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff7300a3d in g_application_run () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6 0x000055555557b8d0 in main (argc=2, argv=0x7fffffffe498) at ../src/main.c:39
app = 0x555555659220
It always happens from thread no1.
The offending code according to that backtrace is the if (self->complete == complete)
in here:
set_complete (GcalCalendarMonitor *self,
gboolean complete)
{
g_assert (GCAL_IS_MAIN_THREAD ());
if (self->complete == complete)
return;
GCAL_TRACE_MSG ("Setting complete to %s", complete ? "TRUE" : "FALSE");
self->complete = complete;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_COMPLETE]);
}