Opened 2 years ago

Closed 2 years ago

#7998 closed defect (invalid)

Segfault when decoding AV1

Reported by: Ilya87 Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: SEGFAULT AV1
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

1 - Encode 1191 frames piece of video with 
{{{
aomenc --target-bitrate=500 -w 720 -h 306 --cpu-used=3 --kf-max-dist=240 --end-usage=vbr --aq-mode=2 -t 6 --tile-columns=6 -o sintel720_aom_500.webm sintel720.y4m
}}}
My OS is Arch Linux x86_64
2 - ffmpeg -v 9 -loglevel 99 -i sintel720_aom_500.webm -c:v libx264 -preset slow -b:v 2000k test.mkv

result:
{{{
ffmpeg -v 9 -loglevel 99 -i /D/sintel/sintel720_aom_500.webm -c:v libx264 -preset slow -b:v 2000k test.mkv
ffmpeg version N-94150-g231d0c819f Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --enable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-libvmaf --extra-cflags='-march=native -mtune=native -g -O3' --extra-cxxflags='-march=native -mtune=native -g -O3' --enable-version3
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.                                                                    
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.                                                     
Reading option '-i' ... matched as input url with argument '/D/sintel/sintel720_aom_500.webm'.                                                          
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.                                                                   
Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'.                                                                         
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '2000k'.                                                
Reading option 'test.mkv' ... matched as output url.                                                                                                    
Finished splitting the commandline.                                                                                                                     
Parsing a group of options: global .                                                                                                                    
Applying option v (set logging level) with argument 9.                                                                                                  
Successfully parsed a group of options.                                                                                                                 
Parsing a group of options: input url /D/sintel/sintel720_aom_500.webm.                                                                                 
Successfully parsed a group of options.                                                                                                                 
Opening an input file: /D/sintel/sintel720_aom_500.webm.                                                                                                
[NULL @ 0x559af05b5300] Opening '/D/sintel/sintel720_aom_500.webm' for reading                                                                          
[file @ 0x559af05b5d80] Setting default whitelist 'file,crypto'                                                                                         
Probing matroska,webm score:100 size:2048                                                                                                               
[matroska,webm @ 0x559af05b5300] Format matroska,webm probed with size=2048 and score=100                                                               
st:0 removing common factor 1000000 from timebase                                                                                                       
[matroska,webm @ 0x559af05b5300] Before avformat_find_stream_info() pos: 254 bytes read:32768 seeks:0 nb_streams:1                                      
[libaom-av1 @ 0x559af05b7b40] 1.0.0
[libaom-av1 @ 0x559af05b7b40] -G "Ninja" -DAOM_TARGET_CPU=x86_64
[libaom-av1 @ 0x559af05b7b40] Frame 0:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.
[AVBSFContext @ 0x559af05bdec0] obu_type: 2, temporal_id: 0, spatial_id: 0, payload size: 0                                                             
[AVBSFContext @ 0x559af05bdec0] obu_type: 1, temporal_id: 0, spatial_id: 0, payload size: 11                                                            
[AVBSFContext @ 0x559af05bdec0] obu_type: 6, temporal_id: 0, spatial_id: 0, payload size: 7534                                                          
[libaom-av1 @ 0x559af05b7b40] Frame 12:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 4:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 2:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 1:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 3:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 8:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 6:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 5:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 7:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 10:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 9:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                              
[libaom-av1 @ 0x559af05b7b40] Frame 11:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 12:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 20:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 16:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 14:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 13:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 15:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 18:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 17:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 19:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 20:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 28:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 24:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 22:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 21:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 23:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 26:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 25:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 27:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 28:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 36:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 32:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 30:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 29:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 31:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 34:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 33:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 35:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 36:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 44:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 40:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 38:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 37:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[libaom-av1 @ 0x559af05b7b40] Frame 39:  size 720x306  upscaled 720  render 720x306  subsample 2x2  bitdepth 8  tiles 1x12.                             
[matroska,webm @ 0x559af05b5300] All info found                                                                                                         
[matroska,webm @ 0x559af05b5300] rfps: 23.750000 0.014474                                                                                               
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 23.833333 0.006451
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 23.916667 0.001640
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 24.000000 0.000043
[matroska,webm @ 0x559af05b5300] rfps: 24.083333 0.001659                                                                                               
[matroska,webm @ 0x559af05b5300] rfps: 24.166667 0.006488                                                                                               
[matroska,webm @ 0x559af05b5300] rfps: 24.250000 0.014530                                                                                               
[matroska,webm @ 0x559af05b5300] rfps: 48.000000 0.000173                                                                                               
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 120.000000 0.001079
[matroska,webm @ 0x559af05b5300] rfps: 240.000000 0.004316                                                                                              
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 23.976024 0.000173
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] rfps: 47.952048 0.000694
    Last message repeated 1 times
[matroska,webm @ 0x559af05b5300] Setting avg frame rate based on r frame rate
[matroska,webm @ 0x559af05b5300] stream 0: start_time: 0.000 duration: -9223372036854776.000                                                            
[matroska,webm @ 0x559af05b5300] format: start_time: 0.000 duration: 49.583 bitrate=571 kb/s                                                            
[matroska,webm @ 0x559af05b5300] After avformat_find_stream_info() pos: 176554 bytes read:196608 seeks:0 frames:41                                      
Input #0, matroska,webm, from '/D/sintel/sintel720_aom_500.webm':
  Metadata:
    encoder         : libwebm-0.2.1.0
  Duration: 00:00:49.58, start: 0.000000, bitrate: 571 kb/s
    Stream #0:0(eng), 41, 1/1000: Video: av1 (Main), 1 reference frame, yuv420p(tv), 720x306, 0/1, SAR 1:1 DAR 40:17, 24 fps, 24 tbr, 1k tbn, 1k tbc (default)
Successfully opened the file.
Parsing a group of options: output url test.mkv.                                                                                                        
Applying option c:v (codec name) with argument libx264.                                                                                                 
Applying option b:v (video bitrate (please use -b:v)) with argument 2000k.                                                                              
Successfully parsed a group of options.                                                                                                                 
Opening an output file: test.mkv.                                                                                                                       
[file @ 0x559af05c7780] Setting default whitelist 'file,crypto'                                                                                         
Successfully opened the file.                                                                                                                           
detected 6 logical cores                                                                                                                                
[libaom-av1 @ 0x559af0648d80] 1.0.0
[libaom-av1 @ 0x559af0648d80] -G "Ninja" -DAOM_TARGET_CPU=x86_64
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libaom-av1) -> h264 (libx264))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'video_size' to value '720x306'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'time_base' to value '1/1000'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] Setting 'frame_rate' to value '24/1'
[graph 0 input from stream 0:0 @ 0x559af21dcf00] w:720 h:306 pixfmt:yuv420p tb:1/1000 fr:24/1 sar:1/1 sws_param:flags=2
[format @ 0x559af21dd400] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le|gray|gray10le'
[AVFilterGraph @ 0x559af05c6680] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[libx264 @ 0x559af0626240] using mv_range_thread = 24
[libx264 @ 0x559af0626240] using SAR=1/1
[libx264 @ 0x559af0626240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x559af0626240] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x559af0626240] 264 - core 157 r2945 72db437 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[matroska @ 0x559af0645700] get_metadata_duration returned: 0
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf58.28.101
    Stream #0:0(eng), 0, 1/1000: Video: h264 (libx264), 1 reference frame (H264 / 0x34363248), yuv420p, 720x306 [SAR 1:1 DAR 40:17], 0/1, q=-1--1, 2000 kb/s, 24 fps, 1k tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc58.53.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: -1
Clipping frame in rate conversion by 0.000008
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Ошибка сегментирования (стек памяти сброшен на диск)
}}}

Segfault also appears when I try to simply play webm with ffmpeg.

ffmpeg version N-94150-g231d0c819f
built on Arch Linux x86_64

Attachments (1)

sintel720_aom_500_1-001.webm (1.1 MB ) - added by Ilya87 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Elon Musk, 2 years ago

I see only cryptic text, no crash dump and no backtrace.

by Ilya87, 2 years ago

comment:2 by Ilya87, 2 years ago

Try to reproduce with uploaded file.

comment:3 by Elon Musk, 2 years ago

Why would I? You first need to give proof that crash happens in FFmpeg code.

comment:4 by Ilya87, 2 years ago

The crash appeared and if you want a "proof" and don't want to type

ffplay inputfilename

to reproduce the bug, provide me please ffmpeg_g with needed libs.

Last edited 2 years ago by Ilya87 (previous) (diff)

comment:5 by Ilya87, 2 years ago

Resolution: invalid
Status: newclosed

It is not ffmpeg bug. libaom does not support decoding files that were encoded with --aq-mode=2.

Note: See TracTickets for help on using tickets.