Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT Assertion failure when compiling with debug enabled. #2088

Closed
pdbain-ibm opened this issue Jun 6, 2018 · 12 comments
Closed

JIT Assertion failure when compiling with debug enabled. #2088

pdbain-ibm opened this issue Jun 6, 2018 · 12 comments
Labels

Comments

@pdbain-ibm
Copy link
Contributor

To reproduce,

  1. I checked out the OpenJDK 9 with OpenJ9 project per
    https://www.eclipse.org/openj9/oj9_build.html

  2. Enabled debugging per https://blog.openj9.org/2018/06/05/debugging-openj9-in-docker-with-gdb/

export UMA_DO_NOT_OPTIMIZE_CCODE="1"
export VMDEBUG="-g3 -fno-inline -O0"
export VMLINK="-g -O0"
export enable_debug=yes
export enable_optimized=no
export enable_optimize=no
export CXXFLAGS="-O0 -g3"
export CFLAGS="-O0 -g3"
export BUILD_CONFIG=debug
  1. and built it like so:
cd /projects/openj9/openj9-openjdk-jdk9/
bash get_source.sh 
bash ./configure --with-freemarker-jar=/projects/freemarker.jar 
make images

I get a compilation failure:

Compiling 4 files for BUILD_JIGSAW_TOOLS
Assertion failed at /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/vm/compiler/../compiler/optimizer/J9TransformUtil.cpp:374: isFinalFieldPointingAtNativeStruct(symRef, comp)
VMState: 0x000513ff
	dereferenceStructPointerChain should be dealing with reference fields
compiling sun/nio/fs/NativeBuffers.copyCStringToNativeBuffer([BLsun/nio/fs/NativeBuffer;)V at level: warm
#0: function TR_LinuxCallStackIterator::printStackBacktrace(TR::Compilation*)+0x32 [0x2adb9e19143a]
#1: function TR_Debug::printStackBacktrace()+0x1f [0x2adb9e1a3ffb]
#2: /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/jdk/lib/compressedrefs/libj9jit29.so(+0xab0eb2) [0x2adb9de25eb2]
#3: function TR::assertion(char const*, int, char const*, char const*, ...)+0xb3 [0x2adb9de26042]
#4: /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/jdk/lib/compressedrefs/libj9jit29.so(+0x942ece) [0x2adb9dcb7ece]
#5: function J9::TransformUtil::transformIndirectLoadChainImpl(TR::Compilation*, TR::Node*, TR::Node*, void*, TR::Node**)+0x3a5 [0x2adb9dcbb6d5]
#6: function J9::TransformUtil::transformIndirectLoadChainAt(TR::Compilation*, TR::Node*, TR::Node*, unsigned long*, TR::Node**)+0xdc [0x2adb9dcbb238]
#7: /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/jdk/lib/compressedrefs/libj9jit29.so(+0xde8567) [0x2adb9e15d567]
#8: /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/jdk/lib/compressedrefs/libj9jit29.so(+0xde8b41) [0x2adb9e15db41]
#9: function constrainIiload(OMR::ValuePropagation*, TR::Node*)+0x8c [0x2adb9e163f16]
#10: function OMR::ValuePropagation::launchNode(TR::Node*, TR::Node*, int)+0x13e [0x2adb9e13c752]
#11: function constrainChildren(OMR::ValuePropagation*, TR::Node*)+0x75 [0x2adb9e19051d]
#12: function constrainIand(OMR::ValuePropagation*, TR::Node*)+0x47 [0x2adb9e17a775]
#13: function OMR::ValuePropagation::launchNode(TR::Node*, TR::Node*, int)+0x13e [0x2adb9e13c752]
#14: function constrainChildren(OMR::ValuePropagation*, TR::Node*)+0x75 [0x2adb9e19051d]
#15: function constrainAdd(OMR::ValuePropagation*, TR::Node*)+0x5b [0x2adb9e1744b7]
#16: function OMR::ValuePropagation::launchNode(TR::Node*, TR::Node*, int)+0x13e [0x2adb9e13c752]
#17: function constrainChildren(OMR::ValuePropagation*, TR::Node*)+0x75 [0x2adb9e19051d]
#18: function constrainIshr(OMR::ValuePropagation*, TR::Node*)+0x42 [0x2adb9e179960]
#19: function OMR::ValuePropagation::launchNode(TR::Node*, TR::Node*, int)+0x13e [0x2adb9e13c752]
#20: function constrainChildren(OMR::ValuePropagation*, TR::Node*)+0x75 [0x2adb9e19051d]
#21: function OMR::ValuePropagation::launchNode(TR::Node*, TR::Node*, int)+0x13e [0x2adb9e13c752]
#22: function OMR::ValuePropagation::processTrees(TR::TreeTop*, TR::TreeTop*)+0x45d [0x2adb9e12df53]
#23: function TR::GlobalValuePropagation::processBlock(TR_StructureSubGraphNode*, bool, bool)+0x5e8 [0x2adb9e04dd32]
#24: function TR::GlobalValuePropagation::processStructure(TR_StructureSubGraphNode*, bool, bool)+0x160 [0x2adb9e04c4c8]
#25: function TR::GlobalValuePropagation::processRegionNode(TR_StructureSubGraphNode*, bool, bool)+0x2da [0x2adb9e04d740]
#26: function TR::GlobalValuePropagation::processRegionNode(TR_StructureSubGraphNode*, bool, bool)+0xbd [0x2adb9e04d523]
#27: function TR::GlobalValuePropagation::processRegionNode(TR_StructureSubGraphNode*, bool, bool)+0xbd [0x2adb9e04d523]
#28: function TR::GlobalValuePropagation::processRegionNode(TR_StructureSubGraphNode*, bool, bool)+0xbd [0x2adb9e04d523]
#29: function TR::GlobalValuePropagation::processRegionNode(TR_StructureSubGraphNode*, bool, bool)+0xbd [0x2adb9e04d523]

java: /macprojects/openj9/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/vm/compiler/../omr/compiler/infra/Assert.cpp:72: void TR::trap(): Assertion `0' failed.
@pdbain-ibm
Copy link
Contributor Author

FYI @babsingh

@babsingh
Copy link
Contributor

babsingh commented Jun 6, 2018

@pdbain-ibm yesterday, i was able to successfully build Java 8. i am re-building Java 9 on my end to reproduce the issue. did u see "OpenJ9 Compile Complete" message? if so, OpenJ9 has finished compilation and other Java tools are being built using the VM. this may be a bug in JIT code. JIT debug symbols and assertions can be avoided by unset BUILD_CONFIG. are you building in a Linux x86 Docker container?

@pdbain-ibm
Copy link
Contributor Author

pdbain-ibm commented Jun 6, 2018

did u see "OpenJ9 Compile Complete" message?

No, I did not. It seems to be blowing up while building DDR:

Generating DDR pointer classes
Generating DDR structure stubs
superset directory name : /macprojects/test/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/vm/
superset file name : superset.dat
superset directory name : /macprojects/test/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/vm/
superset file name : superset.dat
Writing generated classes to /macprojects/test/openj9-openjdk-jdk9/openj9/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/pointer/generated
Writing generated classes to /macprojects/test/openj9-openjdk-jdk9/openj9/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/structure
Unhandled structure type: big_int_unionPointer->i128 __int128
Unhandled structure type: z_streamPointer->next_in Byte*
Unhandled structure type: z_streamPointer->next_out Byte*
Unhandled structure type: _IO_FILEPointer->_lock _IO_lock_t*
Unhandled structure type: FILEPointer->_lock _IO_lock_t*
Processing complete
Unhandled structure type: z_stream_sPointer->next_in Byte*
Unhandled structure type: z_stream_sPointer->next_out Byte*
Unhandled structure type: OMRFileStreamPointer->_lock _IO_lock_t*
Processing complete
Compiling 5297 files for BUILD_DDR_CLASSES
Creating support/modules_cmds/jdk.jlink/jimage from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jlink from 1 file(s)
Creating support/native/java.base/java_objs/java from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jmod from 1 file(s)
Creating support/modules_cmds/java.base/keytool from 1 file(s)
Creating support/modules_cmds/java.corba/idlj from 1 file(s)
Creating support/modules_libs/java.base/jexec from 1 file(s)
Creating support/modules_cmds/java.corba/orbd from 1 file(s)
Creating support/modules_cmds/java.corba/servertool from 1 file(s)
Creating support/modules_cmds/java.corba/tnameserv from 1 file(s)
Creating support/modules_cmds/java.desktop/appletviewer from 1 file(s)
Creating support/modules_libs/java.instrument/libinstrument.so from 12 file(s)
Creating support/modules_libs/java.prefs/libprefs.so from 1 file(s)
Creating support/modules_libs/java.desktop/libmlib_image.so from 50 file(s)
Creating support/modules_libs/java.desktop/libawt.so from 73 file(s)
Creating support/modules_libs/java.desktop/libawt_xawt.so from 57 file(s)
Creating support/modules_libs/java.desktop/liblcms.so from 27 file(s)
Creating support/modules_libs/java.desktop/libjavajpeg.so from 46 file(s)
Creating support/modules_libs/java.desktop/libawt_headless.so from 26 file(s)
Creating support/native/java.desktop/libfontmanager/libfontmanager.so from 130 file(s)
Creating support/modules_libs/java.desktop/libjawt.so from 1 file(s)
Creating support/modules_libs/java.desktop/libsplashscreen.so from 67 file(s)
Creating support/modules_libs/java.desktop/libjsound.so from 2 file(s)
Creating support/modules_libs/java.desktop/libjsoundalsa.so from 17 file(s)
Creating support/modules_libs/java.rmi/librmi.so from 1 file(s)
Creating support/modules_cmds/java.rmi/rmid from 1 file(s)
Creating support/modules_cmds/java.rmi/rmiregistry from 1 file(s)
Creating support/modules_cmds/java.scripting/jrunscript from 1 file(s)
Creating support/modules_libs/java.security.jgss/libj2gss.so from 3 file(s)
Creating support/modules_libs/java.smartcardio/libj2pcsc.so from 2 file(s)
Creating support/modules_libs/jdk.attach/libattach.so from 1 file(s)
Creating support/modules_cmds/jdk.compiler/javac from 1 file(s)
Creating support/modules_cmds/jdk.compiler/javah from 1 file(s)
Creating support/modules_cmds/jdk.compiler/serialver from 1 file(s)
Creating support/modules_libs/jdk.crypto.cryptoki/libj2pkcs11.so from 14 file(s)
Creating support/modules_libs/jdk.crypto.ec/libsunec.so from 28 file(s)
Creating support/modules_cmds/jdk.jartool/jar from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jarsigner from 1 file(s)
Creating support/modules_cmds/jdk.javadoc/javadoc from 1 file(s)
Creating support/modules_cmds/jdk.jconsole/jconsole from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/javap from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeps from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeprscan from 1 file(s)
Creating support/modules_cmds/jdk.jdi/jdb from 1 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libdt_socket.so from 2 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libjdwp.so from 42 file(s)
Creating support/modules_cmds/jdk.jshell/jshell from 1 file(s)
Creating support/modules_libs/jdk.management.agent/libmanagement_agent.so from 1 file(s)
Creating support/modules_libs/jdk.pack/libunpack.so from 7 file(s)
Creating support/modules_cmds/jdk.pack/pack200 from 1 file(s)
Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
Creating support/modules_cmds/jdk.policytool/policytool from 1 file(s)
Creating support/modules_cmds/jdk.rmic/rmic from 1 file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from 1 file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from 3 file(s)
Creating support/modules_libs/jdk.security.auth/libjaas_unix.so from 1 file(s)
Creating support/modules_cmds/jdk.xml.bind/schemagen from 1 file(s)
Creating support/modules_cmds/jdk.xml.bind/xjc from 1 file(s)
Creating support/modules_cmds/jdk.xml.ws/wsgen from 1 file(s)
Creating support/modules_cmds/jdk.xml.ws/wsimport from 1 file(s)
Creating support/modules_cmds/openj9.dtfj/jextract from 1 file(s)
Creating support/modules_cmds/openj9.dtfjview/jdmpview from 1 file(s)
Creating support/modules_cmds/openj9.traceformat/traceformat from 1 file(s)
Updating images/sec-bin.zip
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Creating support/modules_libs/openj9.dtfj/ddr/j9ddr.jar
Compiling 4 files for BUILD_JIGSAW_TOOLS
Assertion failed at /macprojects/test/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/vm/compiler/../compiler/optimizer/J9TransformUtil.cpp:374: isFinalFieldPointingAtNativeStruct(symRef, comp)
VMState: 0x000513ff
	dereferenceStructPointerChain should be dealing with reference fields
compiling sun/nio/fs/NativeBuffers.copyCStringToNativeBuffer([BLsun/nio/fs/NativeBuffer;)V at level: warm
#0: function TR_LinuxCallStackIterator::printStackBacktrace(TR::Compilation*)+0x32 [0x2b8401cc443a]
#1: function TR_Debug::printStackBacktrace()+0x1f [0x2b8401cd6ffb]
#2: /macprojects/test/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-fastdebug/jdk/lib/compressedrefs/libj9jit29.so(+0xab0eb2) [0x2b8401958eb2]
#3: function TR::assertion(char const*, int, char const*, char const*, ...)+0xb3 [0x2b8401959042]

FYI @fjeremic could you have someone on the JIT team triage this? I can provide core dumps etc.

@fjeremic
Copy link
Contributor

fjeremic commented Jun 6, 2018

FYI @fjeremic could you have someone on the JIT team triage this? I can provide core dumps etc.

@jdmpapin / @andrewcraik crashes in VP on x86. Seems like your area of expertise.

@babsingh
Copy link
Contributor

babsingh commented Jun 6, 2018

i encountered the same issue while compiling Java 9. BUILD_CONFIG enables debug symbols and assertions for the JIT. after unset BUILD_CONFIG, OpenJDK9 with OpenJ9 compiled fine.

@babsingh
Copy link
Contributor

babsingh commented Jun 7, 2018

i have verified that Java 8 compiles fine with the BUILD_CONFIG env var set. so, this issue only impacts Java 9+.

@gita-omr
Copy link
Contributor

@andrewcraik, unfortunately the Assert in J9TransformUtil.cpp:374 prevents us from doing DEBUG build. Could somebody take a look at it?

@andrewcraik
Copy link
Contributor

@liqunl do you have a fix for this as part of other work you are doing? If not could you get a fix for this since you are looking in this area.

@liqunl
Copy link
Contributor

liqunl commented Sep 11, 2018

Sorry, I didn't know it is crashing. @pdbain-ibm Do you have a jitdump or trace log from the failure?

@fjeremic
Copy link
Contributor

Sorry, I didn't know it is crashing. @pdbain-ibm Do you have a jitdump or trace log from the failure?

I think it's 100% reproducible following the instructions in the OP.

@pdbain-ibm
Copy link
Contributor Author

@liqunl Sorry, the dumps are long gone. I suggest you follows the instructions to reproduce in
#2088 (comment).

@AlenBadel
Copy link
Contributor

@liqunl
See the attacked jdk. You can reproduce the problem by running java -version

https://ibm.box.com/s/pt2vpgrmbxts7okp7y0857z99g52adtr

liqunl pushed a commit to liqunl/openj9 that referenced this issue Sep 20, 2018
Assertion is not needed in calculating the field address because the
field has been verified by verifyFieldAccess.

Fixes: eclipse-openj9#2088

Signed-off-by: Liqun Liu <liqunl@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants