amdgpu heap use after free
Using the current development version of the free game widelands (git clone https://github.com/widelands/widelands.git), I see a heap use after free using the amdgpu driver. The issue is the same both for Vega and Navi.
The game is built with address sanitizer by default (so this heap use results in a crash):
==336086==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060001cd870 at pc 0x7f64587dbdf8 bp 0x7ffdb45edbe0 sp 0x7ffdb45ed390
READ of size 7 at 0x6060001cd870 thread T0
#0 0x7f64587dbdf7 (/lib/x86_64-linux-gnu/libasan.so.5+0x64df7)
#1 0x7f644e870f04 (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so+0x4b5f04)
#2 0x7f644e82c6c6 (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so+0x4716c6)
#3 0x7f644e82e442 (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so+0x473442)
#4 0x7f644e65f601 (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so+0x2a4601)
#5 0x55e9949e925b in Gl::Program::build(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ../src/graphic/gl/utils.cc:158
#6 0x55e994eac959 in WorkareaProgram::WorkareaProgram() ../src/graphic/gl/workarea_program.cc:28
#7 0x55e9949f57e0 in RenderQueue::RenderQueue() ../src/graphic/render_queue.cc:146
#8 0x55e9949f5961 in RenderQueue::instance() ../src/graphic/render_queue.cc:153
My original widelands bug report is at https://github.com/widelands/widelands/issues/3950, but widelands developers say they think this is a driver bug.
I use Debian GNU/Linux, a mixture of testing,. unstable, experimental on a MSI Bravo 15 (Ryzen 7 4800H + Radeon RX 5500M). Mesa version is 20.1.1. libdrm-amdgpu is 2.4.102.