GNOME Bugzilla – Bug 672704
gdu_pool_new() crash in gdu_device_get_object_path() when volume appears and disappears quickly
Last modified: 2012-03-23 16:14:14 UTC
Note, this applies to the old 3.0 branch with libgdu. https://launchpad.net/bugs/916892 reports quite a few crashes that look like this:
+ Trace 229939
Where OnVolumeAdded is a signal handler for GVolumeMonitor's "volume-added" signal. This happens in particular when using usb-creator, a tool to write iso images to USB sticks. This sets up a loop device. As the loop device is mounted to /tmp/..., what happens is that there is no GVolume during the time it's mounted, as we hide stuff that's not in /media/ by default. On unmounting, the GVolume appears quickly, triggering a volume-added signal. But it disappears immediately again as the underlying loop device is cleaned up. So while the volume-added signal handler is running, it gets to this code: device = _gdu_device_new_from_object_path (pool, object_path); g_hash_table_insert (pool->priv->object_path_to_device, (gpointer) gdu_device_get_object_path (device), device); I suppose at that time the underlying loop device is already history, and thus _gdu_device_new_from_object_path() returns NULL, as the stack trace shows.
Created attachment 210440 [details] reproducer This is a simple reproducer which just listens to volume-added and calls gdu_pool_new(). gcc -o /tmp/gdu_pool_crash gdu_pool_crash.c -Wall -g -O0 `pkg-config --cflags --libs glib-2.0 gio-2.0 gdu` && gdb /tmp/gdu_pool_crash then run sudo mkdir /tmp/d while true; do sudo mount -o loop some_cd_image.iso /tmp/d; sudo umount /tmp/d; done This reproduces the crash eventually.
Actually, this is a dupe of bug 591660. At first I only looked at the trace in that bug, which is too bad to say whether it's that bug or a different one. But some of its dupes have much better ones which match this. *** This bug has been marked as a duplicate of bug 640049 ***
*** This bug has been marked as a duplicate of bug 591660 ***