Here is a backtrace: #0 0x00007ffff61f4e08 in unlink_block (info=0x555555612a00) at ../src/util/ralloc.c:274 #1 ralloc_free (ptr=0x555555612a30) at ../src/util/ralloc.c:265 #2 ralloc_free (ptr=0x555555612a30) at ../src/util/ralloc.c:257 #3 0x00007ffff6135f0c in (anonymous namespace)::builtin_builder::release (this=0x7ffff711feb0 ) at ../src/compiler/glsl/builtin_functions.cpp:7662 #4 _mesa_glsl_builtin_functions_decref () at ../src/compiler/glsl/builtin_functions.cpp:7662 #5 0x00007ffff5f0a48d in _mesa_free_context_data (ctx=ctx@entry=0x55555586eb40, destroy_debug_output=destroy_debug_output@entry=false) at ../src/mesa/main/context.c:1405 #6 0x00007ffff5e9c237 in st_destroy_context (st=0x555555609a60) at ../src/mesa/state_tracker/st_context.c:1115 #7 0x00007ffff5e7da12 in dri_destroy_context (cPriv=) at ../src/gallium/frontends/dri/dri_context.c:247 #8 0x00007ffff63173d7 in driDestroyContext (pcp=0x5555555e85a0) at ../src/mesa/drivers/dri/common/dri_util.c:528 #9 0x00007ffff7643fb3 in dri3_destroy_context (context=0x5555555e8410) at ../src/glx/dri3_glx.c:181 #10 0x00007ffff762e539 in glXDestroyContext (ctx=0x5555555e8410, dpy=0x55555558d960) at ../src/glx/glxcmds.c:511 #11 glXDestroyContext (dpy=0x55555558d960, ctx=0x5555555e8410) at ../src/glx/glxcmds.c:492 #12 0x00007ffff7fb1934 in vdp::GLXManagedContext::destroy (this=0x55555560e668) at ./src/x-display-ref.hh:70 #13 vdp::GLXManagedContext::destroy (this=0x55555560e668) at ./src/glx-context.cc:79 #14 0x00007ffff7fb212e in vdp::GLXManagedContext::~GLXManagedContext (this=0x55555560e668, __in_chrg=) at ./src/glx-context.hh:54 #15 std::pair::~pair (this=0x55555560e660, __in_chrg=) at /usr/include/c++/9/bits/stl_pair.h:208 #16 __gnu_cxx::new_allocator > >::destroy > (this=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>, __p=0x55555560e660) at /usr/include/c++/9/ext/new_allocator.h:153 #17 std::allocator_traits > > >::destroy > (__a=..., __p=0x55555560e660) at /usr/include/c++/9/bits/alloc_traits.h:497 #18 std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_destroy_node ( this=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>, __p=0x55555560e640) at /usr/include/c++/9/bits/stl_tree.h:642 #19 std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_drop_node ( this=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>, __p=0x55555560e640) at /usr/include/c++/9/bits/stl_tree.h:650 #20 std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_erase ( this=this@entry=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>, __x=0x55555560e640) at /usr/include/c++/9/bits/stl_tree.h:1915 #21 0x00007ffff7fb1c7a in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::clear (this=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>) at /usr/include/c++/9/bits/stl_tree.h:1264 #22 std::map, std::allocator > >::clear (this=0x7ffff7fc7700 <(anonymous namespace)::g_glc_map>) at /usr/include/c++/9/bits/stl_map.h:1133 #23 vdp::GLXGlobalContext::~GLXGlobalContext (this=0x55555558d8f0, __in_chrg=) at ./src/glx-context.cc:195 #24 0x00007ffff7f9e3d6 in vdp::Device::Resource::~Resource (this=0x55555558d8a0, __in_chrg=) at ./src/api-device.cc:482 #25 0x00007ffff7f9f6a8 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55555558d890) at /usr/include/c++/9/bits/shared_ptr_base.h:148 #26 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55555558d890) at /usr/include/c++/9/bits/shared_ptr_base.h:148 #27 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555555e087e0, __in_chrg=) at /usr/include/c++/9/bits/shared_ptr_base.h:730 #28 std::__shared_ptr::~__shared_ptr (this=0x555555e087d8, __in_chrg=) at /usr/include/c++/9/bits/shared_ptr_base.h:1169 #29 std::shared_ptr::~shared_ptr (this=0x555555e087d8, __in_chrg=) at /usr/include/c++/9/bits/shared_ptr.h:103 #30 std::pair >::~pair (this=0x555555e087d0, __in_chrg=) at /usr/include/c++/9/bits/stl_pair.h:208 #31 __gnu_cxx::new_allocator > > >::destroy > > ( this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __p=0x555555e087d0) at /usr/include/c++/9/ext/new_allocator.h:153 #32 std::allocator_traits > > > >::destroy > > (__a=..., __p=0x555555e087d0) at /usr/include/c++/9/bits/alloc_traits.h:497 #33 std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_destroy_node (this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __p=0x555555e087b0) at /usr/include/c++/9/bits/stl_tree.h:642 #34 std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_drop_node (this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __p=0x555555e087b0) at /usr/include/c++/9/bits/stl_tree.h:650 #35 std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_erase (this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __x=0x555555e087b0) at /usr/include/c++/9/bits/stl_tree.h:1915 #36 0x00007ffff7fb878d in std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::~_Rb_tree (this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __in_chrg=) at /usr/include/c++/9/bits/stl_tree.h:994 #37 std::map, std::less, std::allocator > > >::~map ( this=0x7ffff7fc77c0 <(anonymous namespace)::storage+128>, __in_chrg=) at /usr/include/c++/9/bits/stl_map.h:300 #38 vdp::ResourceStorage::~ResourceStorage (this=0x7ffff7fc7798 <(anonymous namespace)::storage+88>, __in_chrg=) at ./src/handle-storage.hh:77 #39 ~(void) (this=0x7ffff7fc7740 <(anonymous namespace)::storage>, __in_chrg=) at ./src/handle-storage.cc:38 #40 0x00007ffff7a9fa57 in __run_exit_handlers (status=0, listp=0x7ffff7c3e738 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108 #41 0x00007ffff7a9fc00 in __GI_exit (status=) at exit.c:139 #42 0x00007ffff7a83cb9 in __libc_start_main (main=0x555555556280 , argc=1, argv=0x7fffffffdba8, init=, fini=, rtld_fini=, stack_end=0x7fffffffdb98) at ../csu/libc-start.c:348 #43 0x000055555555661e in _start () at vdpauinfo.cpp:507