After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629442 - f-spot crashes when trying to import from a direcotry that contains CRW images
f-spot crashes when trying to import from a direcotry that contains CRW images
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: Import
GIT
Other Linux
: High critical
: 0.8.1
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
Depends on: 622110
Blocks:
 
 
Reported: 2010-09-12 17:41 UTC by Arun Persaud
Modified: 2018-07-01 08:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change CRW loading as suggested by Christian Krause. (833 bytes, patch)
2010-12-19 12:07 UTC, Ruben Vermeersch
committed Details | Review

Description Arun Persaud 2010-09-12 17:41:26 UTC
just tried to import from a directory that contained CRW images (raw images from a canon s40) and f-spot crashed. Removed the CRW images and import worked fine.

Perhaps this is related to: Bug 587824?

version: git d2a931a9ba19a9c07c729e98967d7cce258706ee 
on opensuse 11.3

>uname -a
Linux linux-ipxf 2.6.34.4-0.1-default #1 SMP 2010-08-20 19:21:29 +0200 i686 athlon i386 GNU/Linux

HTH

Arun
Comment 1 Felipe Besoaín Pino 2010-09-13 00:12:33 UTC
Thanks for taking the time to report this bug.
Without a stack trace from the crash it's very hard to determine what caused it.
Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Comment 2 Arun Persaud 2010-09-13 02:43:29 UTC
Hi

installed a bunch of debuginfo packages and run "f-spot --gdb" and then used "thread apply all bt". gdb then seems to hang at Thread 1?! Seems like I'm doing something wrong? Do I need to build f-spot with debug enabled (if so how)? Anyway, here is the output, hope it helps:

Starting program: /usr/bin/mono /usr/local/lib/f-spot/f-spot.exe --gdb
[Thread debugging using libthread_db enabled]
warning: the debug information found in "/usr/lib/debug//lib/libc-2.11.2.so.debug" does not match "/lib/libc.so.6" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/lib/libc-2.11.2.so.debug" does not match "/lib/libc.so.6" (CRC mismatch).

Missing separate debuginfo for /lib/libc.so.6
Try: zypper install -C "debuginfo(build-id)=f71a3d8772eda244959bac3385b43c719b8ca227"
[New Thread 0xb7b6cb70 (LWP 14206)]
[New Thread 0xb6b0eb70 (LWP 14207)]
[New Thread 0xb6ae9b70 (LWP 14208)]
Missing separate debuginfo for /usr/lib/libfreetype.so.6
Try: zypper install -C "debuginfo(build-id)=b03ecf9218ee146f3f20d792ba1aeb11579570a8"
[Info  19:35:12.147] Initializing Mono.Addins
[New Thread 0xad924b70 (LWP 14209)]
[New Thread 0xad74bb70 (LWP 14210)]
[Thread 0xad74bb70 (LWP 14210) exited]
[New Thread 0xabaffb70 (LWP 14211)]
[New Thread 0xab9feb70 (LWP 14212)]
[Thread 0xabaffb70 (LWP 14211) exited]
[New Thread 0xabaffb70 (LWP 14213)]
[New Thread 0xab75eb70 (LWP 14214)]
[New Thread 0xab65db70 (LWP 14215)]
[Thread 0xabaffb70 (LWP 14213) exited]
[New Thread 0xabaffb70 (LWP 14216)]
[Thread 0xab75eb70 (LWP 14214) exited]
[New Thread 0xab75eb70 (LWP 14217)]
Missing separate debuginfo for /usr/lib/gio/modules/libgiofam.so
Try: zypper install -C "debuginfo(build-id)=40b95e5b623deca5896256aeea6dc49d585e7c25"
[New Thread 0xad74bb70 (LWP 14218)]
[New Thread 0xaa5ffb70 (LWP 14219)]
[New Thread 0xa9dfeb70 (LWP 14220)]
[Thread 0xa9dfeb70 (LWP 14220) exited]
[Thread 0xaa5ffb70 (LWP 14219) exited]
[New Thread 0xaa5ffb70 (LWP 14221)]
[New Thread 0xa9dfeb70 (LWP 14222)]
[Thread 0xaa5ffb70 (LWP 14221) exited]
[Thread 0xa9dfeb70 (LWP 14222) exited]
[New Thread 0xa95fdb70 (LWP 14223)]
[New Thread 0xa9dfeb70 (LWP 14224)]
[Thread 0xa95fdb70 (LWP 14223) exited]

Program received signal SIGSEGV, Segmentation fault.
0xab5379f6 in ?? ()
(gdb) thread apply all bt

Thread 13 (Thread 0xab75eb70 (LWP 14217))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S line 122
  • #2 _wapi_handle_timedwait_signal_handle
    at handles.c line 1611
  • #3 _wapi_handle_wait_signal_handle
    at handles.c line 1554
  • #4 WaitForSingleObjectEx
    at wait.c line 205
  • #5 ves_icall_System_Threading_Monitor_Monitor_wait
    at monitor.c line 1342
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 (wrapper runtime-invoke) object:runtime_invoke_void__this__
    at xdb.il line 471
  • #11 mono_jit_runtime_invoke
  • #12 mono_runtime_invoke
  • #13 mono_runtime_delegate_invoke
    at object.c line 3207
  • #14 start_wrapper
    at threads.c line 672
  • #15 thread_start_routine
    at wthreads.c line 286
  • #16 GC_start_routine
    at pthread_support.c line 1390
  • #17 start_thread
    at pthread_create.c line 297
  • #18 clone
    from /lib/libc.so.6

Thread 12 (Thread 0xabaffb70 (LWP 14216))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S line 122
  • #2 _wapi_handle_timedwait_signal_handle
    at handles.c line 1611
  • #3 _wapi_handle_wait_signal_handle
    at handles.c line 1554
  • #4 WaitForSingleObjectEx
    at wait.c line 205
  • #5 async_invoke_thread
    at threadpool.c line 1486
  • #6 start_wrapper
    at threads.c line 666
  • #7 thread_start_routine
    at wthreads.c line 286
  • #8 GC_start_routine
    at pthread_support.c line 1390
  • #9 start_thread
    at pthread_create.c line 297
  • #10 clone
    from /lib/libc.so.6

Thread 11 (Thread 0xab65db70 (LWP 14215))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S line 122
  • #2 _wapi_handle_timedwait_signal_handle
    at handles.c line 1611
  • #3 _wapi_handle_wait_signal_handle
    at handles.c line 1554
  • #4 WaitForSingleObjectEx
    at wait.c line 205
  • #5 async_invoke_thread
    at threadpool.c line 1486
  • #6 start_wrapper
    at threads.c line 666
  • #7 thread_start_routine
    at wthreads.c line 286
  • #8 GC_start_routine
    at pthread_support.c line 1390
  • #9 start_thread
    at pthread_create.c line 297
  • #10 clone
    from /lib/libc.so.6

Thread 8 (Thread 0xab9feb70 (LWP 14212))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S line 122
  • #2 _wapi_handle_timedwait_signal_handle
  • #3 _wapi_handle_wait_signal_handle
    at handles.c line 1554
  • #4 WaitForSingleObjectEx
    at wait.c line 205
  • #5 ves_icall_System_Threading_Monitor_Monitor_wait
    at monitor.c line 1342
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 (wrapper runtime-invoke) object:runtime_invoke_void__this__
    at xdb.il line 471
  • #11 mono_jit_runtime_invoke
  • #12 mono_runtime_invoke
  • #13 mono_runtime_delegate_invoke
    at object.c line 3207
  • #14 start_wrapper
    at threads.c line 672
  • #15 thread_start_routine
    at wthreads.c line 286
  • #16 GC_start_routine
    at pthread_support.c line 1390
  • #17 start_thread
    at pthread_create.c line 297
  • #18 clone
    from /lib/libc.so.6

Thread 5 (Thread 0xad924b70 (LWP 14209))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S line 122
  • #2 _wapi_handle_timedwait_signal_handle
    at handles.c line 1611
  • #3 _wapi_handle_wait_signal_handle
    at handles.c line 1554
  • #4 WaitForSingleObjectEx
    at wait.c line 205
  • #5 ves_icall_System_Threading_WaitHandle_WaitOne_internal
    at threads.c line 1585
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 (wrapper runtime-invoke) object:runtime_invoke_void__this__
    at xdb.il line 471
  • #10 mono_jit_runtime_invoke
  • #11 mono_runtime_invoke
  • #12 mono_runtime_delegate_invoke
    at object.c line 3207
  • #13 start_wrapper
    at threads.c line 672
  • #14 thread_start_routine
    at wthreads.c line 286
  • #15 GC_start_routine
    at pthread_support.c line 1390
  • #16 start_thread
    at pthread_create.c line 297
  • #17 clone
    from /lib/libc.so.6

Thread 1 (Thread 0xb7cc96f0 (LWP 14203)):
Comment 3 Ruben Vermeersch 2010-09-13 08:07:36 UTC
This is because Taglib# currently does not handle CRW files yet. See bug 622110.
Comment 4 Christian Krause 2010-12-18 21:25:10 UTC
(In reply to comment #3)
> This is because Taglib# currently does not handle CRW files yet. See bug
> 622110.

But it still looks like a bug in f-spot if a TagLib# functions throwing an UnsupportedFormatException causes f-spot to crash. ;-)

It seems that the call to TagLib.File.Create in src/Core/FSpot.Utils/FSpot.Utils/Metadata.cs is actually in a try/catch block, but it looks like that it doesn't work...
Comment 5 Christian Krause 2010-12-19 02:06:04 UTC
Ruben, I think I have tracked down at least one issue:

The problem is actually not the exception in TagLib#, but an infinite loop in Ciff.cs:

GdkImageLoader.Load calls: image_file.PixbufStream, in our case CiffFile.PixbufStream

CiffFile.PixbufStream calls CiffFile.GetEmbeddedJpeg
CiffFile.GetEmbeddedJpeg calls Root.ReadEntry which calls the get method of Root

CiffFile.Root.get uses lazy initialisation for the "root" member - if it is still null, then the function calls PixbufStream

PixbufStream calls then again GetEmbeddedJpeg etc. etc.

So finally the program will crash due to a stack overflow cause by the described infinite loop.

Probably something like the following patch can solve the issue:

diff --git a/src/Clients/MainApp/FSpot.Imaging/Ciff.cs b/src/Clients/MainApp/FSpot.Imaging/Ciff.cs
index e5a503d..80b5a35 100644
--- a/src/Clients/MainApp/FSpot.Imaging/Ciff.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/Ciff.cs
@@ -147,7 +147,7 @@ namespace FSpot.Imaging.Ciff {
                ImageDirectory Root {
                        get {
                                if (root == null) {
-                                       stream = PixbufStream ();
+                                       stream = base.PixbufStream ();
                                        root = Load (stream);
                                }



Although the patch fixes a real bug, that's not enough to fix the issue with the crw file since the remaining source of f-spot is not really prepared that "Metadata.Parse()" may return null (which is the case when TagLib# does not recognize the format).
Comment 6 Ruben Vermeersch 2010-12-19 12:07:24 UTC
Created attachment 176699 [details] [review]
Change CRW loading as suggested by Christian Krause.
Comment 7 Ruben Vermeersch 2010-12-19 12:21:14 UTC
Comment on attachment 176699 [details] [review]
Change CRW loading as suggested by Christian Krause.

Attachment 176699 [details] pushed as e1bba71 - Change CRW loading as suggested by Christian Krause.
Comment 8 André Klapper 2018-07-01 08:50:31 UTC
f-spot is not under active development anymore, has not seen code changes for five years, and saw its last tarball release in the year 2010.
Its codebase has been archived: https://gitlab.gnome.org/Archive/f-spot/commits/master

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.