Osu: Video decoder null reference exception on startup

Created on 21 Feb 2020  路  17Comments  路  Source: ppy/osu

Describe the crash:
The OSU program crashes on initialization with the following error messages.

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at osu.Framework.Graphics.Video.VideoDecoder.GetConversionMatrix()
   at osu.Framework.Graphics.Video.VideoSprite.get_ConversionMatrix()
   at osu.Framework.Graphics.Video.VideoSpriteDrawNode..ctor(VideoSprite source)
   at osu.Framework.Graphics.Video.VideoSprite.CreateDrawNode()
   at osu.Framework.Graphics.Drawable.GenerateDrawNodeSubtree(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.GenerateDrawNodeSubtree(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode)
   at osu.Framework.Platform.GameHost.UpdateFrame()
   at osu.Framework.Threading.GameThread.ProcessFrame()
   at osu.Framework.Threading.GameThread.runWork()
--- End of stack trace from previous location where exception was thrown ---
   at osu.Framework.Platform.GameHost.<>c__DisplayClass93_0.<handleException>b__0()
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Threading.GameThread.ProcessFrame()
   at osu.Framework.Platform.GameHost.handleInput()
   at osuTK.GameWindow.RaiseUpdateFrame(Stopwatch watch, Double elapsed, Double& timestamp)
   at osuTK.GameWindow.DispatchUpdateFrame(Stopwatch watch)
   at osuTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at osuTK.GameWindow.Run()
   at osu.Framework.Platform.GameWindow.Run()
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu.Desktop.Program.Main(String[] args) in /var/lib/buildkite-agent/builds/debian-gnu-linux-vm-1/ppy/osu/osu.Desktop/Program.cs:line 57
Aborted (core dumped)

It seems to be related to this PR since the bug does not exist before #7935 update-framework.

osu!lazer version:
Commits after 000787a766582bd43fae3464908bcb05e3385b36.

Computer Specifications:

  • Ubuntu 18.04.4 LTS
  • Memory 15.6 GB
  • Processor Intel Core i7-4720HQ
  • Graphics GeForce GTX 965M
framework-fix-required linux crash

Most helpful comment

While this crash should be better-handled framework-side, at least in my case it turned out that one of the issues was a missing libavformat.so. Therefore for the time being you could try to install the distribution-appropriate packages containing libavformat.

Confirmation that this is the case for you can be obtained by examining runtime logs (should have an entry about missing libraries right before the crash stack) or passing LD_DEBUG=libs.

For example, on my xenial 16.04, I got video fully working by installing ffmpeg 4 along with libavformat & co. from an external PPA. Note that installing ffmpeg pre-v4 might alleviate crashes, but not make video work as framework does not currently support those versions (the decoding process is missing av_register_all() calls at the start of decoding, which are no longer necessary and therefore deprecated with version 4).

Also please double-check that your symlinks in /usr/lib/x86_64-linux-gnu or similar are correctly hooked up. The root .sos should be pointing at new libavcodec/libavformat versions, not any old ones possibly leftover from the default ubuntu install.

All 17 comments

Please try installing ffmpeg

ffmpeg 3.4.6-0ubuntu0.18.04.1 is installed

I'm getting this error as well, I also have ffmpeg installed

  ~ ffmpeg -version
ffmpeg version 4.1.4-1build2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9 (Ubuntu 9.2.1-4ubuntu1)

I'm running Xubuntu 19.10
16GB RAM
Intel Xeon E3-1231 V3
GTX 970 (driver 435.21)

Also having this problem with ffmpeg installed:

ffmpeg -version
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libavresample   3.  7.  0 /  3.  7.  0
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100

Edit: Running Ubuntu 18.04 w/ Gallium OS on Samsung Chromebook 3
It used to work when I built it myself (now does not).

Maybe related to the ffmpeg version. I'm running Arch Linux with ffmpeg 4.2.2 and do not have this issue.

Can reproduce, investigating.

While this crash should be better-handled framework-side, at least in my case it turned out that one of the issues was a missing libavformat.so. Therefore for the time being you could try to install the distribution-appropriate packages containing libavformat.

Confirmation that this is the case for you can be obtained by examining runtime logs (should have an entry about missing libraries right before the crash stack) or passing LD_DEBUG=libs.

For example, on my xenial 16.04, I got video fully working by installing ffmpeg 4 along with libavformat & co. from an external PPA. Note that installing ffmpeg pre-v4 might alleviate crashes, but not make video work as framework does not currently support those versions (the decoding process is missing av_register_all() calls at the start of decoding, which are no longer necessary and therefore deprecated with version 4).

Also please double-check that your symlinks in /usr/lib/x86_64-linux-gnu or similar are correctly hooked up. The root .sos should be pointing at new libavcodec/libavformat versions, not any old ones possibly leftover from the default ubuntu install.

Maybe related to the ffmpeg version. I'm running Arch Linux with ffmpeg 4.2.2 and do not have this issue.

I have the same version of ffmpeg with you on openSUSE Tumbleweed but it still crashes.

Looks like osu! wants to open 'libavformat.so' which is a symlink which should be only used for linking while building software and is included in development packages only (libavformat-dev in Ubuntu) and won't be normally installed on an end-user computer.
On runtime a specific soname should be used, like 'libavformat.so.58' for the version included in Mint 19.3 / Ubuntu bionic.

Installing the 'libavformat-dev' package in Ubuntu is a working workaround for me, but this should not be needed.

@Jajcus See #7963, in particular this comment. If there is a bundlable LGPL-licensed ffmpeg binary package that will work cross-distro, we could consider bundling it.

Installing libavformat-dev via apt fixes issue for me too on my Pop!_OS 19.10 which is Ubuntu based.

Temporarily reopening until next framework bump & release due to number of incoming duplicates to hopefully aid visibility and avoid getting more.

This should be fixed now on v2020.225.0, can be closed.

And this is still an issue for Ubuntu 20.04 with libavformat58...

@TechAdvancedCyborg We are aware that linux distros that don't bundle ffmpeg 4 in their package lists will run into issues with video playback (see the aforementioned issue at #7963). It however should not be crashing.

Unless you are actually experiencing crashes please refrain from posting such comments as they are not helpful. Fixing the library issue is not a top priority right now and we have limited bandwidth.

It's a very similar error message but not due to the same reasons, the issue I'm experiencing is from osu! frame stability counter, it just crashes on launch >50% of the time only on Linux

If you expect the problem to be resolved then please post the actual error message and as many other pertinent details as you can think of, preferably in a new issue. The information you have provided thus far is not actionable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elweojus picture elweojus  路  3Comments

czapek1337 picture czapek1337  路  3Comments

Gonzalo-Bruna picture Gonzalo-Bruna  路  3Comments

stageosu picture stageosu  路  3Comments

Fatal3ty picture Fatal3ty  路  3Comments