GFileMonitor deadlocks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libxmlb (Ubuntu) |
Fix Released
|
Undecided
|
Iain Lane | ||
Focal |
Fix Released
|
Undecided
|
Iain Lane | ||
Groovy |
Fix Released
|
Undecided
|
Iain Lane |
Bug Description
[ Description ]
https:/
...
(/usr/libexec/
Executing: libxmlb/
Executing: libxmlb/
...
Executing: libxmlb/
Executing: libxmlb/
Executing: libxmlb/
Executing: libxmlb/
Test timed out after 300 seconds
Executing: libxmlb/
FAIL: libxmlb/
SUMMARY: total=1; passed=0; skipped=0; failed=1; user=0.0s; system=0.0s; maxrss=5900
FAIL: libxmlb/
...
The backtrace while the test is hanging looks like:
(gdb) bt
#0 syscall () at ../sysdeps/
#1 0x00007fc9150d57cc in g_mutex_
at ../../.
#2 0x00007fc9150d6256 in g_mutex_lock (mutex=
#3 0x00007fc915309de4 in _ih_sub_cancel (sub=0x55a566f5
#4 0x00007fc91530a06e in g_inotify_
#5 0x00007fc91523680b in g_file_
#6 g_file_
#7 0x00007fc915236890 in g_file_
#8 0x00007fc9152fe8b3 in g_local_
#9 0x00007fc915179c93 in g_object_unref (_object=<optimized out>) at ../../.
#10 g_object_unref (_object=
#11 0x000055a5666dce9d in xb_silo_
#12 0x00007fc915075172 in g_hash_
destruction
#13 0x00007fc915076533 in g_hash_
at ../../.
#14 g_hash_table_unref (hash_table=
#15 0x000055a5666dd445 in xb_silo_finalize (obj=0x55a566f4
#16 0x00007fc915179d0e in g_object_unref (_object=<optimized out>) at ../../.
#17 g_object_unref (_object=
#18 0x000055a5666c4864 in xb_builder_finalize (obj=0x55a566f4
#19 0x00007fc915179d0e in g_object_unref (_object=<optimized out>) at ../../.
#20 g_object_unref (_object=
#21 0x000055a5666db999 in glib_autoptr_
#22 glib_autoptr_
#23 glib_autoptr_
#24 xb_builder_
#25 0x00007fc9150b13ce in test_case_run (tc=0x55a566f43b00) at ../../.
#26 g_test_
#27 0x00007fc9150b1174 in g_test_
at ../../.
#28 0x00007fc9150b18ba in g_test_run_suite (suite=
#29 0x00007fc9150b18d5 in g_test_run () at ../../.
#30 0x000055a5666c38bb in main (argc=<optimized out>, argv=<optimized out>) at ../src/
(gdb)
[ Fix ]
This is a hang when disposing the GFileMonitor.
See https:/
The fix is to explicitly cancel the GFileMonitor when when unreffing it.
[ QA ]
We don't have a testcase for the bug in real usage. It's quite easy to check in autopkgtest though. Check the autopkgtests stop being flaky/racy with the new version.
[ What could go wrong ]
We're cancelling the file monitor explicitly now. Previously this was happening internally. This is a pattern used by other glib-using projects, but if it's bad then it may be that something goes wrong with the file monitor.
[ Other information ]
I'll stage this following https:/
Although this is a bug that could arguably affect users too (the fix is not limited to test code). So it may fix a real hang bug which we just didn't notice - or get reported - yet. I think it *could* be released to users.
description: | updated |
Changed in libxmlb (Ubuntu): | |
assignee: | nobody → Iain Lane (laney) |
Changed in libxmlb (Ubuntu Focal): | |
assignee: | nobody → Iain Lane (laney) |
Changed in libxmlb (Ubuntu Groovy): | |
assignee: | nobody → Iain Lane (laney) |
Changed in libxmlb (Ubuntu): | |
status: | New → In Progress |
Changed in libxmlb (Ubuntu Focal): | |
status: | New → In Progress |
Changed in libxmlb (Ubuntu Groovy): | |
status: | New → In Progress |
tags: | added: block-proposed-focal block-proposed-groovy |
Olivier reported that one upstream but they didn't seem to have a clue about the issue
https:/ /github. com/hughsie/ libxmlb/ issues/ 59