Bug #11814

reproducible crash in gtk_widget_destroy when change the image by filmstrip in darkroom mode

Added by Serge Gavrilov over 2 years ago. Updated over 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected Version:
other GNU/Linux
hardware architecture:


Very easy reproducible crash for me:

1) Go to darkroom mode
2) Try to change the active image by double click upon filmstrip

After 1-2 attempts I have

Thread 1 "darktable" received signal SIGSEGV, Segmentation fault.
0x00007ffff68143a6 in gtk_widget_destroy () from /usr/lib64/
(gdb) bt
#0 0x00007ffff68143a6 in gtk_widget_destroy () from /usr/lib64/
#1 0x00007fff8fbe3953 in dt_dev_change_image.part () from /usr/lib64/darktable/views/
#2 0x00007fff8fbe3adf in view_darkroom_filmstrip_activate_callback () from /usr/lib64/darktable/views/
#3 0x00007ffff52480b5 in g_closure_invoke (closure=0xc7bdd0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0xc80e80, invocation_hint=invocation_hint@entry=0x7fffffffc510) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gclosure.c:804
#4 0x00007ffff525aba1 in signal_emit_unlocked_R (node=node@entry=0x882910, detail=detail@entry=0, instance=instance@entry=0x77d700, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0xc80e80) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gsignal.c:3635
#5 0x00007ffff5262af7 in g_signal_emitv (instance_and_params=0xc80e80, signal_id=<optimized out>, detail=0, return_value=0x0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gsignal.c:3129
#6 0x00007ffff7a5030a in _signal_raise () from /usr/bin/../lib64/darktable/
#7 0x00007ffff6df3635 in g_main_context_invoke_full (context=0x674480, priority=0, function=0x7ffff7a502f0 <_signal_raise>, data=0x2d04ee0, notify=0x0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:5783
#8 0x00007ffff7a50851 in dt_control_signal_raise () from /usr/bin/../lib64/darktable/
#9 0x00007fff45e43672 in _lib_filmstrip_button_press_callback () from /usr/lib64/darktable/plugins/lighttable/
#10 0x00007ffff66c6f1c in _gtk_marshal_BOOLEAN
_BOXED () from /usr/lib64/
#11 0x00007ffff52480b5 in g_closure_invoke (closure=0x28f8130, return_value=return_value@entry=0x7fffffffc930, n_param_values=2, param_values=param_values@entry=0x7fffffffc9a0, invocation_hint=invocation_hint@entry=0x7fffffffc910) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gclosure.c:804
#12 0x00007ffff525aba1 in signal_emit_unlocked_R (node=node@entry=0x709cd0, detail=detail@entry=0, instance=instance@entry=0x28b2e20, emission_return=emission_return@entry=0x7fffffffcab0, instance_and_params=instance_and_params@entry=0x7fffffffc9a0)
at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gsignal.c:3635
#13 0x00007ffff52636c9 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffcb60) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gsignal.c:3401
#14 0x00007ffff5263f67 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gobject/gsignal.c:3447
#15 0x00007ffff68139dc in gtk_widget_event_internal () from /usr/lib64/
#16 0x00007ffff66c3fae in propagate_event () from /usr/lib64/
#17 0x00007ffff66c5fff in gtk_main_do_event () from /usr/lib64/
#18 0x00007ffff620a7f5 in _gdk_event_emit () from /usr/lib64/
#19 0x00007ffff623b9c2 in gdk_event_source_dispatch () from /usr/lib64/
#20 0x00007ffff6df2707 in g_main_dispatch (context=0x674480) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3234
#21 g_main_context_dispatch (context=context@entry=0x674480) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3899
#22 0x00007ffff6df2960 in g_main_context_iterate (context=0x674480, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3972
#23 0x00007ffff6df2c82 in g_main_loop_run (loop=0x2baeae0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:4168
#24 0x00007ffff66c5255 in gtk_main () from /usr/lib64/
#25 0x00007ffff7ac757c in dt_gui_gtk_run () from /usr/bin/../lib64/darktable/
#26 0x0000000000400750 in main ()

The system is Gentoo ~amd64 (72 KB) output of thread apply all bt full Serge Gavrilov, 11/09/2017 11:59 AM

Associated revisions

Revision cd4bd1bc (diff)
Added by Tobias Ellinghaus over 2 years ago

Fix #11814: Don't destroy widgets twice

module->widget is a child of module->expander. When removing the latter
from the gui GTK automatically destroys it and all its children. Since
we don't g_object_ref() the expander we don't intend to keep it around
anyway, so just destroying that parent simplifies the code and gets rid
of the bug.


#1 Updated by Serge Gavrilov over 2 years ago

gtk+ is 3.22.19

#2 Updated by Tobias Ellinghaus over 2 years ago

  • % Done changed from 0 to 20
  • Status changed from New to Incomplete


  • compile darktable with debug symbols
  • show the output of thread apply all bt full

#3 Updated by Serge Gavrilov over 2 years ago

#4 Updated by Tobias Ellinghaus over 2 years ago

  • % Done changed from 20 to 100
  • Target version set to 2.4.0
  • Status changed from Incomplete to Fixed
  • Category changed from General to Darkroom

Thanks, I think I fixed it. At first I couldn't reproduce as it only happens when the image you leave has multiple instances of some module. And even then I only saw GTK errors printed but no crash.

#5 Updated by Serge Gavrilov over 2 years ago

Many thanks for the fast response, it really seems the bug to be fixed.

Also available in: Atom PDF

Go to top