Opened 6 years ago

Closed 6 years ago

#6785 closed defect (fixed)

aresample=tsf=s32p crashes

Reported by: Carl Eugen Hoyos Owned by:
Priority: important Component: swresample
Version: git-master Keywords: crash SIGSEGV
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

$ (gdb) r -f s16le -i /dev/zero -af aresample=48000:ocl=stereo:tsf=s32p -f null -
Starting program: ffmpeg_g -f s16le -i /dev/zero -af aresample=48000:ocl=stereo:tsf=s32p -f null -
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
ffmpeg version N-88204-g7f9de7b Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  0.101 / 58.  0.101
  libavformat    58.  0.101 / 58.  0.101
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.100 /  7.  0.100
  libswscale      5.  0.100 /  5.  0.100
  libswresample   3.  0.100 /  3.  0.100
  libpostproc    55.  0.100 / 55.  0.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[New Thread 0x7ffff515c700 (LWP 19241)]
[New Thread 0x7ffff495b700 (LWP 19242)]
[New Thread 0x7ffff415a700 (LWP 19243)]
[New Thread 0x7ffff3959700 (LWP 19244)]
[New Thread 0x7ffff3158700 (LWP 19245)]
[New Thread 0x7ffff2957700 (LWP 19246)]
[New Thread 0x7ffff2156700 (LWP 19247)]
[New Thread 0x7ffff1955700 (LWP 19248)]

Program received signal SIGSEGV, Segmentation fault.
copy_s32 (out=0x20a2a60, in=0x20a0a00, coeffp=0x0, index=0, len=1024) at libswresample/rematrix_template.c:65
65          INTER coeff = coeffp[index];
(gdb) bt
#0  copy_s32 (out=0x20a2a60, in=0x20a0a00, coeffp=0x0, index=0, len=1024) at libswresample/rematrix_template.c:65
#1  0x0000000000ff6fb0 in swri_rematrix (s=s@entry=0x2084140, out=out@entry=0x7fffffffcb40, in=in@entry=0x2087110, len=len@entry=1024,
    mustcopy=0) at libswresample/rematrix.c:516
#2  0x0000000000ff85bd in swr_convert_internal (s=s@entry=0x2084140, out=out@entry=0x2087770, out_count=out_count@entry=1146,
    in=in@entry=0x2086ef0, in_count=in_count@entry=1024) at libswresample/swresample.c:643
#3  0x0000000000ff8fbd in swr_convert_internal (in_count=1024, in=0x2086ef0, out_count=1146, out=0x2087770, s=0x2084140)
    at libswresample/swresample.c:748
#4  swr_convert (s=0x2084140, out_arg=<optimized out>, out_count=out_count@entry=1146, in_arg=<optimized out>,
    in_count=<optimized out>, in_count@entry=1024) at libswresample/swresample.c:758
#5  0x00000000005b45ff in filter_frame (inlink=inlink@entry=0x2099760, insamplesref=<optimized out>) at libavfilter/af_aresample.c:217
#6  0x00000000004c24da in ff_filter_frame_framed (frame=<optimized out>, link=0x2099760) at libavfilter/avfilter.c:1104
#7  ff_filter_frame_to_filter (link=0x2099760) at libavfilter/avfilter.c:1252
#8  ff_filter_activate_default (filter=<optimized out>) at libavfilter/avfilter.c:1301
#9  ff_filter_activate (filter=<optimized out>) at libavfilter/avfilter.c:1462
#10 0x00000000004c5adc in ff_filter_graph_run_once (graph=graph@entry=0x20822c0) at libavfilter/avfiltergraph.c:1432
#11 0x00000000004c6b4c in push_frame (graph=0x20822c0) at libavfilter/buffersrc.c:181
#12 av_buffersrc_add_frame_internal (ctx=ctx@entry=0x2083a00, frame=frame@entry=0x2081b40, flags=flags@entry=4)
    at libavfilter/buffersrc.c:255
#13 0x00000000004c6ffd in av_buffersrc_add_frame_flags (ctx=0x2083a00, frame=frame@entry=0x2081b40, flags=flags@entry=4)
    at libavfilter/buffersrc.c:164
#14 0x00000000004a0e27 in ifilter_send_frame (frame=0x2081b40, ifilter=0x2080d40) at fftools/ffmpeg.c:2176
#15 send_frame_to_filters (ist=ist@entry=0x207b2a0, decoded_frame=decoded_frame@entry=0x2081b40) at fftools/ffmpeg.c:2255
#16 0x00000000004a11e4 in decode_audio (ist=ist@entry=0x207b2a0, pkt=0x7fffffffd380, got_output=got_output@entry=0x7fffffffd2f8,
    decode_failed=decode_failed@entry=0x7fffffffd2fc) at fftools/ffmpeg.c:2324
#17 0x00000000004a2dcd in process_input_packet (ist=0x207b2a0, pkt=0x7fffffffd770, no_eof=0) at fftools/ffmpeg.c:2606
#18 0x0000000000481867 in process_input (file_index=<optimized out>) at fftools/ffmpeg.c:4410
#19 transcode_step () at fftools/ffmpeg.c:4530
#20 transcode () at fftools/ffmpeg.c:4584
#21 main (argc=<optimized out>, argv=<optimized out>) at fftools/ffmpeg.c:4790
(gdb) disass $pc,$pc+32
Dump of assembler code from 0xff69b0 to 0xff69d0:
=> 0x0000000000ff69b0 <copy_s32+0>:     movslq (%rdx,%rcx,4),%r9
   0x0000000000ff69b4 <copy_s32+4>:     xor    %edx,%edx
   0x0000000000ff69b6 <copy_s32+6>:     test   %r8,%r8
   0x0000000000ff69b9 <copy_s32+9>:     lea    0x0(,%r8,4),%rcx
   0x0000000000ff69c1 <copy_s32+17>:    jle    0xff69e6 <copy_s32+54>
   0x0000000000ff69c3 <copy_s32+19>:    nopl   0x0(%rax,%rax,1)
   0x0000000000ff69c8 <copy_s32+24>:    movslq (%rsi,%rdx,1),%rax
   0x0000000000ff69cc <copy_s32+28>:    imul   %r9,%rax
End of assembler dump.
(gdb) info register
rax            0x0      0
rbx            0x2084140        34095424
rcx            0x0      0
rdx            0x0      0
rsi            0x20a0a00        34212352
rdi            0x20a2a60        34220640
rbp            0x2087110        0x2087110
rsp            0x7fffffffc848   0x7fffffffc848
r8             0x400    1024
r9             0x0      0
r10            0x0      0
r11            0x7ffff53e6459   140737307894873
r12            0x2098069        34177129
r13            0x0      0
r14            0x7fffffffcb40   140737488341824
r15            0x2      2
rip            0xff69b0 0xff69b0 <copy_s32>
eflags         0x10246  [ PF ZF IF RF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0

Attachments (1)

patchs32p.diff (1.4 KB ) - added by Carl Eugen Hoyos 6 years ago.

Download all attachments as: .zip

Change History (3)

by Carl Eugen Hoyos, 6 years ago

Attachment: patchs32p.diff added

comment:1 by omniplex, 6 years ago

While your crash is clearly more important than my 3.3.3 incompatibiliy with 3.0 reported in #6779 I'm still interested in solving my issue, because I have to update several ff2xyz scripts on my box when I figured out what the former s32 should be. Next test result, s32 still worked "as always" (before 3.3.3) in 3.2.4, but s32p was also already okay in 3.2.4. Fast Forward, because I'd miss the XPM decoder added in 3.3, https://en.wikipedia.org/wiki/X_PixMap#Application_support

3.4 also can do s32p, so that's the plan, but the error message for s32 is unsurprisingly not better than in 3.3.3: Requested sample format s32 is not supported internally, S16/S32/S64/FLT/DBL is supported.

comment:2 by Carl Eugen Hoyos, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.