[FFmpeg-trac] #3985(swresample:open): Crash when extracting the audio from a video created by mkvmerge

FFmpeg trac at avcodec.org
Sun Sep 28 17:58:41 CEST 2014


#3985: Crash when extracting the audio from a video created by mkvmerge
-------------------------------------+-------------------------------------
             Reporter:  Calmarius    |                    Owner:
                 Type:  defect       |                   Status:  open
             Priority:  important    |                Component:
              Version:  git-master   |  swresample
             Keywords:  crash        |               Resolution:
  SIGSEGV regression                 |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by cehoyos):

 * keywords:   => crash SIGSEGV regression
 * priority:  normal => important
 * status:  new => open
 * component:  ffmpeg => swresample
 * reproduced:  0 => 1


Comment:

 Regression since ea6331b2
 Workaround is to specify {{{-cpuflags -sse2}}}
 {{{
 (gdb) r -i intermediate_cc_cut.mkv -af aresample=async=1000 -f null -
 Starting program: ffmpeg_g -i intermediate_cc_cut.mkv -af
 aresample=async=1000 -f null -
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib64/libthread_db.so.1".
 ffmpeg version N-66527-gb28f470 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Sep 28 2014 17:54:28 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl
   libavutil      54.  7.101 / 54.  7.101
   libavcodec     56.  1.101 / 56.  1.101
   libavformat    56.  7.101 / 56.  7.101
   libavdevice    56.  1.100 / 56.  1.100
   libavfilter     5.  1.102 /  5.  1.102
   libswscale      3.  1.100 /  3.  1.100
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  1.100 / 53.  1.100
 Guessed Channel Layout for  Input Stream #0.0 : stereo
 Input #0, matroska,webm, from 'intermediate_cc_cut.mkv':
   Metadata:
     ENCODER         : Lavf56.7.100
   Duration: 00:00:10.05, start: 0.000000, bitrate: 1406 kb/s
     Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
 (default)
 [New Thread 0x7ffff1afe700 (LWP 27715)]
 [New Thread 0x7ffff12fd700 (LWP 27716)]
 [New Thread 0x7ffff0afc700 (LWP 27717)]
 [New Thread 0x7ffff02fb700 (LWP 27718)]
 [New Thread 0x7fffefafa700 (LWP 27719)]
 [New Thread 0x7fffef2f9700 (LWP 27720)]
 [New Thread 0x7fffeeaf8700 (LWP 27721)]
 [New Thread 0x7fffee2f7700 (LWP 27722)]
 [New Thread 0x7fffedaf6700 (LWP 27723)]
 Output #0, null, to 'pipe:':
   Metadata:
     encoder         : Lavf56.7.101
     Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
 (default)
     Metadata:
       encoder         : Lavc56.1.101 pcm_s16le
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
 Press [q] to stop, [?] for help

 Program received signal SIGSEGV, Segmentation fault.
 ff_pack_2ch_int16_to_int16_a_sse2.next () at
 libswresample/x86/audio_convert.asm:390
 390     PACK_2CH int16, int16, a, 1, 1, NOP_N, NOP_N
 (gdb) bt
 #0  ff_pack_2ch_int16_to_int16_a_sse2.next () at
 libswresample/x86/audio_convert.asm:390
 #1  0x0000000000dd538f in swri_audio_convert (ctx=0x1a438a0,
 out=out at entry=0x1a4f6e0,
     in=in at entry=0x7fffffffcdd0, len=len at entry=83) at
 libswresample/audioconvert.c:207
 #2  0x0000000000dd2044 in swr_convert_internal (s=s at entry=0x1a4dae0,
     out=out at entry=0x1a4f6e0, out_count=<optimized out>,
 out_count at entry=166,
     in=in at entry=0x1a4f260, in_count=in_count at entry=0) at
 libswresample/swresample.c:633
 #3  0x0000000000dd32e1 in fill_audiodata (out=0x1a4f6e0, in_arg=<optimized
 out>)
     at libswresample/swresample.c:383
 #4  fill_audiodata (out=0x1a4f6e0, in_arg=<optimized out>)
     at libswresample/swresample.c:642
 #5  swr_convert (s=s at entry=0x1a4dae0, out_count=166,
 in_arg=in_arg at entry=0x0,
     in_count=<optimized out>, in_count at entry=0, out_arg=0x0)
     at libswresample/swresample.c:685
 #6  0x0000000000dd3a99 in swr_drop_output (count=<optimized out>,
 s=0x1a4dae0)
     at libswresample/swresample.c:753
 #7  swr_next_pts (s=0x1a4dae0, pts=<optimized out>) at
 libswresample/swresample.c:829
 #8  0x000000000050c2c1 in filter_frame (inlink=inlink at entry=0x1a4d8c0,
     insamplesref=0x1a632c0) at libavfilter/af_aresample.c:199
 #9  0x00000000004979ea in ff_filter_frame_framed
 (link=link at entry=0x1a4d8c0,
     frame=0x1b74060, frame at entry=0x1a632c0) at libavfilter/avfilter.c:1081
 #10 0x0000000000498b39 in ff_filter_frame (link=link at entry=0x1a4d8c0,
 frame=0x1a632c0)
     at libavfilter/avfilter.c:1161
 #11 0x000000000049cdd2 in request_frame (link=0x1a4d8c0) at
 libavfilter/buffersrc.c:499
 #12 0x000000000049d06b in av_buffersrc_add_frame_internal
 (ctx=ctx at entry=0x1a38c40,
     frame=frame at entry=0x1a44660, flags=flags at entry=4) at
 libavfilter/buffersrc.c:181
 #13 0x000000000049d3fd in av_buffersrc_add_frame_flags (ctx=0x1a38c40,
     frame=frame at entry=0x1a44660, flags=flags at entry=4) at
 libavfilter/buffersrc.c:106
 #14 0x00000000004850da in decode_audio (ist=ist at entry=0x1a4b720,
     pkt=pkt at entry=0x7fffffffda40,
 got_output=got_output at entry=0x7fffffffd7bc)
     at ffmpeg.c:1861
 #15 0x00000000004874e3 in process_input_packet (pkt=0x7fffffffd9e0,
 ist=0x1a4b720)
     at ffmpeg.c:2121
 #16 process_input (file_index=27528896) at ffmpeg.c:3538
 #17 0x000000000046bd91 in transcode_step () at ffmpeg.c:3632
 #18 transcode () at ffmpeg.c:3684
 #19 main (argc=<optimized out>, argv=<optimized out>) at ffmpeg.c:3860
 (gdb) disass $pc-32,$pc+32
 Dump of assembler code from 0xdd919a to 0xdd91da:
    0x0000000000dd919a <ff_pack_2ch_int16_to_int16_a_sse2+42>:   lea
 (%rcx,%rdx,2),%ecx
    0x0000000000dd919d <ff_pack_2ch_int16_to_int16_a_sse2+45>:   lea
 (%rdi,%rdx,4),%rdi
    0x0000000000dd91a1 <ff_pack_2ch_int16_to_int16_a_sse2+49>:   neg
 %rdx
    0x0000000000dd91a4 <ff_pack_2ch_int16_to_int16_a_sse2.next+0>:
 movdqa (%rsi,%rdx,2),%xmm0
    0x0000000000dd91a9 <ff_pack_2ch_int16_to_int16_a_sse2.next+5>:
 movdqa %xmm0,%xmm1
    0x0000000000dd91ad <ff_pack_2ch_int16_to_int16_a_sse2.next+9>:
 movdqa (%rcx,%rdx,2),%xmm2
    0x0000000000dd91b2 <ff_pack_2ch_int16_to_int16_a_sse2.next+14>:
 punpcklwd %xmm2,%xmm0
    0x0000000000dd91b6 <ff_pack_2ch_int16_to_int16_a_sse2.next+18>:
 punpckhwd %xmm2,%xmm1
 => 0x0000000000dd91ba <ff_pack_2ch_int16_to_int16_a_sse2.next+22>:
 movdqa %xmm0,(%rdi,%rdx,4)
    0x0000000000dd91bf <ff_pack_2ch_int16_to_int16_a_sse2.next+27>:
 movdqa %xmm1,0x10(%rdi,%rdx,4)
    0x0000000000dd91c5 <ff_pack_2ch_int16_to_int16_a_sse2.next+33>:
 add    $0x8,%rdx
    0x0000000000dd91c9 <ff_pack_2ch_int16_to_int16_a_sse2.next+37>:      jl
 0xdd91a4 <ff_pack_2ch_int16_to_int16_a_sse2.next>
    0x0000000000dd91cb <ff_pack_2ch_int16_to_int16_a_sse2.next+39>:
 repz retq
    0x0000000000dd91cd <ff_pack_2ch_int16_to_int16_a_sse2.next+41>:
 nopl   (%rax)
    0x0000000000dd91d0 <ff_pack_2ch_int32_to_int32_u_sse2+0>:    mov
 0x8(%rsi),%rcx
    0x0000000000dd91d4 <ff_pack_2ch_int32_to_int32_u_sse2+4>:    mov
 (%rsi),%rsi
    0x0000000000dd91d7 <ff_pack_2ch_int32_to_int32_u_sse2+7>:    mov
 (%rdi),%rdi
 End of assembler dump.
 (gdb) info all-registers
 rax            0xdd9170 14520688
 rbx            0x2      2
 rcx            0x1b7cac0        28822208
 rdx            0xffffffffffffffb0       -80
 rsi            0x1b74060        28786784
 rdi            0x140    320
 rbp            0x1a4f6e0        0x1a4f6e0
 rsp            0x7fffffffcd38   0x7fffffffcd38
 r8             0x0      0
 r9             0x0      0
 r10            0x1      1
 r11            0x0      0
 r12            0x50     80
 r13            0x0      0
 r14            0x7fffffffcdd0   140737488342480
 r15            0x1a438a0        27539616
 rip            0xdd91ba 0xdd91ba
 <ff_pack_2ch_int16_to_int16_a_sse2.next+22>
 eflags         0x10283  [ CF SF IF RF ]
 cs             0x33     51
 ss             0x2b     43
 ds             0x0      0
 es             0x0      0
 fs             0x0      0
 gs             0x0      0
 st0            0        (raw 0x00000000000000000000)
 st1            0        (raw 0x00000000000000000000)
 st2            0        (raw 0x00000000000000000000)
 st3            0        (raw 0x00000000000000000000)
 st4            0        (raw 0x00000000000000000000)
 st5            0        (raw 0x00000000000000000000)
 st6            0        (raw 0x00000000000000000000)
 st7            0        (raw 0x00000000000000000000)
 fctrl          0x37f    895
 fstat          0x0      0
 ftag           0xffff   65535
 fiseg          0x0      0
 fioff          0x0      0
 foseg          0x0      0
 fooff          0x0      0
 fop            0x0      0
 mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]
 ymm0           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm1           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm2           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm3           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {
     0x8000000000000000, 0x0, 0x0, 0x0}, v32_int8 = {0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0 <repeats 18 times>},
 v16_int16 = {0x0, 0x0,
     0x0, 0xff00, 0x0, 0x0, 0xff00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0},
   v8_int32 = {0x0, 0xff000000, 0x0, 0xff00, 0x0, 0x0, 0x0, 0x0}, v4_int64
 = {
     0xff00000000000000, 0xff0000000000, 0x0, 0x0}, v2_int128 = {
     0x0000ff0000000000ff00000000000000,
 0x00000000000000000000000000000000}}
 ymm4           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm5           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm6           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm7           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm8           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm9           {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0 <repeats 32 times>}, v16_int16 = {
     0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0},
   v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 =
 {0x00000000000000000000000000000000,
     0x00000000000000000000000000000000}}
 ymm10          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0xea, 0xf2, 0x18, 0xaa, 0xbc, 0xa3, 0x43,
 0xbf,
     0x0 <repeats 24 times>}, v16_int16 = {0xf2ea, 0xaa18, 0xa3bc, 0xbf43,
     0x0 <repeats 12 times>}, v8_int32 = {0xaa18f2ea, 0xbf43a3bc, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0xbf43a3bcaa18f2ea, 0x0, 0x0, 0x0}, v2_int128 = {
     0x0000000000000000bf43a3bcaa18f2ea,
 0x00000000000000000000000000000000}}
 ymm11          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0xe9, 0x15, 0x53, 0xeb, 0xbb, 0x67, 0x43,
 0x3f,
     0x0 <repeats 24 times>}, v16_int16 = {0x15e9, 0xeb53, 0x67bb, 0x3f43,
     0x0 <repeats 12 times>}, v8_int32 = {0xeb5315e9, 0x3f4367bb, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0x3f4367bbeb5315e9, 0x0, 0x0, 0x0}, v2_int128 = {
     0x00000000000000003f4367bbeb5315e9,
 0x00000000000000000000000000000000}}
 ymm12          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0xc1, 0x70, 0xda, 0xf3, 0x6d, 0x62, 0x11,
 0x3a,
     0x0 <repeats 24 times>}, v16_int16 = {0x70c1, 0xf3da, 0x626d, 0x3a11,
     0x0 <repeats 12 times>}, v8_int32 = {0xf3da70c1, 0x3a11626d, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0x3a11626df3da70c1, 0x0, 0x0, 0x0}, v2_int128 = {
     0x00000000000000003a11626df3da70c1,
 0x00000000000000000000000000000000}}
 ymm13          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x9a, 0x60, 0xc2, 0x8d, 0x19, 0x5f, 0xee,
 0x3e,
     0x0 <repeats 24 times>}, v16_int16 = {0x609a, 0x8dc2, 0x5f19, 0x3eee,
     0x0 <repeats 12 times>}, v8_int32 = {0x8dc2609a, 0x3eee5f19, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0x3eee5f198dc2609a, 0x0, 0x0, 0x0}, v2_int128 = {
     0x00000000000000003eee5f198dc2609a,
 0x00000000000000000000000000000000}}
 ymm14          {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0x0, 0x40, 0xa7, 0x0, 0xd4, 0x2c, 0x6f,
 0x3f,
     0x0 <repeats 24 times>}, v16_int16 = {0x4000, 0xa7, 0x2cd4, 0x3f6f,
     0x0 <repeats 12 times>}, v8_int32 = {0xa74000, 0x3f6f2cd4, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0x3f6f2cd400a74000, 0x0, 0x0, 0x0}, v2_int128 = {
 ymm15          {v8_float = {0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
 v4_double = {0x0,
     0x0, 0x0, 0x0}, v32_int8 = {0xeb, 0x3d, 0x52, 0x1b, 0x4b, 0x97, 0xef,
 0x3f,
     0x0 <repeats 24 times>}, v16_int16 = {0x3deb, 0x1b52, 0x974b, 0x3fef,
     0x0 <repeats 12 times>}, v8_int32 = {0x1b523deb, 0x3fef974b, 0x0, 0x0,
 0x0, 0x0, 0x0,
     0x0}, v4_int64 = {0x3fef974b1b523deb, 0x0, 0x0, 0x0}, v2_int128 = {
     0x00000000000000003fef974b1b523deb,
 0x00000000000000000000000000000000}}
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3985#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list