Bug 72956 - Crash when mounting ISO image
Summary: Crash when mounting ISO image
Status: RESOLVED FIXED
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-21 19:42 UTC by Milan Bouchet-Valat
Modified: 2014-01-14 08:21 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (522 bytes, patch)
2014-01-10 17:40 UTC, Tomas Bzatek
Details | Splinter Review

Description Milan Bouchet-Valat 2013-12-21 19:42:04 UTC
In Fedora 20 when trying to mount an archive using the Archive Mounter, several users reported a crash. I get it 100% of times when trying to mount a LiveCD of F20 Alpha.

udisks2-2.1.1-1.fc20

https://bugzilla.redhat.com/show_bug.cgi?id=1007223

Thread 1 (Thread 0x7fdc82480700 (LWP 5888)):
#0  0x00007fdc84fbb6ff in g_dbus_object_get_interface (object=0x0, interface_name=0x7fdc85296ab1 "org.freedesktop.UDisks2.Block") at gdbusobject.c:144
        iface = <optimized out>
        __PRETTY_FUNCTION__ = "g_dbus_object_get_interface"
#1  0x00007fdc8528f2b3 in udisks_object_peek_block (object=0x0) at udisks-generated.c:31007
        ret = <optimized out>
#2  0x00007fdc86358e37 in wait_for_loop_object (daemon=0x7fdc879cd640, user_data=0x7fdc8247d500) at udiskslinuxmanager.c:233
        ret = 0x0
        object = 0x0
        block = <optimized out>
        loop = <optimized out>
        device = 0x0
        dir = <optimized out>
#3  0x00007fdc8633ba3f in udisks_daemon_wait_for_object_sync (daemon=0x7fdc879cd640, wait_func=wait_func@entry=0x7fdc86358df0 <wait_for_loop_object>, user_data=user_data@entry=0x7fdc8247d500, user_data_free_func=user_data_free_func@entry=0x0, timeout_seconds=timeout_seconds@entry=10, error=error@entry=0x7fdc8247d4e8) at udisksdaemon.c:884
        ret = <optimized out>
        data = {context = 0x0, loop = 0x0, timed_out = 0}
        __PRETTY_FUNCTION__ = "udisks_daemon_wait_for_object_sync"
#4  0x00007fdc8635a002 in handle_loop_setup (object=0x7fdc74005ea0, invocation=0x7fdc7400ae70, fd_list=<optimized out>, fd_index=<optimized out>, options=<optimized out>) at udiskslinuxmanager.c:450
        manager = 0x7fdc74005ea0
        error = 0x0
        fd_num = <optimized out>
        fd = 15
        proc_path = "/proc/1552/fd/15\000\000\000\000\000\000\000\000\002", '\000' <repeats 31 times>, "\002\000\000\000\000\000\000"
        path = "/home/rizvan/Downloads/Fedora-20-Nightly-x86_64-Live-desktop-20130828.08-1.iso", '\000' <repeats 674 times>...
        loop_fd = 17
        loop_control_fd = <optimized out>
        allocated_loop_number = <optimized out>
        loop_device = 0x7fdc7401c130 "/dev/loop0"
        li64 = {lo_device = 0, lo_inode = 0, lo_rdevice = 0, lo_offset = 0, lo_sizelimit = 0, lo_number = 0, lo_encrypt_type = 0, lo_encrypt_key_size = 0, lo_flags = 9, lo_file_name = "/home/rizvan/Downloads/Fedora-20-Nightly-x86_64-Live-desktop-20", lo_crypt_name = '\000' <repeats 63 times>, lo_encrypt_key = '\000' <repeats 31 times>, lo_init = {0, 0}}
        loop_object = 0x0
        option_read_only = 1
        option_no_part_scan = 0
        option_offset = 0
        option_size = 0
        caller_uid = 1000
        fd_statbuf = {st_dev = 64773, st_ino = 262980, st_nlink = 1, st_mode = 33184, st_uid = 1000, st_gid = 1000, __pad0 = 0, st_rdev = 0, st_size = 1044381696, st_blksize = 4096, st_blocks = 2039816, st_atim = {tv_sec = 1377762146, tv_nsec = 3029282}, st_mtim = {tv_sec = 1377762075, tv_nsec = 203231809}, st_ctim = {tv_sec = 1377762096, tv_nsec = 131876774}, __unused = {0, 0, 0}}
        fd_statbuf_valid = <optimized out>
        wait_data = {loop_device = 0x7fdc7401c130 "/dev/loop0", path = 0x7fdc8247d6d0 "/home/rizvan/Downloads/Fedora-20-Nightly-x86_64-Live-desktop-20130828.08-1.iso"}
        __FUNCTION__ = "handle_loop_setup"
#5  0x00007fdc8331dd8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
No locals.
#6  0x00007fdc8331d6bc in ffi_call (cif=cif@entry=0x7fdc8247f940, fn=0x7fdc86359b80 <handle_loop_setup>, rvalue=0x7fdc8247f8b0, avalue=avalue@entry=0x7fdc8247f830) at ../src/x86/ffi64.c:522
        classes = {X86_64_INTEGER_CLASS, 32732, 2185754944, 32732}
        stack = 0x7fdc8247f670 "\240^"
        argp = 0x7fdc8247f720 "\n"
        arg_types = <optimized out>
        gprcount = 6
        ssecount = <optimized out>
        ngpr = 1
        nsse = 0
        i = <optimized out>
        avn = <optimized out>
        ret_in_memory = <optimized out>
        reg_args = 0x7fdc8247f670
#7  0x00007fdc84c99c48 in g_cclosure_marshal_generic (closure=0x7fdc879e09e0, return_gvalue=0x7fdc8247faa0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x7fdc86359b80 <handle_loop_setup>) at gclosure.c:1454
        rtype = <optimized out>
        rvalue = 0x7fdc8247f8b0
        n_args = 6
        atypes = <optimized out>
        i = <optimized out>
        cif = {abi = FFI_UNIX64, nargs = 6, arg_types = 0x7fdc8247f870, rtype = 0x7fdc8331e0c0 <ffi_type_sint32>, bytes = 0, flags = 10}
        cc = 0x7fdc879e09e0
        enum_tmpval = <optimized out>
        tmpval_used = 0
#8  0x00007fdc84c99408 in g_closure_invoke (closure=closure@entry=0x7fdc879e09e0, return_value=return_value@entry=0x7fdc8247faa0, n_param_values=5, param_values=param_values@entry=0x7fdc74011b30, invocation_hint=invocation_hint@entry=0x7fdc8247faf0) at gclosure.c:777
        marshal = 0x7fdc84c97d70 <g_type_iface_meta_marshal>
        marshal_data = 0x10
        in_marshal = 0
        real_closure = 0x7fdc879e09c0
        __PRETTY_FUNCTION__ = "g_closure_invoke"
#9  0x00007fdc84cabd6b in signal_emit_unlocked_R (node=node@entry=0x7fdc879f0cf0, detail=detail@entry=0, instance=instance@entry=0x7fdc74005ea0, emission_return=emission_return@entry=0x7fdc8247fc50, instance_and_params=instance_and_params@entry=0x7fdc74011b30) at gsignal.c:3624
        accumulator = 0x7fdc879f0d90
        emission = {next = 0x0, instance = 0x7fdc74005ea0, ihint = {signal_id = 24, detail = 0, run_type = G_SIGNAL_RUN_LAST}, state = EMISSION_RUN, chain_type = 140585144887680}
        handler_list = 0x0
        return_accu = 0x7fdc8247faa0
        accu = {g_type = 20, data = {{v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
        signal_id = 24
        max_sequential_handler_number = 103
        return_value_altered = 0
#10 0x00007fdc84cb3147 in g_signal_emitv (instance_and_params=instance_and_params@entry=0x7fdc74011b30, signal_id=signal_id@entry=24, detail=detail@entry=0, return_value=return_value@entry=0x7fdc8247fc50) at gsignal.c:3063
        instance = 0x7fdc74005ea0
        node = 0x7fdc879f0cf0
        param_values = 0x7fdc74011b48
        i = <optimized out>
        __PRETTY_FUNCTION__ = "g_signal_emitv"
#11 0x00007fdc8526f861 in _udisks_manager_skeleton_handle_method_call (connection=<optimized out>, sender=sender@entry=0x7fdc78002d40 ":1.125", object_path=object_path@entry=0x7fdc78002f10 "/org/freedesktop/UDisks2/Manager", interface_name=interface_name@entry=0x7fdc780054a0 "org.freedesktop.UDisks2.Manager", method_name=method_name@entry=0x7fdc78004d40 "LoopSetup", parameters=parameters@entry=0x7fdc87a8e920, invocation=invocation@entry=0x7fdc7400ae70, user_data=user_data@entry=0x7fdc74005ea0) at udisks-generated.c:1305
        skeleton = <optimized out>
        info = 0x7fdc854b3f80 <_udisks_manager_method_info_loop_setup>
        iter = {x = {140585145526560, 2, 2, 0, 2032, 140584815734384, 140585055288692, 3579507750, 0, 140585094511491, 140584815691968, 140585094053223, 27, 140585088326346, 2032, 140584815691968}}
        child = 0x0
        paramv = 0x7fdc74011b30
        num_params = <optimized out>
        num_extra = <optimized out>
        n = <optimized out>
        signal_id = 24
        return_value = {g_type = 20, data = {{v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
        __FUNCTION__ = "_udisks_manager_skeleton_handle_method_call"
#12 0x00007fdc84fba1d0 in dispatch_in_thread_func (task=<optimized out>, source_object=<optimized out>, task_data=<optimized out>, cancellable=<optimized out>) at gdbusinterfaceskeleton.c:536
        run_in_thread = <optimized out>
        data = <optimized out>
        flags = <optimized out>
        object = 0x7fdc879d4470
        authorized = 1
#13 0x00007fdc84f5b415 in g_task_thread_pool_thread (thread_data=0x7fdc87ab9100, pool_data=<optimized out>) at gtask.c:1245
        task = 0x7fdc87ab9100
#14 0x00007fdc849cc5f6 in g_thread_pool_thread_proxy (data=<optimized out>) at gthreadpool.c:309
        task = 0x7fdc87ab9100
        pool = 0x7fdc879dacc0
#15 0x00007fdc849cbc35 in g_thread_proxy (data=0x7fdc879f9720) at gthread.c:798
        thread = 0x7fdc879f9720
#16 0x00007fdc84747f33 in start_thread (arg=0x7fdc82480700) at pthread_create.c:309
        __res = <optimized out>
        pd = 0x7fdc82480700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140585055291136, 3908043725653368695, 0, 0, 140585055291840, 140585055291136, -3925681335267270793, -3925694147126009993}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
#17 0x00007fdc84475ddd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Comment 1 Jalal Ahmed 2014-01-02 06:52:04 UTC
Same issue here, I can mount the iso image files by using 
mount -t iso9660 -o loop /path/image.iso /mnt/iso

But the problem when I try to mount the ISO files from GUI, I tried it with 'dolphin' and 'thunar', the same issue, it tells that:

Error attaching disk image: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) (g-dbus-error-quark, 4)

And:

Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
QDBusConnection: name 'org.freedesktop.UDisks2' had owner '' but we thought it was ':1.306'

I use Fedora 20 as well.
Comment 2 Jalal Ahmed 2014-01-03 06:14:24 UTC
Similar issue with Debian sid.
Comment 3 Bastien Nocera 2014-01-10 13:21:04 UTC
I think it might be a race, as wait_for_loop_object() will try and get an object that doesn't exist yet.

udisks_daemon_find_block_by_device_file() fails and returns NULL.

Starting "Disks" after trying to mount it will work (whatever you tried to mount is now mounted), likely because the system has settled and the device is finally mounted.
Comment 4 Tomas Bzatek 2014-01-10 17:40:46 UTC
Created attachment 91828 [details] [review]
proposed patch

From a quick look, would this simple test fix the issue?

If for some reason we're unable to get a UDisksObject instance, just bail out and let udisks_daemon_wait_for_object_sync() continue with the loop and call the wait_func again after a short break. Hopefully the object we're looking for will arrive until then.
Comment 5 Igor Gnatenko 2014-01-10 17:53:56 UTC
Comment on attachment 91828 [details] [review]
proposed patch

Review of attachment 91828 [details] [review]:
-----------------------------------------------------------------

I've tested this patch and it fixes bug.
Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Comment 6 David Zeuthen (not reading bugmail) 2014-01-10 18:39:31 UTC
Comment on attachment 91828 [details] [review]
proposed patch

Review of attachment 91828 [details] [review]:
-----------------------------------------------------------------

Yeah, looks good to me - thanks! Please commit it to master.
Comment 7 Milan Bouchet-Valat 2014-01-10 19:41:23 UTC
...and please prepare us a backport at some point. ;-)
Comment 8 Jalal Ahmed 2014-01-11 14:56:46 UTC
Comment on attachment 91828 [details] [review]
proposed patch

Where should I copy this patch? and how?
Comment 9 Martin Pitt 2014-01-14 08:21:07 UTC
Looks good to me, I committed Tomas' patch to http://cgit.freedesktop.org/udisks/commit/?id=f6bce1 . Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.