Segfault after unset of prefix cvar
The following commands currently crash a build from git for me:
set foo 0
set foobar 0
unset foo
unset foobar
set foo 0
- Also crashes when removing
set foobar 0
. - Doesn't crash when replacing
foobar
withfozbar
.
So the condition seems to be:
- Unset an existing cvar,
- unset a second cvar having the first as prefix (existing or not),
- then it crashes on assignment of the first cvar
This is on updated Arch Linux.
Coredump backtrace:
#0 0x00007f272bf9bc33 in () at /usr/lib/libc.so.6
#1 0x000055e7f88cdcd3 in Cvar_FindVar (cvars=0x55e7f95b0b20 <cvars_all>, var_name=0x55e7faf500ac "foo", neededflags=-1) at ../../../cvar.c:44
#2 0x000055e7f88d088d in Cvar_Set_f (cmd=0x55e7faf54210) at ../../../cvar.c:1058
#3 0x000055e7f88a8030 in Cmd_Callback (cmd=0x55e7faf54210, func=0x55e7faf55090, text=0x7ffc6ad988f0 "set foo 0", src=src_local) at ../../../cmd.c:2094
#4 0x000055e7f88a814a in Cmd_CL_Callback (cmd=0x55e7faf54210, func=0x55e7faf55090, text=0x7ffc6ad988f0 "set foo 0", src=src_local) at ../../../cmd.c:2125
#5 0x000055e7f88a830f in Cmd_ExecuteString (cmd=0x55e7faf54210, text=0x7ffc6ad988f0 "set foo 0", src=src_local, lockmutex=false) at ../../../cmd.c:2176
#6 0x000055e7f88a45c7 in Cbuf_Execute (cbuf=0x55e7faf50060) at ../../../cmd.c:384
#7 0x000055e7f8934873 in Host_AddConfigText (cmd=0x55e7faf54210) at ../../../host.c:240
#8 0x000055e7f89350b3 in Host_Init () at ../../../host.c:488
#9 0x000055e7f8935781 in Host_Main () at ../../../host.c:695
#10 0x000055e7f87e2335 in main (argc=4, argv=0x7ffc6ad9ceb8) at ../../../sys_sdl.c:224
Edited by ferreum