hsdis perhaps also need to be linked with -z noexecstack for JDK-8201398
Leslie Zhai
zhaixiang at loongson.cn
Mon Aug 13 04:58:46 UTC 2018
Hi all,
After upgraded from jdk8u172-b11 to jdk8u181-b13, PrintLIRWithAssembly
failed to work:
$ java -Xcomp -XX:TieredStopAtLevel=1 -XX:+PrintLIRWithAssembly
-XX:+PrintAssembly -XX:+PrintCompilation Test5057225[1]
OpenJDK 64-Bit Server VM warning: PrintAssembly is enabled; turning on
DebugNonSafepoints to gain additional output
2171 1 !b 1 java.lang.invoke.MethodHandle::<clinit> (45 bytes)
__bci__use__tid____instr____________________________________
. 0 0 54 B12 [0, 0] -> B0 sux: B0
0 label [label:0x000000ff6c031100]
OpenJDK 64-Bit Server VM warning: You have loaded library
/home/zhaixiang/project/loongson/jdk8-mips-c1/build/linux-mips64-normal-server-slowdebug/images/j2sdk-image/jre/lib/mips64el/hsdis-mips64el.so
which might have disabled stack guard. The VM will try to fix the stack
guard now.
It's highly recommended that you fix the library with 'execstack -c
<libfile>', or link it with '-z noexecstack'.
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/thread.cpp:951
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error
(/home/zhaixiang/project/loongson/jdk8-mips-c1/hotspot/src/share/vm/runtime/thread.cpp:951),
pid=9259, tid=0x000000ffe0e471f0
# fatal error: Thread holding lock at safepoint that vm can block on:
tty_lock
#
# JRE version: OpenJDK Runtime Environment (8.0) (build
1.8.0-internal-debug-zhaixiang_2018_08_13_11_24-b00) (Loongson
8.1-loongson3a-Loongnix)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b00-debug compiled mode
linux-mips64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
#
/home/zhaixiang/project/loongson/jdk8-mips-c1/hotspot/test/compiler/5057225/hs_err_pid9259.log
Locks owned:
Mutex: [0xffe4007fb0/0x1] tty_lock - owner: 0xffe411c800
#
# Compiler replay data is saved as:
#
/home/zhaixiang/project/loongson/jdk8-mips-c1/hotspot/test/compiler/5057225/replay_pid9259.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 1098989728240
Dumping core ...
But X86 jdk8u181-b13 is *not* able to reproduce the issue.
And there are `execstack` in the hg log for OpenJDK8 updates dev:
http://hg.openjdk.java.net/jdk8u/jdk8u-dev
So I just add nonexecstack flag set for linking with binutils/ld and
test it for mips64el:
diff -r a57483d08d95 src/share/tools/hsdis/Makefile
--- a/src/share/tools/hsdis/Makefile Fri Aug 10 08:29:53 2018 -0700
+++ b/src/share/tools/hsdis/Makefile Mon Aug 13 12:51:01 2018 +0800
@@ -104,12 +104,19 @@
endif
CFLAGS += $(CFLAGS/$(ARCH))
CFLAGS += -fPIC
+ifeq ($(ARCH), mips64)
+CPUINFO = $(shell cat /proc/cpuinfo)
+ifneq ($(findstring Loongson,$(CPUINFO)),)
+CFLAGS += -DLOONGSON
+endif
+endif
OS = linux
LIB_EXT = .so
CC = gcc
endif
CFLAGS += -O
DLDFLAGS += -shared
+DLDFLAGS += -Wl,-z,noexecstack
LDFLAGS += -ldl
OUTFLAGS += -o $@
else
Then PrintLIRWithAssembly is able to work.
Does it need to add nonexecstack flag set for linking with binutils/ld?
Because the testcase is able to work with PrintLIRWithAssebmly for X86.
Please give me some suggestion, thanks a lot!
1. Testcase
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/a57483d08d95/test/compiler/5057225
--
Regards,
Leslie Zhai
More information about the jdk8u-dev
mailing list