Wednesday, March 08, 2023

Non-standard allocations in games/vkquake

Hi,

I installed vkquake on my x13s laptop (arm64) but it didn't work.
After a short debug I found it is a memory allocation error (actually
NULL-dereferencing after a failed allocation).

It seems that this port is using it's own memory allocation (mimalloc)
and after I forced it to use standard allocation functions it didn't
showed those memory problem again.

Isn't it old enough that works fast enough without those optimizations?

Index: patches/patch-Quake_Makefile
===================================================================
RCS file: /home/cvs/ports/games/vkquake/patches/patch-Quake_Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 patch-Quake_Makefile
--- patches/patch-Quake_Makefile 23 Oct 2022 14:59:26 -0000 1.7
+++ patches/patch-Quake_Makefile 9 Mar 2023 06:49:13 -0000
@@ -1,27 +1,20 @@
remove hardcoded optimization flag
+use standard library for allocation

Index: Quake/Makefile
--- Quake/Makefile.orig
+++ Quake/Makefile
-@@ -29,7 +29,7 @@ VORBISLIB=vorbis
- # Helper functions
- # ---------------------------
-
--check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)
-+check_gcc = $(shell if echo | $(CC) $(1) -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)
-
- # ---------------------------
-
-@@ -51,7 +51,7 @@ LDFLAGS ?=
+@@ -51,15 +51,15 @@ LDFLAGS ?=
DFLAGS ?=
CFLAGS ?=

-CFLAGS += -Wall -Wno-trigraphs -Wno-unused-function -Werror -std=gnu11 -MMD
+CFLAGS += -Wall -Wno-trigraphs -Wno-unused-function -std=gnu11 -MMD
CFLAGS += $(CPUFLAGS)
++CFLAGS += -DUSE_CRT_ALLOC
ifneq ($(DEBUG),0)
DFLAGS += -D_DEBUG
-@@ -59,7 +59,6 @@ CFLAGS += -g
+ CFLAGS += -g
do_strip=
else
DFLAGS += -DNDEBUG

No comments:

Post a Comment