Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
0ad: double datasize to avoid crashes
To:
ports@openbsd.org
Date:
Sun, 19 May 2024 13:42:45 +0000

Download raw body.

Thread
My user is not in the 'staff' group and its default 1572864 is enough to
start playing a serious game, which eventually crashes when, I presume,
the world gets big enough.

Losing your game/progress like that sucks, so I just doubled the limit
and have been playing without crashes ever since.

Is this fair enough to include in ports or should we aim for a specific
limit?  I see the chromium ports have more logic to a) ensure a limit
and b) present a choice when raising it fails, but none of that was
needed for me so far, hence the simple diff.

Feedback? OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/0ad/base/Makefile,v
diff -u -p -r1.51 Makefile
--- Makefile	6 May 2024 12:23:33 -0000	1.51
+++ Makefile	19 May 2024 10:05:32 -0000
@@ -2,7 +2,7 @@ COMMENT =		historical real-time strategy
 
 DISTNAME =		0ad-${V}-alpha-unix-build
 PKGNAME =		0ad-${V}
-REVISION =		6
+REVISION =		7
 
 USE_WXNEEDED =		Yes
 USE_NOBTCFI =		Yes
Index: patches/patch-build_resources_0ad_sh
===================================================================
RCS file: patches/patch-build_resources_0ad_sh
diff -N patches/patch-build_resources_0ad_sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-build_resources_0ad_sh	19 May 2024 11:26:28 -0000
@@ -0,0 +1,13 @@
+(Try to) Double datasize to avoid ENOMEM crashes during (big) games
+
+Index: build/resources/0ad.sh
+--- build/resources/0ad.sh.orig
++++ build/resources/0ad.sh
+@@ -2,6 +2,7 @@
+ 
+ pyrogenesis=$(which pyrogenesis 2> /dev/null)
+ if [ -x "$pyrogenesis" ] ; then
++  ulimit -d $((2 * `ulimit -d`))
+   "$pyrogenesis" "$@"
+ else
+   echo "Error: pyrogenesis not found in ($PATH)"