av1 packetizer crash in vlc 4.0 4.0.0-dev-4986-g44c2b2af
I have a crash with Elecard test videos, e.g. https://www.elecard.com/storage/video/Stream2_AV1_HD_6.8mbps.webm:
thresh@coal videolan/vlc/build $ ./vlc -vvv ~/Videos/Stream2_AV1_HD_6.8mbps.webm
VLC media player 4.0.0-dev Otto Chriek (revision 4.0.0-dev-4986-g44c2b2af3e)
[0000556429b33d10] main libvlc debug: VLC media player - 4.0.0-dev Otto Chriek
[0000556429b33d10] main libvlc debug: Copyright © 1996-2018 the VideoLAN team
[0000556429b33d10] main libvlc debug: revision 4.0.0-dev-4986-g44c2b2af3e
[0000556429b33d10] main libvlc debug: configured with ../configure '--disable-chromecast' '--disable-qt' '--disable-chromaprint' '--disable-optimizations' '--enable-debug'
[0000556429b33d10] main libvlc debug: searching plug-in modules
[0000556429b33d10] main libvlc debug: loading plugins cache file /home/thresh/projects/videolan/vlc/build/modules/plugins/plugins.dat
[0000556429b33d10] main libvlc warning: cannot read /home/thresh/projects/videolan/vlc/build/modules/plugins/plugins.dat: No such file or directory
[0000556429b33d10] main libvlc debug: recursively browsing `/home/thresh/projects/videolan/vlc/build/modules/plugins'
[0000556429b33d10] main libvlc debug: loading plugins cache file /home/thresh/projects/videolan/vlc/build/modules/plugins.dat
[0000556429b33d10] main libvlc debug: recursively browsing `/home/thresh/projects/videolan/vlc/build/modules'
[0000556429b33d10] main libvlc debug: plug-ins loaded: 469 modules
[0000556429b33d10] main libvlc debug: opening config file (/home/thresh/.config/vlc/vlcrc)
[0000556429b34050] main logger debug: looking for logger module matching "any": 3 candidates
[0000556429b34050] main logger debug: using logger module "console"
[0000556429b33d10] main libvlc debug: translation test: code is "C"
[0000556429bd1500] main keystore debug: looking for keystore module matching "memory": 2 candidates
[0000556429bd1500] main keystore debug: using keystore module "memory"
[0000556429b33d10] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FPU
[0000556429bc1cd0] main medialibrary debug: looking for medialibrary module matching "any": 1 candidates
[0000556429bc1cd0] main medialibrary debug: using medialibrary module "medialibrary"
[0000556429bd97a0] main playlist debug: creating audio output
[0000556429bd3630] main audio output debug: looking for audio output module matching "any": 4 candidates
[0000556429bd3630] vlcpulse audio output debug: using library version 12.2.0
[0000556429bd3630] vlcpulse audio output debug: (compiled with version 12.2.0, protocol 32)
[0000556429bd3630] vlcpulse audio output debug: connected locally to unix:/run/user/1000/pulse/native as client [#1128](https://code.videolan.org/videolan/vlc/-/issues/1128)
[0000556429bd3630] vlcpulse audio output debug: using protocol 32, server protocol 32
[0000556429bd3630] pulse audio output debug: adding sink 0: alsa_output.pci-0000_00_1f.3.analog-stereo (Встроенное аудио Аналоговый стерео)
[0000556429bd3630] main audio output debug: using audio output module "pulse"
[0000556429bd97a0] main playlist debug: keeping audio output
[0000556429bf2b60] main interface debug: looking for interface module matching "hotkeys,none": 11 candidates
[00007fe998000c20] main input debug: Creating an input for preparsing 'Stream2_AV1_HD_6.8mbps.webm'
[0000556429bf2b60] main interface debug: using interface module "hotkeys"
[0000556429bcd5d0] main interface debug: looking for interface module matching "globalhotkeys,none": 11 candidates
[0000556429bcd5d0] main interface debug: no interface modules matched
[0000556429bcd5d0] main interface error: no suitable interface module
[0000556429b33d10] main libvlc error: interface "globalhotkeys,none" initialization failed
[0000556429b33d10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000556429bcd5d0] main interface debug: looking for interface module matching "any": 11 candidates
[0000556429bcd5d0] [cli] lua interface debug: Found lua interface script: /home/thresh/projects/videolan/vlc/share/lua/intf/cli.lua
[0000556429bcd5d0] [cli] main interface debug: using interface module "lua"
[0000556429bd97a0] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0000556429bd97a0] main playlist debug: rebuilding array of current - root Playlist
[0000556429bd97a0] main playlist debug: rebuild done - 1 items, index -1
[0000556429bd97a0] main playlist debug: starting playback of new item
[0000556429bd97a0] main playlist debug: resyncing on Stream2_AV1_HD_6.8mbps.webm
[0000556429bd97a0] main playlist debug: Stream2_AV1_HD_6.8mbps.webm is at 0
[0000556429bd97a0] main playlist debug: creating new input thread
[00007fe994000c50] main input debug: Creating an input for 'Stream2_AV1_HD_6.8mbps.webm'
[0000556429bd97a0] main playlist debug: requesting art for new input thread
[00007fe994000c50] main input debug: using timeshift granularity of 50 MiB
[00007fe994000c50] main input debug: using default timeshift path
[00007fe994000c50] main input debug: `file:///home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm' gives access `file' demux `any' path `/home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm'
[00007fe988000f80] main access debug: creating access: file:///home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm
[00007fe988000f80] main access debug: (path: /home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm)
[00007fe988000f80] main access debug: looking for access module matching "file": 42 candidates
[00007fe988000f80] main access debug: using access module "filesystem"
[00007fe984000bf0] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007fe9880015b0] main stream filter debug: looking for stream_filter module matching "prefetch,cache": 26 candidates
[00007fe984000bf0] lua meta fetcher debug: Trying Lua scripts in /home/thresh/.local/share/vlc/lua/meta/fetcher
[00007fe9880015b0] cache_read stream filter debug: Using stream method for AStream*
[00007fe984000bf0] lua meta fetcher debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/build/modules/lua/meta/fetcher
[00007fe9880015b0] cache_read stream filter debug: starting pre-buffering
[00007fe984000bf0] lua meta fetcher debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/share/lua/meta/fetcher
[00007fe9880015b0] cache_read stream filter debug: received first data after 0 ms
[00007fe9880015b0] cache_read stream filter debug: pre-buffering done 1024 bytes in 0s - 22222 KiB/s
[00007fe9880015b0] main stream filter debug: using stream_filter module "cache_read"
[00007fe984000bf0] main meta fetcher debug: no meta fetcher modules matched
[00007fe988001950] main stream filter debug: looking for stream_filter module matching "any": 26 candidates
[00007fe984000bf0] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007fe988001950] lua stream filter debug: Trying Lua scripts in /home/thresh/.local/share/vlc/lua/playlist
[00007fe988001950] lua stream filter debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/build/modules/lua/playlist
[00007fe988001950] lua stream filter debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/share/lua/playlist
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/anevia_streams.lua
[00007fe984000bf0] lua art finder debug: Trying Lua scripts in /home/thresh/.local/share/vlc/lua/meta/art
[00007fe984000bf0] lua art finder debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/build/modules/lua/meta/art
[00007fe984000bf0] lua art finder debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/share/lua/meta/art
[00007fe984000bf0] lua art finder debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/meta/art/00_musicbrainz.lua
[00007fe984000bf0] lua art finder debug: skipping script (unmatched scope) /home/thresh/projects/videolan/vlc/share/lua/meta/art/00_musicbrainz.lua
[00007fe984000bf0] lua art finder debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/meta/art/01_googleimage.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/anevia_xml.lua
[00007fe984000bf0] lua art finder debug: skipping script (unmatched scope) /home/thresh/projects/videolan/vlc/share/lua/meta/art/01_googleimage.lua
[00007fe984000bf0] lua art finder debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/meta/art/02_frenchtv.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/appletrailers.lua
[00007fe984000bf0] lua art finder debug: skipping script (unmatched scope) /home/thresh/projects/videolan/vlc/share/lua/meta/art/02_frenchtv.lua
[00007fe984000bf0] lua art finder debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/meta/art/03_lastfm.lua
[00007fe984000bf0] lua art finder debug: skipping script (unmatched scope) /home/thresh/projects/videolan/vlc/share/lua/meta/art/03_lastfm.lua
[00007fe984000bf0] main art finder debug: no art finder modules matched
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/bbc_co_uk.lua
[0000556429bcd5d0] [cli] lua interface: Listening on host "*console".
VLC media player 4.0.0-dev Otto Chriek
Command Line Interface initialized. Type `help' for help.
[00007fe988001950] > lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/break.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/cue.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/dailymotion.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/extreme.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/france2.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/jamendo.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/katsomo.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/koreus.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/lelombrik.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/liveleak.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/metacafe.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/mpora.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/newgrounds.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/pinkbike.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/rockbox_fm_presets.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/soundcloud.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/twitch.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/vimeo.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/vocaroo.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/youtube.lua
[00007fe988001950] lua stream filter debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/playlist/zapiks.lua
[00007fe988001950] main stream filter debug: no stream_filter modules matched
[00007fe9880265f0] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[00007fe9880265f0] main stream_directory debug: no stream_directory modules matched
[00007fe988000d60] main input source debug: attachment of directory-extractor failed for file:///home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm
[00007fe98800aa20] main stream filter debug: looking for stream_filter module matching "record": 26 candidates
[00007fe98800aa20] main stream filter debug: using stream_filter module "record"
[00007fe988000d60] main input source debug: creating demux "any", URL: file:///home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm, path: /home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm
[00007fe988006f10] main demux debug: looking for demux module matching "any": 54 candidates
[00007fe988006f10] mkv demux debug: | + Seek head
[00007fe988006f10] mkv demux debug: | - info at 158
[00007fe988006f10] mkv demux debug: | + Information
[00007fe988006f10] mkv demux debug: | | + TimecodeScale=1000000
[00007fe988006f10] mkv demux debug: | | + Duration=144120
[00007fe988006f10] mkv demux debug: | | + Muxing Application=libwebm-0.2.1.0
[00007fe988006f10] mkv demux debug: | | + Writing Application=aomenc 1.0.0
[00007fe988006f10] mkv demux debug: | - tracks at 210
[00007fe988006f10] mkv demux debug: | + Tracks
[00007fe988006f10] mkv demux debug: | | + Track Entry
[00007fe988006f10] mkv demux debug: | | | + Track Number=1
[00007fe988006f10] mkv demux debug: | | | + Track UID=d70c689f
[00007fe988006f10] mkv demux debug: | | | + Track Type=video
[00007fe988006f10] mkv demux debug: | | | + Track CodecId=V_AV1
[00007fe988006f10] mkv demux debug: | | | + Track Video
[00007fe988006f10] mkv demux debug: | | | | + width=1920
[00007fe988006f10] mkv demux debug: | | | | + height=1080
[00007fe988006f10] mkv demux debug: | - cues at 122377569
[00007fe988006f10] mkv demux debug: | + Cues
[00007fe988006f10] mkv demux debug: MKV/Ebml Parser: m_el[mi_level] == NULL
[00007fe988006f10] mkv demux debug: | - loading cues done.
[00007fe988006f10] mkv demux debug: | + Void
[00007fe988006f10] mkv demux debug: | + Information
[00007fe988006f10] mkv demux debug: | + Tracks
[00007fe988006f10] mkv demux debug: | + Cluster
[00007fe988006f10] mkv demux debug: NEW START CHAPTER uid=0
[00007fe988006f10] mkv demux debug: found 1 es
[00007fe994000c50] main input debug: selecting program id=0
[00007fe988006f10] mkv demux debug: seek: preroll{ track: 1, pts: 0, fpos: 265 skip: 265}
[00007fe988006f10] mkv demux debug: seek: preroll{ req: 1, start-pts: 1, start-fpos: 265}
[00007fe988006f10] main demux debug: using demux module "mkv"
[00007fe994000c50] main input debug: looking for a subtitle file in /home/thresh/Videos/
[00007fe9880190a0] main packetizer debug: looking for packetizer module matching "any": 25 candidates
[00007fe9880190a0] main packetizer debug: using packetizer module "av1"
[00007fe988024e60] main decoder debug: looking for video decoder module matching "any": 16 candidates
[00007fe988024e60] aom decoder debug: AV1: using libaom version v1.0.0 (build options cmake ../ -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="../../toolchain.cmake" -DCONFIG_PIC=1 -DCONFIG_RUNTIME_CPU_DETECT=1 -DENABLE_DOCS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF)
[00007fe988024e60] main decoder debug: using video decoder module "aom"
[00007fe98801df10] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[00007fe98801df10] lua demux meta debug: Trying Lua scripts in /home/thresh/.local/share/vlc/lua/meta/reader
[00007fe98801df10] lua demux meta debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/build/modules/lua/meta/reader
[00007fe98801df10] lua demux meta debug: Trying Lua scripts in /home/thresh/projects/videolan/vlc/share/lua/meta/reader
[00007fe98801df10] lua demux meta debug: Trying Lua playlist script /home/thresh/projects/videolan/vlc/share/lua/meta/reader/filename.lua
[00007fe98801df10] main demux meta debug: no meta reader modules matched
[00007fe994000c50] main input debug: `file:///home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm' successfully opened
[00007fe9880190a0] av1 packetizer warning: Invalid OBU header in sequence, discarding
[00007fe9880190a0] av1 packetizer warning: Invalid OBU header in sequence, discarding
double free or corruption (!prev)
zsh: abort (core dumped) ./vlc -vvv ~/Videos/Stream2_AV1_HD_6.8mbps.webm
thresh@coal videolan/vlc/build $ ls -la core
-rw------- 1 thresh 317173760 окт 4 19:45 core
thresh@coal videolan/vlc/build $ gdb --core=core ./vlc
GNU gdb (Debian 8.1-4+b1) 8.1
Copyright (C) 2018 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".
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 ./vlc...done.
warning: core file may not match specified executable file.
[New LWP 14842]
[New LWP 14835]
[New LWP 14836]
[New LWP 14833]
[New LWP 14838]
[New LWP 14840]
[New LWP 14834]
[New LWP 14839]
[New LWP 14837]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./vlc -vvv /home/thresh/Videos/Stream2_AV1_HD_6.8mbps.webm'.
Program terminated with signal SIGABRT, Aborted.
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x00007fe9b965bf3b in raise () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7fe98fdfd700 (LWP 14842))]
(gdb) bt
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x00007fe9b965bf3b in raise () from /lib/x86_64-linux-gnu/libc.so.6
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x00007fe9b965d2f1 in abort () from /lib/x86_64-linux-gnu/libc.so.6
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0x00007fe9b969e867 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x00007fe9b96a4e0a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0x00007fe9b96a68cc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x00007fe98e44f5ab in PacketizeOBU (p_dec=0x7fe9880190a0, pp_block=<optimized out>) at ../../modules/packetizer/av1.c:443
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x00007fe9b9a001ed in DecoderProcess (p_dec=p_dec@entry=0x7fe988024e60, p_block=p_block@entry=0x7fe98805f130) at ../../src/input/decoder.c:1407
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) 0x00007fe9b9a007cd in DecoderThread (p_data=<optimized out>) at ../../src/input/decoder.c:1661
[#8](https://code.videolan.org/videolan/vlc/-/issues/8) 0x00007fe9b97eaf2a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
[#9](https://code.videolan.org/videolan/vlc/-/issues/9) 0x00007fe9b971dedf in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) f 5
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x00007fe98e44f5ab in PacketizeOBU (p_dec=0x7fe9880190a0, pp_block=<optimized out>) at ../../modules/packetizer/av1.c:443
443 block_Release(p_frag);
(gdb) p *p_frag
$1 = {p_next = 0x0,
p_buffer = 0x7fe98805f266 "\316\t\363z\277H\375\025\066볈Gm\340\n\236'\375.\240J\026\336e\342\223J\250\251\275n\224\001;MFc \325\376\332\001\065\363\066\361\373\n\217:\036\370\317#\022\r2\343\364g5\356Sh\t\375\250\363kL}\r\003G5\017d?\264\254\234i\317J\216\264j\271$&\343\265N\252\036\332\313.\346.t\256\377ODз\364\257c\241\"I\003\251\233jK\255\f\322\061\036\223\071Ԋ\303L^\203\242ԝ\nJ\353\366\313\344\003z\243Ĩ\340\376\024\376PU\243\067vY\226\025\210\202\314YH\340\252JKT(\312T\a1#\275\331\360\312O\n\222\273yI\006\262\005+k+\272\276\364\226\023d\302V\264", <incomplete sequence \310>..., i_buffer = 132352,
p_start = 0x7fe98805f180 "", i_size = 132646, i_flags = 0, i_nb_samples = 0, i_pts = 0, i_dts = 0, i_length = 0, cbs = 0x7fe9b9aa7d80 <block_generic_cbs>}
(gdb) f 6
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x00007fe9b9a001ed in DecoderProcess (p_dec=p_dec@entry=0x7fe988024e60, p_block=p_block@entry=0x7fe98805f130) at ../../src/input/decoder.c:1407
1407 while( (p_packetized_block =