Crash in util_idalloc_resize due to glBindTexture with a way-too-large ID
Looking at a crash dump from hl.exe (Half Life), I see the app called glBindTexture
with 0xfffff574. We create a new texture object since that's not an already-existing texture, and successfully insert it into the hash map, but then we try to go notify the ID allocator that this name is now occupied, and crash because that allocator isn't sparse. It's just a bit-vector, so it tries to resize to 0x7ffffab 32-bit entries, fails to allocate, and crashes.
We should be robust against this.
Call stack:
00 x86 OpenGLOn12!memset
01 x86 OpenGLOn12!util_idalloc_resize
02 x86 OpenGLOn12!util_idalloc_reserve
03 x86 OpenGLOn12!_mesa_HashInsertLocked
04 x86 OpenGLOn12!_mesa_HashInsert
05 x86 OpenGLOn12!_mesa_lookup_or_create_texture
06 x86 OpenGLOn12!bind_texture
07 x86 OpenGLOn12!_mesa_BindTexture
08 x86 OpenGLOn12!glBindTexture
/cc @hakzsam as the guy whose name is at the top of u_idalloc.c