Zero JVM segfaulting on linux-sparc
Severin Gehwolf
sgehwolf at redhat.com
Fri Dec 21 09:12:46 UTC 2018
On Fri, 2018-12-21 at 15:38 +1000, David Holmes wrote:
> Correction ...
>
> On 21/12/2018 3:11 pm, David Holmes wrote:
> > Hi Adrian,
> >
> > On 21/12/2018 10:39 am, John Paul Adrian Glaubitz wrote:
> > > Hello!
> > >
> > > On 12/20/18 2:00 PM, John Paul Adrian Glaubitz wrote:
> > > > I haven't started bisecting yet, so I was wondering whether this
> > > > crash looks familiar
> > > > to anyone? The normal server build has no issues.
> > >
> > > This regression is caused by [1]:
> > >
> > > 8210425: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without
> > > optimization
> > >
> > > Reverting that change unbreaks Zero on linux-sparc.
> >
> > Okay, so either you need to figure out why the optimization flags cause
> > the failure or else restore the:
> >
> > - ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
> >
> > that was removed.
> >
> > I know what is the simpler option :)
>
> Maybe not that simple as other archs are involved. AFAICS before the
> patch the compilation should have the default optimization level; and
> after it will have "none" unless FDLIBM_CFLAGS is set. Seems odd that
> "none" would cause a regression like this. Can you generate before/after
> build logs to check the actual flags?
Yes, that. Here is what it looks like for me:
$ cat /disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/hotspot/variant-zero/libjvm/objs/sharedRuntimeTrig.o.cmdline
/usr/bin/g++ -MMD -MF /disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/hotspot/variant-zero/libjvm/objs/sharedRuntimeTrig.d -I/disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/hotspot/variant-zero/libjvm/objs/precompiled -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -D_REENTRANT -pipe -fno-rtti -fno-exceptions -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -fcheck-new -std=gnu++98 -DSUPPORTS_CLOCK_MONOTONIC -DLINUX -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Wreturn-type -Woverloaded-virtual -Wreorder -fPIC -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-delete-null-pointer-checks -fno-lifetime-dse -Wno-format-zero-length -Wtype-limits -Wuninitialized -m64 -DPRODUCT -DTARGET_ARCH_zero -DINCLUDE_SUFFIX_OS=_linux -DINCLUDE_SUFFIX_CPU=_zero -DINCLUDE_SUFFIX_COMPILER=_gcc -DTARGET_COMPILER_gcc -DAMD64 -DHOTSPOT_LIB_ARCH='"amd64"' -DZERO -DCC_INTERP -DZERO_LIBARCH='"amd64"' -DDTRACE_ENABLED -DINCLUDE_JVMCI=0 -DINCLUDE_CDS=0 -DINCLUDE_AOT=0 -DINCLUDE_G1GC=0 -DINCLUDE_EPSILONGC=0 -DINCLUDE_ZGC=0 -DINCLUDE_SHENANDOAHGC=0 -DINCLUDE_JFR=0 -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/share -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/os/linux -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/os/posix -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/cpu/zero -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/os_cpu/linux_zero -I/disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/hotspot/variant-zero/gensrc -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/share/precompiled -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/share/include -I/disk/openjdk/upstream-sources/openjdk-head/src/hotspot/os/posix/include -I/disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/support/modules_include/java.base -I/disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/support/modules_include/java.base/linux -I/disk/openjdk/upstream-sources/openjdk-head/src/java.base/share/native/libjimage -m64 -g -Wno-unused-parameter -Wno-unused -Wno-extra -Wno-parentheses -Wno-comment -Wno-unknown-pragmas -Wno-address -Wno-delete-non-virtual-dtor -Wno-char-subscripts -Wno-array-bounds -Wno-int-in-bool-context -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-empty-body -Wno-strict-overflow -Wno-sequence-point -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-return-type -Wno-switch -O3 -DNO_PCH -ffp-contract=off -O2 -DTHIS_FILE='"sharedRuntimeTrig.cpp"' -c -o /disk/openjdk/upstream-sources/openjdk-head/build/linux-x86_64-zero-release/hotspot/variant-zero/libjvm/objs/sharedRuntimeTrig.o /disk/openjdk/upstream-sources/openjdk-head/src/hotspot/share/runtime/sharedRuntimeTrig.cpp
In addition, I'd be interested in seeing what FDLIBM_CFLAGS are after
configure. This is what I have on x86_64:
$ grep FDLIBM_CFLAGS build/linux-x86_64-zero-release/spec.gmk
FDLIBM_CFLAGS := -ffp-contract=off
Also, you should see something like this in config.log at build/linux-
x86_64-zero-release/configure-support/config.log:
configure:55336: checking if the C compiler supports "-ffp-contract=off"
configure:55352: /usr/bin/gcc -c -m64 -ffp-contract=off conftest.c >&5
configure:55352: $? = 0
configure:55366: result: yes
configure:55436: checking if the C++ compiler supports "-ffp-contract=off"
configure:55452: /usr/bin/g++ -c -ffp-contract=off conftest.cpp >&5
configure:55452: $? = 0
configure:55466: result: yes
configure:55488: checking if both compilers support "-ffp-contract=off"
configure:55493: result: yes
It could be that you are hitting a GCC bug specific to linux sparc.
Then again, why wouldn't you hit it for a server JVM. As a temporary
work-around you could try this (compile without opt as prior JDK-
8210425, not tested):
diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk
--- a/make/hotspot/lib/JvmOverrideFiles.gmk
+++ b/make/hotspot/lib/JvmOverrideFiles.gmk
@@ -49,6 +49,15 @@
# by using -ffp-contract=off on GCC/Clang platforms.
ifneq ($(FDLIBM_CFLAGS), )
LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NORM)
+ # Don't optimize fdlibm-fork for Zero on Linux spark
+ # See JDK-XXXX
+ ifeq ($(call check-jvm-feature, zero), true)
+ ifeq ($(OPENJDK_TARGET_OS), linux)
+ ifeq ($(OPENJDK_TARGET_CPU_ARCH), spark)
+ LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE)
+ endif
+ endif
+ endif
endif
ifeq ($(OPENJDK_TARGET_OS), linux)
Thanks,
Severin
> David
>
> > Cheers,
> > David
> >
> > > Adrian
> > >
> > > > [1] http://hg.openjdk.java.net/jdk/jdk/rev/a50956e2368c?revcount=120
More information about the hotspot-dev
mailing list