GNOME Bugzilla – Bug 614219
Crashes when switching off libgphoto camera
Last modified: 2011-04-04 12:06:10 UTC
This crash was recently introduced in git head, presumably in the change to handle gvfs mounts/unmounts dynamically. Reproducer: - Start gthumb - Switch on libgphoto camera Volume added: 'Canon Digital Camera' Volume(0): Canon Digital Camera Type: GProxyVolume (GProxyVolumeMonitorGPhoto2) ids: unix-device: '/dev/bus/usb/001/011' activation_root=gphoto2://[usb:001,011]/ themed icons: [camera-photo] can_mount=1 can_eject=0 should_automount=1 Mount added: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GDaemonMount default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] [camera] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount changed: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GDaemonMount default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] [camera] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=1 Mount added: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount changed: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 After that the camera appears in gthumb's side bar. - Switch off camera Volume removed: 'Canon Digital Camera' Volume(0): Canon Digital Camera Type: GProxyVolume (GProxyVolumeMonitorGPhoto2) ids: unix-device: '/dev/bus/usb/001/011' activation_root=gphoto2://[usb:001,011]/ themed icons: [camera-photo] can_mount=1 can_eject=0 should_automount=1 Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount removed: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount changed: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GDaemonMount default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] [camera] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount removed: 'Canon Digital Camera' Mount(0): Canon Digital Camera -> gphoto2://[usb:001,011]/ Type: GDaemonMount default_location=gphoto2://[usb:001,011]/ themed icons: [camera-photo] [camera] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Now gthumb crashes: Program received signal SIGPIPE, Broken pipe. 0x00007ffff3073671 in __libc_writev (fd=27, vector=0x7fffffffce70, count=2) 0 0x00007ffff3073671 in __libc_writev (fd=27, vector=0x7fffffffce70, count=2) at ../sysdeps/unix/sysv/linux/writev.c:56 _a3 = 2 _a1 = 27 resultvar = <value optimized out> _a2 = 140737488342640 oldtype = 0 result = <value optimized out>
+ Trace 221140
Still happens: [Thread 0x7fffea6c4710 (LWP 16912) exited] [New Thread 0x7fffe8820710 (LWP 16928)] [New Thread 0x7fffea6c4710 (LWP 16929)] [New Thread 0x7fffe9c63710 (LWP 16930)] [New Thread 0x7fffe9221710 (LWP 16931)] [New Thread 0x7fffd3fff710 (LWP 16932)] [Thread 0x7fffd3fff710 (LWP 16932) exited] Detaching after fork from child process 16933. [New Thread 0x7fffd3fff710 (LWP 16934)] [Thread 0x7fffea6c4710 (LWP 16929) exited] [Thread 0x7fffe9c63710 (LWP 16930) exited] ** (gthumb:16904): WARNING **: Error stating file '/fileserver/home/mjc/.gvfs/gphoto2 mount on usb%3A001,008': No such file or directory Program received signal SIGPIPE, Broken pipe. 0x0000003ee76d6a37 in writev () from /lib64/libc.so.6
+ Trace 221595
Thread 1 (Thread 0x7ffff7fbe7e0 (LWP 16904))
It is not reproducible every time. There seems to be a timing issue. - Mike
A different backtrace from device unplugging: Program received signal SIGSEGV, Segmentation fault. thumb_loader_ready_cb (tloader=0xe7de60 [GthThumbLoader], error=0x0, data=0xd8e140) at gth-file-list.c:397 397 if (file_list->priv->thumb_fd != NULL) {
+ Trace 221598
Thread 1 (Thread 0x7ffff7fbe7e0 (LWP 17790))
- Mike
"use gth_main_get_all_entry_points to simplify the code...and maybe fix bug 614219" No, still crashes: Program received signal SIGPIPE, Broken pipe. 0x0000003ee76d6a37 in __libc_writev (fd=<value optimized out>, vector=<value optimized out>, count=<value optimized out>) at ../sysdeps/unix/sysv/linux/writev.c:56 56 result = INLINE_SYSCALL (writev, 3, fd, CHECK_N (vector, count), count);
+ Trace 221599
Thread 1 (Thread 0x7ffff7fbe7e0 (LWP 28998))
The "update the entry points in an idle callback" commit seems to have reduced the frequency of crashes, but it hasn't eliminated them: ** (gthumb:11239): WARNING **: Error stating file '/fileserver/home/mjc/.gvfs/gphoto2 mount on usb%3A001,015/DCIM/102_FUJI/DSCF2218.AVI': No such file or directory Program received signal SIGPIPE, Broken pipe. 0x0000003ee76d6a37 in __libc_writev (fd=<value optimized out>, vector=<value optimized out>, count=<value optimized out>) at ../sysdeps/unix/sysv/linux/writev.c:56 56 result = INLINE_SYSCALL (writev, 3, fd, CHECK_N (vector, count), count);
+ Trace 221607
Thread 1 (Thread 0x7ffff7fbe7e0 (LWP 11239))
Still crashes after "update the entry points in an idle callback in gth-browser as well": Program received signal SIGSEGV, Segmentation fault. thumb_loader_ready_cb (tloader=0xd68f20 [GthThumbLoader], error=0x0, data= 0xd509f0) at gth-file-list.c:397 397 if (file_list->priv->thumb_fd != NULL) {
+ Trace 221611
Thread 1 (Thread 0x7ffff7fbd7e0 (LWP 5671))
what are the steps to reproduce the bug?
+ Trace 221612
Thread 1 (Thread 0x7ffff7fbd7e0 (LWP 7191))
It's hard to reproduce now. It's a flaky timing thing. The above backtrace was captured this way: 1. start gthumb. 2. turn on camera. 3. turn off camera just before thumbnails start appearing in the import dialog. 4. crash! Some previous crashes were captured by: 1. start gthumb 2. turn on camera 3. let import dialog thumbnailing finish 4. hit cancel 5. turn off camera 6. crash! However, I was unable to reproduce that crash sequence just now. The recent commits have made things better, but not perfect yet. - Mike
Just to clarify, I just plug and unplug the camera, varying the time it is plugged in from 0 to 10 seconds, and varying the unplugged time similarly. Sometimes I close the import dialog, sometimes I don't. Eventually something crashes. - Mike
After your 5 commits of a few minutes ago, I can sometimes reproduce this crash: 1. start gthumb 2. turn on the camera 3. after the import dialog has been displayed for ~1 second, click cancel. 4. turn the camera off immediately after that. 5. crash
+ Trace 221614
Thread 1 (Thread 0x7ffff7fbd7e0 (LWP 16995))
Finally I managed to reproduce the bug, it should be fixed now.
Yes, it seems to be fixed! Closing bug. Martin, can you test git master (and re-open the bug if it still crashes)? - Mike
Just as a heads-up, I'm not quite dead yet :) I'm just travelling these weeks, and don't actually have my camera with me. But it seems you did an excellent job tracking this down, thanks! I'll report back here in a few weeks, in the unlikely case I still see the crash.
*** Bug 646686 has been marked as a duplicate of this bug. ***