Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#627818: ffmpeg segmentation fault __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119

102 views
Skip to first unread message

Marco Mattiolo

unread,
May 24, 2011, 2:40:02 PM5/24/11
to
Package: ffmpeg
Version: 4:0.6.2-3
Severity: normal

Hi.
I'm having a problem with ffmpeg, converting flv downloaded by
youtube-dl to audio-only ogg vorbis.
I had debian-multimedia repo enabled, so I purged all packages related
to that repo, before generating this bugreport.
Hope this really helps getting a better ffmpeg. Also hope not to waste
your time.
Thank you

$ gdb ffmpeg
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/ffmpeg...Reading symbols from
/usr/lib/debug/usr/bin/ffmpeg...done.
done.
(gdb) set pagination 0
(gdb) run -i XBHzFb0toqc.flv -f ogg -acodec libvorbis -vn "KT tunstall -
Suddenly I see.ogg"
Starting program: /usr/bin/ffmpeg -i XBHzFb0toqc.flv -f ogg -acodec
libvorbis -vn "KT tunstall - Suddenly I see.ogg"
[Thread debugging using libthread_db enabled]
FFmpeg version 0.6.2-4:0.6.2-3, Copyright (c) 2000-2010 the Libav developers
built on Apr 30 2011 11:45:41 with gcc 4.5.2
configuration: --extra-version=4:0.6.2-3 --prefix=/usr
--enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
--enable-libgsm --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
--enable-libvpx --disable-stripping --enable-runtime-cpudetect
--enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc
--enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac
--enable-libfaad --enable-librtmp --enable-libdc1394 --enable-shared
--disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[flv @ 0x64b6b0]Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'XBHzFb0toqc.flv':
Metadata:
duration : 197
starttime : 0
totalduration : 197
width : 320
height : 240
videodatarate : 81
audiodatarate : 103
totaldatarate : 192
framerate : 25
bytelength : 4731985
canseekontime : true
sourcedata : BD075E384HH1306095687603251
purl :
pmsg :
Duration: 00:03:16.60, start: 0.000000, bitrate: 188 kb/s
Stream #0.0: Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 82
kb/s, 25 tbr, 1k tbn, 50 tbc
Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 105 kb/s
File 'KT tunstall - Suddenly I see.ogg' already exists. Overwrite ? [y/N] y
Output #0, ogg, to 'KT tunstall - Suddenly I see.ogg':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Audio: libvorbis, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding

Program received signal SIGSEGV, Segmentation fault.
__memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
119 ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: File o directory non
esistente.
in ../sysdeps/x86_64/multiarch/memcpy-ssse3.S
(gdb) bt
#0 __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
#1 0x00007ffff6d01563 in oggvorbis_encode_frame (avccontext=<value
optimized out>, packets=0x7edd40 "v'\375\347Y\276\204", buf_size=<value
optimized out>, data=<value optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/libavcodec/libvorbis.c:191
#2 0x00007ffff6e29207 in avcodec_encode_audio (avctx=0x64ed40,
buf=<value optimized out>, buf_size=<value optimized out>,
samples=<value optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/libavcodec/utils.c:544
#3 0x00000000004096ce in do_audio_out (ist=<value optimized out>,
ist_index=1, ost_table=0x64f360, nb_ostreams=1, pkt=<value optimized
out>) at /build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:788
#4 output_packet (ist=<value optimized out>, ist_index=1,
ost_table=0x64f360, nb_ostreams=1, pkt=<value optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:1518
#5 0x000000000040cc76 in av_transcode (nb_output_files=1,
nb_input_files=1, nb_stream_maps=-10048, stream_maps=0x617a80,
input_files=0x617760, output_files=0x617440) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:2409
#6 0x000000000040ee05 in main (argc=<value optimized out>, argv=<value
optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:4163
(gdb) quit

-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ffmpeg depends on:
ii libavcodec52 4:0.6.2-3 Libav codec library
ii libavdevice52 4:0.6.2-3 Libav device handling library
ii libavfilter1 4:0.6.2-3 Libav video filtering library
ii libavformat52 4:0.6.2-3 Libav file format library
ii libavutil50 4:0.6.2-3 Libav utility library
ii libc6 2.13-4 Embedded GNU C Library:
Shared lib
ii libpostproc51 4:0.6.2-3 Libav video postprocessing
library
ii libsdl1.2debian 1.2.14-6.3 Simple DirectMedia Layer
ii libswscale0 4:0.6.2-3 Libav video scaling library

ffmpeg recommends no packages.

ffmpeg suggests no packages.

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Romain Beauxis

unread,
May 24, 2011, 7:40:02 PM5/24/11
to
Hi all,

2011/5/24 Marco Mattiolo <marco.m...@hotmail.it>:

I ran into a similar bug in the recent past that was due to frame
memory not being aligned. Memory alignment is required to use SSE
optimisations. Maybe that is the issue here too?

Romain

Reinhard Tartler

unread,
May 25, 2011, 3:00:02 AM5/25/11
to
On Tue, May 24, 2011 at 20:35:14 (CEST), Marco Mattiolo wrote:

> Package: ffmpeg
> Version: 4:0.6.2-3
> Severity: normal
>
> Hi.
> I'm having a problem with ffmpeg, converting flv downloaded by
> youtube-dl to audio-only ogg vorbis.
> I had debian-multimedia repo enabled, so I purged all packages related
> to that repo, before generating this bugreport.
> Hope this really helps getting a better ffmpeg. Also hope not to waste
> your time.

Can you please try the ffmpeg package from experimental (0.7) as well?
In any case, please share the .flv file, we really need to be able to
reproduce ourselves.

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Andres Mejia

unread,
May 25, 2011, 5:30:02 PM5/25/11
to
On Wed, May 25, 2011 at 4:51 PM, Marco Mattiolo
<marco.m...@hotmail.it> wrote:

> Il 25/05/2011 08:47, Reinhard Tartler ha scritto:
>>
>> Can you please try the ffmpeg package from experimental (0.7) as well?
>> In any case, please share the .flv file, we really need to be able to
>> reproduce ourselves.
>
> Ok: ffmpeg from experimental works.
>
> The problem isn't video-specific, today I tried plenty of videos downloaded
> with youtube-dl, and all weren't able to convert into vorbis using ffmpeg.
> So I looked for a tiny video to attach, you can also get typing "youtube-dl
> http://www.youtube.com/watch?v=ELiKge89VAw".
>
> Il 25/05/2011 01:29, Romain Beauxis ha scritto:
>>
>> Hi all,

>> I ran into a similar bug in the recent past that was due to frame
>> memory not being aligned. Memory alignment is required to use SSE
>> optimisations. Maybe that is the issue here too?
>
> I don't know: how could I check it?
>
> Thank you
> Marco
>
> _______________________________________________
> pkg-multimedia-maintainers mailing list
> pkg-multimedi...@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers
>

Note the following news of a recent upload of eglibc.

eglibc (2.13-3) unstable; urgency=low

Starting with version 2.13, eglibc provides an SSSE3 optimized version
of memcpy() on the amd64 architecture. This version might copy memory
backward in some conditions, which causes issues if the source and
destination overlap. memmove() should be used in such cases, but some
programs still wrongly use memcpy().

For this reason, on the amd64 architecture the Debian package provides
two wrappers which can be use to workaround and/or debug the issue:
- /usr/lib/libc/memcpy-preload.so simply replace all calls to memcpy()
by a call to memmove()
- /usr/lib/libc/memcpy-syslog-preload.so does the same, but in addition
logs (with rate limit) the issue to syslog, so that it can be
detected and fixed.

To use these wrapper on a single binary, the easiest way is to use the
LD_PRELOAD environment variable:
- LD_PRELOAD=/usr/lib/libc/memcpy-preload.so /path/to/binary
- LD_PRELOAD=/usr/lib/libc/memcpy-syslog-preload.so /path/to/binary

For system-wide usage, it is possible to add the path of one of the
wrapper to /etc/ld.so.preload.

For more details about the issue, please see:
http://bugs.debian.org/625521
http://sourceware.org/bugzilla/show_bug.cgi?id=12518

-- Aurelien Jarno <aur...@debian.org> Wed, 11 May 2011 22:15:31 +0200


--
Regards,
Andres Mejia

Marco Mattiolo

unread,
Jun 24, 2011, 6:20:01 PM6/24/11
to
Ok, I just got here on wheezy the eglibc upgrade you were writing about.
Now ffmpeg works: let's close this bug, thank you all!
Marco

Reinhard Tartler

unread,
Jun 25, 2011, 2:30:02 AM6/25/11
to
bug 627818 +unreproducible +help
stop

On Sat, Jun 25, 2011 at 00:14:05 (CEST), Marco Mattiolo wrote:

> Ok, I just got here on wheezy the eglibc upgrade you were writing
> about. Now ffmpeg works: let's close this bug, thank you all!
> Marco

Well, as you wish, but I am still curious:

- what has fixed the symptoms
- does glibc really have issues with non-aligned src/destination
memcpy/memmove() calls?
- does Libav 0.6 use overlapping memcpys?
- does Libav 0.7? (as currently found in experimental)

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

--

Marco Mattiolo

unread,
Jun 25, 2011, 6:30:01 AM6/25/11
to
Il 25/06/2011 08:19, Reinhard Tartler ha scritto:
> Well, as you wish, but I am still curious:
>
> - what has fixed the symptoms
During last night upgrade, I came across the upgrade infos Andres was
talking about http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627818#25
So, I got libc upgraded to 2.13-7
http://packages.qa.debian.org/e/eglibc/news/20110623T163908Z.html
Then I tried converting another video with ffmpeg, and it works...

> - does glibc really have issues with non-aligned src/destination
> memcpy/memmove() calls?
> - does Libav 0.6 use overlapping memcpys?
> - does Libav 0.7? (as currently found in experimental)
Could you help me answering your questions? Thanks
Marco

Marco Mattiolo

unread,
Jun 25, 2011, 7:10:01 AM6/25/11
to
I was wrong: yesterday I got the only two videos which get correctly
converted by ffmpeg.
Today, with another video, I get this error

[ogg @ 0x64dae0]st:0 error, non monotone timestamps 99008 >=
-1968073036740895792
av_interleaved_write_frame(): Operation not permitted

and, another video, another error:

Program received signal SIGSEGV, Segmentation fault.
__memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
119 ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: File o
directory non esistente.
in ../sysdeps/x86_64/multiarch/memcpy-ssse3.S

So the problem is still here. Sorry for the mess.
Marco

Reinhard Tartler

unread,
Jun 25, 2011, 9:30:02 AM6/25/11
to
On Sat, Jun 25, 2011 at 12:57:00 (CEST), Marco Mattiolo wrote:

> I was wrong: yesterday I got the only two videos which get correctly
> converted by ffmpeg.
> Today, with another video, I get this error
>
> [ogg @ 0x64dae0]st:0 error, non monotone timestamps 99008 >=
> -1968073036740895792
> av_interleaved_write_frame(): Operation not permitted
>
> and, another video, another error:
>
> Program received signal SIGSEGV, Segmentation fault.
> __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
> 119 ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: File o directory
> non esistente.
> in ../sysdeps/x86_64/multiarch/memcpy-ssse3.S
>
> So the problem is still here. Sorry for the mess.

No problem, but we need a complete backtrace for this.

see http://wiki.debian.org/HowToGetABacktrace for detailed instructions
how to do so.

Greetings,
Reinhard

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

--

Marco Mattiolo

unread,
Jun 25, 2011, 3:00:02 PM6/25/11
to
Il 25/06/2011 15:20, Reinhard Tartler ha scritto:
> On Sat, Jun 25, 2011 at 12:57:00 (CEST), Marco Mattiolo wrote:
>
>> I was wrong: yesterday I got the only two videos which get correctly
>> converted by ffmpeg.
>> Today, with another video, I get this error
>>
>> [ogg @ 0x64dae0]st:0 error, non monotone timestamps 99008>=
>> -1968073036740895792
>> av_interleaved_write_frame(): Operation not permitted
>>
>> and, another video, another error:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
>> 119 ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: File o directory
>> non esistente.
>> in ../sysdeps/x86_64/multiarch/memcpy-ssse3.S
>>
>> So the problem is still here. Sorry for the mess.
> No problem, but we need a complete backtrace for this.
>
> see http://wiki.debian.org/HowToGetABacktrace for detailed instructions
> how to do so.
>
> Greetings,
> Reinhard
>
It doesn't look SO different from previous bt:

(gdb) bt
#0 __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:119
#1 0x00007ffff6d01563 in oggvorbis_encode_frame (avccontext=<value
optimized out>, packets=0x7f3500 "\022\254&\250\311\066\033",
buf_size=<value optimized out>, data=<value optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/libavcodec/libvorbis.c:191

#2 0x00007ffff6e29207 in avcodec_encode_audio (avctx=0x64eb20,

buf=<value optimized out>, buf_size=<value optimized out>,
samples=<value optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/libavcodec/utils.c:544
#3 0x00000000004096ce in do_audio_out (ist=<value optimized out>,

ist_index=1, ost_table=0x654670, nb_ostreams=1, pkt=<value optimized

out>) at /build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:788
#4 output_packet (ist=<value optimized out>, ist_index=1,

ost_table=0x654670, nb_ostreams=1, pkt=<value optimized out>) at

/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:1518
#5 0x000000000040cc76 in av_transcode (nb_output_files=1,

nb_input_files=1, nb_stream_maps=-10144, stream_maps=0x617a80,

input_files=0x617760, output_files=0x617440) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:2409
#6 0x000000000040ee05 in main (argc=<value optimized out>, argv=<value
optimized out>) at
/build/buildd-libav_0.6.2-3-amd64-jtanW8/libav-0.6.2/ffmpeg.c:4163
(gdb)

According to me, now the problem is video-specific: some get converted,
some don't (with different errors, but let's focus on the topic).
Is there a way, in which I could "scan" the videos, to find out what
makes ffmpeg crash (if this can help fixing this bug)?
Grettings
Marco

0 new messages