I've been stress testing libgphoto2, libgphoto2-sharp and banshee in preparation for making banshees MTP support official. I've noticed that during the 'loading' phase (where i recursively get the metadata of every file in every folder), libgphoto2 freezes for a second at about 6%. If i pull out the USB cable at that stage, i get this stacktrace:
Stacktrace:
at (wrapper managed-to-native) LibGPhoto2.Camera.gp_camera_file_get (System.Runtime.InteropServices.HandleRef,string,string,LibGPhoto2.CameraFileType,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef) <0x00004>
at (wrapper managed-to-native) LibGPhoto2.Camera.gp_camera_file_get (System.Runtime.InteropServices.HandleRef,string,string,LibGPhoto2.CameraFileType,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef) <0xffffffff>
at LibGPhoto2.Camera.GetFile (string,string,LibGPhoto2.CameraFileType,LibGPhoto2.Context) <0x00097>
at Gphoto2.File.Create (Gphoto2.Camera,Gphoto2.FileSystem,string,string) <0x000b2>
at Gphoto2.FileSystem.GetFileInternal (string,string) <0x00016>
at Gphoto2.FileSystem.GetFiles (string) <0x000e9>
at Banshee.Dap.Mtp.MtpDap.LoadFiles (Banshee.Widgets.ActiveUserEvent,int,Gphoto2.FileSystem,string,System.Collections.Generic.List`1) <0x0003f>
at Banshee.Dap.Mtp.MtpDap.LoadFiles (Banshee.Widgets.ActiveUserEvent,int,Gphoto2.FileSystem,string,System.Collections.Generic.List`1) <0x0011a>
at Banshee.Dap.Mtp.MtpDap.LoadFiles (Banshee.Widgets.ActiveUserEvent,int,Gphoto2.FileSystem,string,System.Collections.Generic.List`1) <0x0011a>
at Banshee.Dap.Mtp.MtpDap.ReloadDatabase (Banshee.Widgets.ActiveUserEvent) <0x001f1>
at Banshee.Dap.Mtp.MtpDap.InitializeBackgroundThread () <0x00269>
at (wrapper delegate-invoke) System.MulticastDelegate.invoke_void () <0xffffffff>
at (wrapper runtime-invoke) System.Collections.Generic.GenericEqualityComparer`1.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/bin/mono [0x8171e2a]
/usr/bin/mono [0x813c5f2]
[0xffffe440]
[0x44f18180]
[0x44f20a73]
/usr/local/lib/libgphoto2.so.6(gp_filesystem_get_info+0x220) [0x44acc6b0]
/usr/local/lib/libgphoto2.so.6(gp_filesystem_set_file_noop+0x6ef) [0x44acce1f]
/usr/local/lib/libgphoto2.so.6 [0x44acbe76]
/usr/local/lib/libgphoto2.so.6(gp_filesystem_get_file+0x44) [0x44acbfb4]
/usr/local/lib/libgphoto2.so.6(gp_camera_file_get+0x122) [0x44ac23a2]
[0x44f06143]
[0x44f05fd0]
[0x44f04f2b]
[0x44f04e2f]
[0x44f04d92]
[0x44f04b78]
[0x44f04c53]
[0x44f04c53]
[0x44f03a62]
[0x44a70bf2]
[0x43f15f70]
[0x40bc0b21]
/usr/bin/mono(mono_runtime_delegate_invoke+0x34) [0x80cf0a4]
/usr/bin/mono [0x80f184e]
/usr/bin/mono [0x811c432]
/usr/bin/mono [0x812eb15]
/lib/libpthread.so.0 [0x40107192]
/lib/libc.so.6(clone+0x5e) [0x4020202e]
Debug info from gdb:
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0x402728f0 (LWP 18347)]
[New Thread 0x44e2eb90 (LWP 18564)]
[New Thread 0x443d6b90 (LWP 18388)]
[New Thread 0x44740b90 (LWP 18385)]
[New Thread 0x44018b90 (LWP 18381)]
[New Thread 0x40cc1b90 (LWP 18379)]
[New Thread 0x40bb0b90 (LWP 18378)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0x401ad173 in memmove () from /lib/libc.so.6
7 Thread 0x40bb0b90 (LWP 18378) 0xffffe410 in __kernel_vsyscall ()
6 Thread 0x40cc1b90 (LWP 18379) 0xffffe410 in __kernel_vsyscall ()
5 Thread 0x44018b90 (LWP 18381) 0xffffe410 in __kernel_vsyscall ()
4 Thread 0x44740b90 (LWP 18385) 0xffffe410 in __kernel_vsyscall ()
3 Thread 0x443d6b90 (LWP 18388) 0xffffe410 in __kernel_vsyscall ()
2 Thread 0x44e2eb90 (LWP 18564) 0xffffe410 in __kernel_vsyscall ()
1 Thread 0x402728f0 (LWP 18347) 0x401ad173 in memmove () from /lib/libc.so.6
Thread 7 (Thread 0x40bb0b90 (LWP 18378)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x4010e846 in nanosleep () from /lib/libpthread.so.0
#2 0x0811ae64 in ?? ()
#3 0x40bb0398 in ?? ()
#4 0x00000000 in ?? ()
Thread 6 (Thread 0x40cc1b90 (LWP 18379)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x4010b566 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2 0x08110fbf in ?? ()
#3 0x4069d1dc in ?? ()
#4 0x4069d1c4 in ?? ()
#5 0x00200000 in ?? ()
#6 0x40cc11ac in ?? ()
#7 0x00000001 in ?? ()
#8 0x0820557c in ?? ()
#9 0x4069d1dc in ?? ()
#10 0x08203ff4 in ?? ()
#11 0x082072a0 in ?? ()
#12 0x40cc11c0 in ?? ()
#13 0x40cc1208 in ?? ()
#14 0x08203ff4 in ?? ()
#15 0x00000000 in ?? ()
Thread 5 (Thread 0x44018b90 (LWP 18381)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x4010b7ec in pthread_cond_timedwait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
#2 0x08110f7a in ?? ()
#3 0x406a1ad8 in ?? ()
#4 0x406a1ac0 in ?? ()
#5 0x440180bc in ?? ()
#6 0x00000400 in ?? ()
#7 0x00000001 in ?? ()
#8 0x440180bc in ?? ()
#9 0x406a1ad8 in ?? ()
#10 0x08203ff4 in ?? ()
#11 0x00000000 in ?? ()
Thread 4 (Thread 0x44740b90 (LWP 18385)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x401f8817 in poll () from /lib/libc.so.6
#2 0x40071815 in ?? () from /usr/lib/libglib-2.0.so.0
#3 0x0884cd98 in ?? ()
#4 0x00000005 in ?? ()
#5 0xffffffff in ?? ()
#6 0x0884cd98 in ?? ()
#7 0x00000005 in ?? ()
#8 0x400fd300 in ?? () from /usr/lib/libglib-2.0.so.0
#9 0x400fd340 in ?? () from /usr/lib/libglib-2.0.so.0
#10 0x44740324 in ?? ()
#11 0x00000001 in ?? ()
#12 0x00000001 in ?? ()
#13 0x0884ba58 in ?? ()
#14 0x0884cd98 in ?? ()
#15 0x401f87a0 in ?? () from /lib/libc.so.6
#16 0x4010ab70 in ?? () from /lib/libpthread.so.0
#17 0x40109420 in ?? () from /lib/libpthread.so.0
#18 0x40091562 in g_thread_self () from /usr/lib/libglib-2.0.so.0
#19 0x40071bc7 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#20 0x411f0ae0 in ?? () from /usr/lib/libORBit-2.so.0
#21 0x0884b098 in ?? ()
#22 0x400fcff4 in ?? () from /usr/lib/libglib-2.0.so.0
#23 0x447403a8 in ?? ()
#24 0x40091aef in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00000000 in ?? ()
Thread 3 (Thread 0x443d6b90 (LWP 18388)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x4010b7ec in pthread_cond_timedwait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
#2 0x08110f7a in ?? ()
#3 0x406a1994 in ?? ()
#4 0x406a197c in ?? ()
#5 0x443d60b0 in ?? ()
#6 0x00000400 in ?? ()
#7 0x00000001 in ?? ()
#8 0x443d60b0 in ?? ()
#9 0x406a1994 in ?? ()
#10 0x08203ff4 in ?? ()
#11 0x00000000 in ?? ()
Thread 2 (Thread 0x44e2eb90 (LWP 18564)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x401fb591 in select () from /lib/libc.so.6
#2 0x4009fc49 in g_spawn_sync () from /usr/lib/libglib-2.0.so.0
#3 0x400a003c in g_spawn_command_line_sync () from /usr/lib/libglib-2.0.so.0
#4 0x08171edd in ?? ()
#5 0x44e2cf68 in ?? ()
#6 0x44e2cf64 in ?? ()
#7 0x44e2cf60 in ?? ()
#8 0x44e2cf5c in ?? ()
#9 0x00000000 in ?? ()
Thread 1 (Thread 0x402728f0 (LWP 18347)):
#0 0x401ad173 in memmove () from /lib/libc.so.6
#1 0x44ac9339 in delete_folder (fs=0x8ffc060, x=1) at gphoto2-filesys.c:364
#2 0x44ac945a in delete_all_folders (fs=0x8ffc060, folder=0x44ad21f7 "/",
context=<value optimized out>) at gphoto2-filesys.c:411
#3 0x44ac9596 in gp_filesystem_reset (fs=0x8ffc060) at gphoto2-filesys.c:533
#4 0x44ac07ae in gp_camera_exit (camera=0x8f9fe70, context=0x90a98e8)
at gphoto2-camera.c:308
#5 0x44fe37f4 in ?? ()
#6 0x08f9fe70 in ?? ()
#7 0x090a98e8 in ?? ()
#8 0xbfb3e834 in ?? ()
#9 0x090a98e8 in ?? ()
#10 0xbfb3ea40 in ?? ()
#11 0x44fe3160 in ?? ()
#12 0x00000000 in ?? ()
#0 0x401ad173 in memmove () from /lib/libc.so.6
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Logged In: YES
user_id=48092
Originator: NO
the native backtrace and the gdb backtrace do not match up.
the native backtrace has a ..._file_get theme
the gdb backtrace has a gp_camera_exit theme. hmm.