Weird munmap_chunk(): invalid pointer
crash when freeing pic
in R_FindImageFile()
#1598
Labels
munmap_chunk(): invalid pointer
crash when freeing pic
in R_FindImageFile()
#1598
I noticed a very weird
munmap_chunk(): invalid pointer
crash when freeingpic
inR_FindImageFile()
:Daemon/src/engine/renderer/tr_image.cpp
Line 1863 in 4cfabd4
I only reproduce it when testing on a very low end Raspberry PI 3. For example I don't reproduce it on my amd64 workstation, and I don't reproduce it on an orangepi5 board which is also arm64 like the rpi3, but more powerful.
At first I thought this could be some memory being missing, or other problems being caused by the fact such hardware is very low end.
But then I noticed the crash happened when freeing something. This is not caused by using a very old OpenGL. This is even not caused by the memory being to small.
The things is that if I comment out the
Z_Free( *pic );
line, the bug is gone and the game runs, while actually consuming more memory!I then suspected that we may have some memory corruption somewhere, and that under the specific conditions of that hardware it actually breaks something. But I always get that error when loading the
gfx/weapons/flamer/haze_n
image, not on other images loaded before it. This looks very reproducible for a memory corruption, I always reproduce it, and always at the same place whatever the build I use (Debug
,MinSizeRel
, running on debugger or not, using different HunkMeg sizes…).So, I don't know what is happening. But
Z_Free()
which just calls standardfree()
is falling here.I've checked it with some
printf()
, but the pointer is nevernull
when it fails.Also,
pic
is passed asconst
on functions called prior theZ_Free()
call, so it is very unlikely that the pointer get modified because of a bug.Also, the pointer address never changes once set, I've checked with some
printf()
.I remember it worked before 0.55.2 was released (I have not yet tested the 0.55.2 release).
The text was updated successfully, but these errors were encountered: