Module Name:    src
Committed By:   rin
Date:           Fri Nov  1 20:53:10 UTC 2019

Modified Files:
        src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Workaround for random crash of userland binaries, as reported in
PR port-alpha/54307.

If rtree.c and tcache.c are compiled with -O0, userland just works
without problems as far as I can see. Alternately, you can specify
-DJEMALLOC_DEBUG to avoid random crash. Smells like compiler bug,
or wrong coding which relies on some undefined behavior.

Anyway, we need to pull this up into netbsd-9 asap.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/jemalloc/lib/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.10 src/external/bsd/jemalloc/lib/Makefile.inc:1.11
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.10	Tue Jul 23 06:31:20 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Fri Nov  1 20:53:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2019/07/23 06:31:20 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2019/11/01 20:53:10 rin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,6 +51,14 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
+.if ${MACHINE} == "alpha"
+# These files need to be compiled with -O0, or build everything with
+# -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
+# reported in port-alpha/54307.
+COPTS.rtree.c+=-O0
+COPTS.tcache.c+=-O0
+.endif
+
 .if ${MACHINE_ARCH} == "vax"
 # in merge_overlapping_regs, at regrename.c
 COPTS.arena.c+=-O0

Reply via email to