ASAN crash when getting close to warpzone
if compiled with -fsanitize=address, DP crashes when I move near a warpzone
=================================================================
==3319==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000116f594 at pc 0x93f3e6 bp 0x7fff5d93a590 sp 0x7fff5d93a580
READ of size 4 at 0x00000116f594 thread T0
#0 0x93f3e5 in R_LoadTextureRenderBuffer ../../../gl_textures.c:1975
#1 0x8b6878 in R_Water_ProcessPlanes ../../../gl_rmain.c:6096
#2 0x8b7a71 in R_RenderWaterPlanes ../../../gl_rmain.c:7330
#3 0x8bbe2e in R_RenderView ../../../gl_rmain.c:7294
#4 0x6271ae in VM_CL_R_RenderScene ../../../clvm_cmds.c:3269
#5 0xdd3419 in CLVM_ExecuteProgram ../../../prvm_execprogram.h:496
#6 0x71c3aa in CL_VM_UpdateView ../../../csprogs.c:490
#7 0x5b8997 in SCR_DrawScreen ../../../cl_screen.c:2197
#8 0x5c0299 in CL_UpdateScreen ../../../cl_screen.c:2938
#9 0x95a327 in Host_Main ../../../host.c:1023
#10 0x40924c in main ../../../sys_sdl.c:223
#11 0x7f6dcbaa07ff in __libc_start_main (/usr/lib/libc.so.6+0x207ff)
#12 0x409e58 in _start (/home/matthias/vcs/git/xonotic/darkplaces/darkplaces-sdl+0x409e58)
0x00000116f594 is located 44 bytes to the left of global variable '*.LC142' from '../../../gl_textures.c' (0x116f5c0) of size 10
'*.LC142' is ascii string 'sRGB_dxt3'
0x00000116f594 is located 10 bytes to the right of global variable '*.LC141' from '../../../gl_textures.c' (0x116f580) of size 10
'*.LC141' is ascii string 'sRGB_dxt5'
SUMMARY: AddressSanitizer: global-buffer-overflow ../../../gl_textures.c:1975 R_LoadTextureRenderBuffer
Shadow bytes around the buggy address:
0x000080225e60: 00 00 00 02 f9 f9 f9 f9 00 00 00 01 f9 f9 f9 f9
0x000080225e70: 00 00 00 01 f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9
0x000080225e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000080225e90: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9
0x000080225ea0: 00 04 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9
=>0x000080225eb0: 00 02[f9]f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9
0x000080225ec0: 00 03 f9 f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9
0x000080225ed0: 00 00 00 01 f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9
0x000080225ee0: 00 00 f9 f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9
0x000080225ef0: 00 00 00 01 f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9
0x000080225f00: 00 00 f9 f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==3319==ABORTING
DP @ b1eb5e56