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 739396 - shotwell-video-thumbnailer segfaults on a H.264 video
shotwell-video-thumbnailer segfaults on a H.264 video
Status: RESOLVED OBSOLETE
Product: shotwell
Classification: Other
Component: video
0.20.x
Other Linux
: Normal major
: 0.26
Assigned To: Shotwell Maintainers
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-30 12:18 UTC by Felipe Lessa
Modified: 2016-12-09 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felipe Lessa 2014-10-30 12:18:39 UTC
I've noticed that my computer was using all of its resources while shotwell was open.  It turns out that I had a bunch of systemd coredump processes madly saving core dumps.

The video in question is straight out of a camera:

$ ffprobe /home/felipe/Imagens/2014/10/00002.MTS
ffprobe version 2.4.2 Copyright (c) 2007-2014 the FFmpeg developers
  built on Oct 15 2014 10:59:16 with gcc 4.9.1 (GCC) 20140903 (prerelease)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-vdpau --enable-version3 --enable-x11grab
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, mpegts, from '/home/felipe/Imagens/2014/10/00002.MTS':
  Duration: 00:00:15.04, start: 0.757467, bitrate: 27925 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) (HDPR / 0x52504448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080

I can provide a copy of it in private if needed.

Some relevant versions:

$ yaourt -Q gst-libav gdk-pixbuf2 shotwell
extra/gst-libav 1.4.3-1
extra/gdk-pixbuf2 2.31.1-1
community/shotwell 1:0.20.1-2

Here's the full backtrace:

$ gdb /usr/lib/shotwell/shotwell-video-thumbnailer 
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/shotwell/shotwell-video-thumbnailer...done.
(gdb) run /home/felipe/Imagens/2014/10/00002.MTS
Starting program: /usr/lib/shotwell/shotwell-video-thumbnailer /home/felipe/Imagens/2014/10/00002.MTS
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea8d6700 (LWP 24416)]
[New Thread 0x7fffe9832700 (LWP 24417)]
[New Thread 0x7fffe9031700 (LWP 24418)]
[New Thread 0x7fffdbfff700 (LWP 24419)]
[New Thread 0x7fffda5c3700 (LWP 24420)]
[New Thread 0x7fffd9dc2700 (LWP 24421)]
[New Thread 0x7fffd95c1700 (LWP 24422)]
[New Thread 0x7fffd8dc0700 (LWP 24423)]
[New Thread 0x7fffd3fff700 (LWP 24424)]
[New Thread 0x7fffd37fe700 (LWP 24425)]
No accelerated IMDCT transform found

Program received signal SIGSEGV, Segmentation fault.
__memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:36
36	../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Arquivo ou diretório não encontrado.
(gdb) thread apply all backtrace full

Thread 5 (Thread 0x7fffdbfff700 (LWP 24419))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1390
  • #2 gst_multi_queue_loop
    at gstmultiqueue.c line 1394
  • #3 gst_task_func
    at gsttask.c line 317
  • #4 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #5 g_thread_proxy
    at gthread.c line 764
  • #6 start_thread
    at pthread_create.c line 310
  • #7 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 4 (Thread 0x7fffe9031700 (LWP 24418))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1390
  • #2 gst_base_sink_wait_preroll
    at gstbasesink.c line 2151
  • #3 gst_base_sink_do_preroll
    at gstbasesink.c line 2241
  • #4 gst_base_sink_do_sync
    at gstbasesink.c line 2443
  • #5 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3385
  • #6 gst_base_sink_chain_main
    at gstbasesink.c line 3533
  • #7 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #8 gst_pad_push_data
    at gstpad.c line 4069
  • #9 gst_base_transform_chain
    at gstbasetransform.c line 2260
  • #10 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #11 gst_pad_push_data
    at gstpad.c line 4069
  • #12 gst_base_transform_chain
    at gstbasetransform.c line 2260
  • #13 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #14 gst_pad_push_data
    at gstpad.c line 4069
  • #15 gst_pad_push
    at gstpad.c line 4180
  • #16 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #17 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #18 gst_pad_push_data
    at gstpad.c line 4069
  • #19 gst_pad_push
    at gstpad.c line 4180
  • #20 gst_video_decoder_clip_and_push_buf
    at gstvideodecoder.c line 2805
  • #21 gst_video_decoder_finish_frame
    at gstvideodecoder.c line 2711
  • #22 gst_ffmpegviddec_video_frame
    at gstavviddec.c line 1352
  • #23 gst_ffmpegviddec_frame
    at gstavviddec.c line 1409
  • #24 gst_ffmpegviddec_handle_frame
    at gstavviddec.c line 1521
  • #25 gst_video_decoder_decode_frame
    at gstvideodecoder.c line 3007
  • #26 gst_video_decoder_chain_forward
    at gstvideodecoder.c line 1874
  • #27 gst_video_decoder_chain
    at gstvideodecoder.c line 2175
  • #28 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #29 gst_pad_push_data
    at gstpad.c line 4069
  • #30 gst_base_transform_chain
    at gstbasetransform.c line 2260
  • #31 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #32 gst_pad_push_data
    at gstpad.c line 4069
  • #33 gst_base_parse_push_frame
    at gstbaseparse.c line 2302
  • #34 gst_base_parse_handle_and_push_frame
    at gstbaseparse.c line 2134
  • #35 gst_base_parse_finish_frame
    at gstbaseparse.c line 2459
  • #36 gst_h264_parse_handle_frame
    at gsth264parse.c line 1048
  • #37 gst_base_parse_handle_buffer
    at gstbaseparse.c line 1961
  • #38 gst_base_parse_chain
    at gstbaseparse.c line 2897
  • #39 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #40 gst_pad_push_data
    at gstpad.c line 4069
  • #41 gst_single_queue_push_one
    at gstmultiqueue.c line 1196
  • #42 gst_multi_queue_loop
    at gstmultiqueue.c line 1445
  • #43 gst_task_func
    at gsttask.c line 317
  • #44 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #45 g_thread_proxy
    at gthread.c line 764
  • #46 start_thread
    at pthread_create.c line 310
  • #47 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 3 (Thread 0x7fffe9832700 (LWP 24417))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1390
  • #2 gst_data_queue_push
    at gstdataqueue.c line 519
  • #3 gst_multi_queue_chain
    at gstmultiqueue.c line 1579
  • #4 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #5 gst_pad_push_data
    at gstpad.c line 4069
  • #6 gst_ts_demux_push_pending_data
    at tsdemux.c line 2144
  • #7 gst_ts_demux_handle_packet
    at tsdemux.c line 2173
  • #8 gst_ts_demux_push
    at tsdemux.c line 2253
  • #9 mpegts_base_chain
    at mpegtsbase.c line 1172
  • #10 mpegts_base_loop
    at mpegtsbase.c line 1346
  • #11 gst_task_func
    at gsttask.c line 317
  • #12 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #13 g_thread_proxy
    at gthread.c line 764
  • #14 start_thread
    at pthread_create.c line 310
  • #15 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 2 (Thread 0x7fffea8d6700 (LWP 24416))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1390
  • #2 gst_task_func
    at gsttask.c line 302
  • #3 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #4 g_thread_proxy
    at gthread.c line 764
  • #5 start_thread
    at pthread_create.c line 310
  • #6 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 1 (Thread 0x7ffff7f9b8c0 (LWP 24412))

  • #0 __memcpy_sse2_unaligned
    at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S line 36
  • #1 png_write_row
    from /usr/lib/libpng16.so.16
  • #2 png_write_rows
    from /usr/lib/libpng16.so.16
  • #3 real_save_png
    at io-png.c line 1040
  • #4 gdk_pixbuf__png_image_save_to_callback
    at io-png.c line 1080
  • #5 gdk_pixbuf_real_save_to_callback
    at gdk-pixbuf-io.c line 2300
  • #6 gdk_pixbuf_save_to_callbackv
    at gdk-pixbuf-io.c line 2661
  • #7 gdk_pixbuf_save_to_bufferv
    at gdk-pixbuf-io.c line 2807
  • #8 gdk_pixbuf_save_to_buffer
    at gdk-pixbuf-io.c line 2719
  • #9 shotwell_thumbnailer_main
    at /tmp/yaourt-tmp-felipe/abs-shotwell/src/shotwell-0.20.1/thumbnailer/shotwell-video-thumbnailer.vala line 114
  • #10 main
    at /tmp/yaourt-tmp-felipe/abs-shotwell/src/shotwell-0.20.1/thumbnailer/shotwell-video-thumbnailer.vala line 15

Thanks! :)
Comment 1 François-Xavier Eon 2014-11-05 00:15:28 UTC
Hello, I think i have the same problem here: (

$ uname -a
Linux fxi7 3.17.2-1-ARCH #1 SMP PREEMPT Thu Oct 30 20:49:39 CET 2014 x86_64 GNU/Linux

$ yaourt -Q gst-libav gdk-pixbuf2 shotwell
extra/gst-libav 1.4.3-1
extra/gdk-pixbuf2 2.31.1-1
community/shotwell 1:0.20.2-1


$ gdb /usr/lib/shotwell/shotwell-video-thumbnailer
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/shotwell/shotwell-video-thumbnailer...(no debugging symbols found)...done.
(gdb) run /usr/lib/shotwell/shotwell-video-thumbnailer 
Starting program: /usr/lib/shotwell/shotwell-video-thumbnailer /usr/lib/shotwell/shotwell-video-thumbnailer
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea8dc700 (LWP 3586)]
Failed to play the file: couldn't get state.
[Thread 0x7ffff7f9d8c0 (LWP 3582) exited]
[Inferior 1 (process 3582) exited with code 03]
(gdb) run /home/fx/Images/100CANON/camescope/GEDV0135.MOV 
Starting program: /usr/lib/shotwell/shotwell-video-thumbnailer /home/fx/Images/100CANON/camescope/GEDV0135.MOV
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea8dc700 (LWP 3589)]
[New Thread 0x7fffe983b700 (LWP 3590)]
[New Thread 0x7fffe903a700 (LWP 3591)]
[New Thread 0x7fffdbfff700 (LWP 3592)]
[New Thread 0x7fffda3c6700 (LWP 3593)]
[New Thread 0x7fffd9bc5700 (LWP 3594)]
[New Thread 0x7fffd93c4700 (LWP 3595)]
[New Thread 0x7fffd8bc3700 (LWP 3596)]
[New Thread 0x7fffd3fff700 (LWP 3597)]
[New Thread 0x7fffd37fe700 (LWP 3598)]
[New Thread 0x7fffd2ffd700 (LWP 3599)]
[New Thread 0x7fffd27fc700 (LWP 3600)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff491085e in __memcpy_sse2_unaligned () from /usr/lib/libc.so.6
Comment 2 François-Xavier Eon 2014-11-18 21:23:39 UTC
I don't know if this bug is related:
https://bugzilla.gnome.org/show_bug.cgi?id=739146
Comment 3 Jim Nelson 2014-12-02 23:05:17 UTC
These traces look to be pretty deep inside of GStreamer.  Is there any way a sample video could be provided to me so I can look at this closer?

Does totem-video-thumbnailer exhibit the same problem?  Do thumbnails appear in Nautilus?
Comment 4 Felipe Lessa 2014-12-15 20:24:12 UTC
totem-video-thumbnailer works fine.

Jim, I can provide you the video I used for the stack trace above.  It's 51 MiB.  How can I give it to you?
Comment 5 Jim Nelson 2014-12-19 01:17:37 UTC
I could only suggest Dropbox or another large-file sharing service.
Comment 6 Felipe Lessa 2014-12-19 01:23:16 UTC
Ok, I'm going to send you a Google Drive link to your e-mail shortly.  If that doesn't work, please let me know :).
Comment 7 Jim Nelson 2014-12-20 00:28:34 UTC
Ok, I was able to reproduce your problem.  The crux of the issue is, GStreamer is returning a buffer 66 bytes long for a frame it's reporting to be 1920x1080.  Shotwell's video thumbnailer wasn't checking for basic sanity before passing the buffer to gdk-pixbuf, causing the crash.

I've pushed a fix that sanity checks values before proceeding, but the basic problem remains that Shotwell can't thumbnail this video now.  Since Totem's thumbnailer can, we need to do more work on ours to get this fixed.  I would love it if someone in the community with a little GST guru-ness under the belt could look into this.

Pushed to master, commit 22902f
Comment 8 Jim Nelson 2014-12-30 22:07:58 UTC
Unfortunately, the patch for bug #718989 reintroduces this bug, so I need to re-open this.
Comment 9 Thomas Moschny 2015-06-09 08:42:23 UTC
Would it be possible to cherry-pick commit 22902f6c to the shotwell-0.20 branch?

See also https://bugzilla.redhat.com/show_bug.cgi?id=1147079
Comment 10 Thomas Moschny 2015-06-09 08:46:20 UTC
(In reply to Thomas Moschny from comment #9)
> Would it be possible to cherry-pick commit 22902f6c to the shotwell-0.20
> branch?
> 
> See also https://bugzilla.redhat.com/show_bug.cgi?id=1147079

And maybe also 4d088d7b ... what about your comment 8:

> Unfortunately, the patch for bug #718989 reintroduces this bug, so I need to
> re-open this.

does it still hold?
Comment 11 Jens Georg 2016-04-23 09:46:14 UTC
Retest with 0.22. Felipe, if you are still listening, could you provide me with the sample as well?
Comment 12 Steeve McCauley 2016-08-31 12:01:31 UTC
I'm seeing this bug, or something very similar, in Fedora 24 and Shotwell (shotwell-0.23.5-1.fc24.x86_64).  Moving /usr/lib64/libavutil* out of the way allows me to successfully open shotwell, and these errors appear at the console,

(shotwell:8453): GStreamer-WARNING **: Failed to load plugin '/usr/lib64/gstreamer-1.0/libgstlibav.so': libavutil.so.55: cannot open shared object file: No such file or directory
Comment 13 Steeve McCauley 2016-08-31 12:10:23 UTC
BTW, I can't seem to find a way to swtich the video-thumbnailer to totem's version, any advice?
Comment 14 Jens Georg 2016-09-20 18:25:29 UTC
That's a bug in the externally supplied libav with that file. Not much shotwell can do about that.
Comment 15 Jens Georg 2016-09-20 18:27:39 UTC
(In reply to Steeve McCauley from comment #13)
> BTW, I can't seem to find a way to swtich the video-thumbnailer to totem's
> version, any advice?

Not without making a wrapper script.
Comment 16 Steeve McCauley 2016-09-20 18:35:12 UTC
(In reply to Jens Georg from comment #14)
> That's a bug in the externally supplied libav with that file. Not much
> shotwell can do about that.

Presumably it could be shored up to catch the exception and prevent shorewall from segfaulting.
Comment 17 Jens Georg 2016-09-20 18:41:41 UTC
I don't know what exactly crashes in your case, but a segmentation fault is usually hard to recover from in your own process.
Comment 18 Jens Georg 2016-12-09 08:35:33 UTC
(In reply to Jens Georg from comment #17)
> I don't know what exactly crashes in your case, but a segmentation fault is
> usually hard to recover from in your own process.

Actually, you can do that, but it's dark black self-rewriting magic.
Comment 19 Steeve McCauley 2016-12-09 11:57:32 UTC
In Fedora 25 with shotwell-0.24.2-1.fc25.x86_64 and ffmpeg-libs-3.2.1-1.fc25.x86_64 the problem seems to have been resolved.
Comment 20 Jens Georg 2016-12-09 13:07:37 UTC
Closing obsolete then. Feel free to reopen if it reappears