GNOME Bugzilla – Bug 739396
shotwell-video-thumbnailer segfaults on a H.264 video
Last modified: 2016-12-09 13:07:37 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
+ Trace 234275
Thread 5 (Thread 0x7fffdbfff700 (LWP 24419))
Thread 4 (Thread 0x7fffe9031700 (LWP 24418))
Thread 3 (Thread 0x7fffe9832700 (LWP 24417))
Thread 2 (Thread 0x7fffea8d6700 (LWP 24416))
Thread 1 (Thread 0x7ffff7f9b8c0 (LWP 24412))
Thanks! :)
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
I don't know if this bug is related: https://bugzilla.gnome.org/show_bug.cgi?id=739146
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?
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?
I could only suggest Dropbox or another large-file sharing service.
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 :).
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
Unfortunately, the patch for bug #718989 reintroduces this bug, so I need to re-open this.
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
(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?
Retest with 0.22. Felipe, if you are still listening, could you provide me with the sample as well?
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
BTW, I can't seem to find a way to swtich the video-thumbnailer to totem's version, any advice?
That's a bug in the externally supplied libav with that file. Not much shotwell can do about that.
(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.
(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.
I don't know what exactly crashes in your case, but a segmentation fault is usually hard to recover from in your own process.
(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.
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.
Closing obsolete then. Feel free to reopen if it reappears