GNOME Bugzilla – Bug 796031
Deadlock with libsoup
Last modified: 2018-05-16 09:33:47 UTC
`flatpak-builder` very often stays stuck while downloading the sources for the modules it has to build. The only way to progress is to kill it with ctrl+c then restart it. Stracing the process gave: ``` $ strace -p 19081 -f strace: Process 19081 attached with 3 threads [pid 19085] futex(0x564702991a90, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> [pid 19083] restart_syscall(<... resuming interrupted restart_syscall ...> <unfinished ...> [pid 19081] futex(0x7fb22cd7af78, FUTEX_WAIT_PRIVATE, 160, NULL ``` With gdb, I got the following backtrace: ```
+ Trace 238610
Thread 3 (Thread 0x7fb215151700 (LWP 19085))
Thread 1 (Thread 0x7fb22e172940 (LWP 19081))
Alex said this would be a glib/libsoup deadlock and asked me to report the issue here. I can reproduce the problem very easily, it generally takes me 2 to 5 attempts before flatpak-builder finally succeeds downloading. This is with: libsoup-2.62.1-1.fc28.x86_64 glib2-2.56.1-1.fc28.x86_64
This is bug #674885, which has been worked around in the case that GDBus initialises types early — but it looks like the case here is that libsoup is initialising types early. For the moment, I suggest flatpak-builder is modified to use the workaround described in https://bugzilla.gnome.org/show_bug.cgi?id=674885#c87. i.e. Add those g_type_ensure() calls early on in main() in flatpak-builder. Eventually, bug #674885 will be fixed properly and the workaround can be removed from flatpak-builder. The workaround will be harmless once bug #674885 is actually fixed properly. *** This bug has been marked as a duplicate of bug 674885 ***