Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src Pull up following revision(s) (requested by rin in ticket...



details:   https://anonhg.NetBSD.org/src/rev/f62cfe7cde63
branches:  netbsd-9
changeset: 843461:f62cfe7cde63
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 03 11:41:57 2019 +0000

description:
Pull up following revision(s) (requested by rin in ticket #392):

        doc/HACKS: revision 1.195
        doc/HACKS: revision 1.196
        external/bsd/jemalloc/lib/Makefile.inc: revision 1.11
        external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h: revision 1.11

PR/54307: Rin Okuyama: Lots of jemalloc assertions in latest -current

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.

Describe workaround for PR port-alpha/54307.

Describe that both GCC 7.4 and 8.3 fail in the last entry.

diffstat:

 doc/HACKS                                                                |  11 +++++++++-
 external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h |   8 +++++-
 external/bsd/jemalloc/lib/Makefile.inc                                   |  10 ++++++++-
 3 files changed, 25 insertions(+), 4 deletions(-)

diffs (65 lines):

diff -r 3ffcb577d447 -r f62cfe7cde63 doc/HACKS
--- a/doc/HACKS Sun Nov 03 11:36:56 2019 +0000
+++ b/doc/HACKS Sun Nov 03 11:41:57 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.190 2019/05/14 02:53:16 maya Exp $
+# $NetBSD: HACKS,v 1.190.2.1 2019/11/03 11:41:57 martin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -929,3 +929,12 @@
 descr  Disable optimization for rtld.c on the vax with gcc-7. Crashes on the
        second pass loop with elm == 0xffffffff
 kcah
+
+port   alpha
+hack   GCC 7.4/8.3: userland binaries crash randomly (port-alpha/54307)
+cdate  Fri Nov  1 20:43:35 UTC 2019
+who    rin
+file   src/external/bsd/jemalloc/lib/Makefile.inc: 1.11
+descr  rtree.c and tcache.c need to be compiled with -O0, alternatively,
+       you can compile whole jemalloc with -DJEMALLOC_DEBUG.
+kcah
diff -r 3ffcb577d447 -r f62cfe7cde63 external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
--- a/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h  Sun Nov 03 11:36:56 2019 +0000
+++ b/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h  Sun Nov 03 11:41:57 2019 +0000
@@ -47,9 +47,13 @@
  */
 #ifdef _LP64
 /* XXX: I will take care of this later */
-#define LG_VADDR 48
+# ifdef __alpha__
+#  define LG_VADDR 43  /* bit 42 indicates direct map, 42--63 are same */
+# else
+#  define LG_VADDR 48
+# endif
 #else
-#define LG_VADDR 32
+# define LG_VADDR 32
 #endif
 
 /* Defined if C11 atomics are available. */
diff -r 3ffcb577d447 -r f62cfe7cde63 external/bsd/jemalloc/lib/Makefile.inc
--- a/external/bsd/jemalloc/lib/Makefile.inc    Sun Nov 03 11:36:56 2019 +0000
+++ b/external/bsd/jemalloc/lib/Makefile.inc    Sun Nov 03 11:41:57 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.10 2019/07/23 06:31:20 martin Exp $
+#      $NetBSD: Makefile.inc,v 1.10.2.1 2019/11/03 11:41:57 martin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,6 +51,14 @@
 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



Home | Main Index | Thread Index | Old Index