darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.54k stars 1.13k forks source link

Darktable GUI freezes after exporting images #15573

Open tbilles opened 10 months ago

tbilles commented 10 months ago

Describe the bug

My workflow ends with selecting all images from an event (usually 10-30 images), and exporting it to jpeg. When I start exporting I switch away from darktable window and do other stuff while the export is working. After a while, all images are successfully exported, I can see them in the filesystem, but when I switch back to the darktable window, it doesn't redraw itself, the screen content stays whatever was there before. And of course it is not responding to user inputs, I have to kill the process and restart it.

It doesn't happen all the time, but frequently enough to be annoying, about a third or half of my exports die like this. I ran darktable from gdb, and captured a stack trace of the frozen state, attached below. I've been having this issue for weeks now, with multiple versions (I regularly build fresh master from source), and with compeletly different sets of images to export, the stack trace all seemed very similar.

Steps to reproduce

  1. Select images to export
  2. Start exporting
  3. Switch to another window
  4. Wait for the export to finish
  5. Switch back to darktable window

I'm not sure it switching to another window is important or not, I didn't experiment with it.

Expected behavior

darktable should come back and respond to user interaction

Logfile | Screenshot | Screencast

#0  0x00007ffff7518dbf in __GI___poll (fds=0x7fffffffc788, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff457f7e2 in  () at /lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff457feb1 in  () at /lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff4580ea6 in xcb_wait_for_reply64 () at /lib/x86_64-linux-gnu/libxcb.so.1
#4  0x00007ffff4d0b31c in _XReply () at /lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff763d3be in XIQueryPointer () at /lib/x86_64-linux-gnu/libXi.so.6
#6  0x00007ffff735aff9 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#7  0x00007ffff7375829 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#8  0x00007ffff734a7ed in gdk_window_get_device_position_double () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#9  0x00007ffff734a9e1 in gdk_window_get_device_position () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#10 0x00007ffff798cd05 in dt_control_expose (voidptr=voidptr@entry=0x0) at /home/tbilles/sources/darktable/src/control/control.c:399
#11 0x00007ffff7aa4f0f in _draw (da=<optimized out>, cr=0x555557ad4b00, user_data=<optimized out>) at /home/tbilles/sources/darktable/src/gui/gtk.c:686
#12 0x00007ffff6de6eb8 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00007ffff6d900e1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#14 0x00007ffff72cb700 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff72cb863 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x00007ffff6d9fd82 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#18 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#19 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#20 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#21 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff6c08821 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff6b782e1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#24 0x00007ffff6b8c852 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#25 0x00007ffff6c094d5 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#26 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#27 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#28 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007ffff6b22571 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff6b782e1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff6b8c852 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#32 0x00007ffff6b22e15 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#33 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#34 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#35 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007ffff6c08821 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#37 0x00007ffff6b782e1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#38 0x00007ffff6b8c852 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#39 0x00007ffff6c094d5 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#40 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#41 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#42 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#43 0x00007ffff6b22571 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#44 0x00007ffff6b782e1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#45 0x00007ffff6b8c852 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#46 0x00007ffff6b22e15 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#47 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#48 0x00007ffff6b80825 in gtk_container_propagate_draw () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#49 0x00007ffff6b8092d in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#50 0x00007ffff6dc060e in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#51 0x00007ffff6d9fb64 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#52 0x00007ffff6dabdb1 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#53 0x00007ffff6c5254b in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#54 0x00007ffff7332743 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#55 0x00007ffff7345151 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#56 0x00007ffff734a221 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#57 0x00007ffff734a418 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#58 0x00007ffff72cb700 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#59 0x00007ffff72cb863 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#60 0x00007ffff733fc6f in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#61 0x00007ffff732c2ad in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#62 0x00007ffff771c2c8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#63 0x00007ffff771bc44 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#64 0x00007ffff7771258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007ffff771b2b3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#66 0x00007ffff6c48cfd in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#67 0x00007ffff7aa8d9d in dt_gui_gtk_run (gui=<optimized out>) at /home/tbilles/sources/darktable/src/gui/gtk.c:1379
#68 0x00005555555550d6 in main (argc=<optimized out>, argv=<optimized out>) at /home/tbilles/sources/darktable/src/main.c:94

Commit

No response

Where did you install darktable from?

self compiled

darktable version

4.5.0+1075~gf66196c741

What OS are you using?

Linux

What is the version of your OS?

Linux Mint 21.1

Describe your system?

I'm using X11 and libgtk version is 3.24.33-1ubuntu2. Let me know if you need more details.

Are you using OpenCL GPU in darktable?

No

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

TurboGit commented 10 months ago

Looks like it is looked in a Gtk+ call:

#10 0x00007ffff798cd05 in dt_control_expose (voidptr=voidptr@entry=0x0) at /home/tbilles/sources/darktable/src/control/control.c:399

is

  gdk_window_get_device_position(gtk_widget_get_window(widget),
      gdk_seat_get_pointer(gdk_display_get_default_seat(gtk_widget_get_display(widget))),
      &pointerx, &pointery, NULL);
TurboGit commented 10 months ago

Can you try this #15578? TIA. Just a guess as I cannot reproduce...

tbilles commented 10 months ago

Thanks for the patch! I tried it and unfortunately it still freezes at the same stack.

TurboGit commented 10 months ago

Thanks for the patch! I tried it and unfortunately it still freezes at the same stack.

I had no big hope... So looks like a Gtk+ issue to me, not sure we can do something in dt to fix that.

tbilles commented 10 months ago

My only hope is that it wasn't always like this. Either darktable changed or my system did. I wanted to do a bisect but the database version changed and older versions wouldn't run. It just occured to me that maybe a clean install would also reproduce this and I might be able to use a different database, and yes, we have --cachedir, --configdir, --library and such. I will experiment with those and try to bisect it.

TurboGit commented 10 months ago

@tbilles : Thanks, your effort are much appreciated.

github-actions[bot] commented 8 months ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

guigri commented 4 months ago

I have the exact same reproducible problem. DT freezes with every export. But: DT does not freeze if I minimize the DT window during the export. Maybe this information will help with troubleshooting. (Sorry if this is redundant / not new information - at least I can't deduce this from the above speculation about a possible GTK problem, for example).

github-actions[bot] commented 1 month ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.