Openj9: Assertion failure when compiling JIT under debug mode in `RelocationRecord.cpp:575`

Created on 4 Jul 2019  路  9Comments  路  Source: eclipse/openj9

I got the Assertion Failure when I tried to compile the JIT under debug mode in Power 64 LE.
Here is the backtrace:

j> 15:25:40 Assertion failed at /team/simonam/dev/jvm/jre/lib/ppc64le/default/compiler/..//compiler/runtime/RelocationRecord.cpp:575: (reloFlags & ~FLAGS_RELOCATION_FLAG_MASK) == 0
j> 15:25:40 VMState: 0x0005ff0b
j> 15:25:40     reloFlags bits overlap cross-platform flags bits
j> 15:25:40 
j> 15:25:40 compiling java/lang/String.length()I at level: warm
j> 15:25:40 #0: function TR_LinuxCallStackIterator::printStackBacktrace(TR::Compilation*)+0x48 [0x3fffa5902be0]
j> 15:25:40 #1: function TR_Debug::printStackBacktrace()+0x40 [0x3fffa591c900]
j> 15:25:40 #2: /team/simonam/dev/jvm/jre/lib/ppc64le/default/libj9jit29.so(+0xddf874) [0x3fffa544f874]
j> 15:25:40 #3: function TR::fatal_assertion(char const*, int, char const*, char const*, ...)+0x68 [0x3fffa544fad0]
j> 15:25:40 #4: function TR::assertion(char const*, int, char const*, char const*, ...)+0xc0 [0x3fffa544fa44]
j> 15:25:40 #5: function TR_RelocationRecord::setReloFlags(TR_RelocationTarget*, unsigned char)+0x60 [0x3fffa4ff4cec]
j> 15:25:40 #6: function J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternalRelocation*, TR_RelocationRecord*)+0xd00 [0x3fffa4d3dd70]
j> 15:25:40 #7: function J9::Power::AheadOfTimeCompile::initializeAOTRelocationHeader(TR::IteratedExternalRelocation*)+0x3ef4 [0x3fffa5079518]
j> 15:25:40 #8: function TR::IteratedExternalRelocation::initializeRelocation(TR::CodeGenerator*)+0x60 [0x3fffa53569c4]
j> 15:25:40 #9: function J9::Power::AheadOfTimeCompile::processRelocations()+0x518 [0x3fffa50755a0]
j> 15:25:40 #10: function J9::CodeGenerator::processRelocations()+0x1bac [0x3fffa4d594ec]
j> 15:25:40 #11: function OMR::CodeGenPhase::performProcessRelocationsPhase(TR::CodeGenerator*, TR::CodeGenPhase*)+0x128 [0x3fffa5342b70]
j> 15:25:40 #12: function OMR::CodeGenPhase::performAll()+0x1ac [0x3fffa5342970]
j> 15:25:40 #13: function OMR::CodeGenerator::generateCode()+0x110 [0x3fffa5332974]
j> 15:25:40 #14: function OMR::Compilation::compile()+0x1314 [0x3fffa5362c74]
j> 15:25:40 #15: function TR::CompilationInfoPerThreadBase::compile(J9VMThread*, TR::Compilation*, TR_ResolvedMethod*, TR_J9VMBase&, TR_OptimizationPlan*, TR::SegmentAllocator const&)+0xd08 [0x3fffa4dd66c0]
j> 15:25:40 #16: function TR::CompilationInfoPerThreadBase::wrappedCompile(J9PortLibrary*, void*)+0x2b2c [0x3fffa4dd4c28]
j> 15:25:40 #17: /team/simonam/dev/jvm/jre/lib/ppc64le/default/libj9prt29.so(+0x5e5e8) [0x3fffa64be5e8]
j> 15:25:40 #18: function TR::CompilationInfoPerThreadBase::compile(J9VMThread*, TR_MethodToBeCompiled*, J9::J9SegmentProvider&)+0x628 [0x3fffa4dd1cb4]
j> 15:25:40 #19: function TR::CompilationInfoPerThread::processEntry(TR_MethodToBeCompiled&, J9::J9SegmentProvider&)+0x54c [0x3fffa4dc6ef0]
j> 15:25:40 #20: function TR::CompilationInfoPerThread::processEntries()+0x2a0 [0x3fffa4dc5fb4]
j> 15:25:40 #21: function TR::CompilationInfoPerThread::run()+0x60 [0x3fffa4dc5644]
j> 15:25:40 #22: function protectedCompilationThreadProc(J9PortLibrary*, TR::CompilationInfoPerThread*)+0x260 [0x3fffa4dc53a0]
j> 15:25:40 #23: /team/simonam/dev/jvm/jre/lib/ppc64le/default/libj9prt29.so(+0x5e5e8) [0x3fffa64be5e8]
j> 15:25:40 #24: function compilationThreadProc(void*)+0x5d8 [0x3fffa4dc50b0]
j> 15:25:40 #25: /team/simonam/dev/jvm/jre/lib/ppc64le/default/libj9thr29.so(+0x9934) [0x3fffa65a9934]
j> 15:25:40 #26: /lib/powerpc64le-linux-gnu/libpthread.so.0(+0x833c) [0x3fffa750833c]
j> 15:25:40 #27: function clone+0xe4 [0x3fffa73cb1d4]
power jit compaot

All 9 comments

@dsouzai @gita-omr FYI we need to determine whether this assert is valid. It is quite prevalent on an -Xsharedclasses run.

@simonameng I think we will need the command you were running.

The assertion isn't valid from what I can tell.

This is what the check is/was in J9AheadOfTimeCompile.cpp:

#define RELOCATION_TYPE_EIP_OFFSET  0x40
#define RELOCATION_TYPE_WIDE_OFFSET  0x80
#define RELOCATION_CROSS_PLATFORM_FLAGS_MASK (RELOCATION_TYPE_EIP_OFFSET | RELOCATION_TYPE_WIDE_OFFSET)
...
TR_ASSERT((flags & RELOCATION_CROSS_PLATFORM_FLAGS_MASK) == 0,  "reloFlags bits overlap cross-platform flags bits\n");

whereas in RelocationRecord.cpp, it's

#define FLAGS_RELOCATION_WIDE_OFFSETS   0x80
#define FLAGS_RELOCATION_EIP_OFFSET     0x40
#define FLAGS_RELOCATION_FLAG_MASK      ((uint8_t) (FLAGS_RELOCATION_WIDE_OFFSETS | FLAGS_RELOCATION_EIP_OFFSET))
...
TR_ASSERT((reloFlags & ~FLAGS_RELOCATION_FLAG_MASK) == 0,  "reloFlags bits overlap cross-platform flags bits\n");

We shouldn't be noting the FLAGS_RELOCATION_FLAG_MASK in the TR_ASSERT. TR_RelocationRecord::setReloFlags was never used until I started consolidating the relocation records (https://github.com/eclipse/openj9/issues/4803) and because it's a TR_ASSERT I never ran into it in my tests :/.

FWIW, this assert should fire on all platforms, not just P.

Thanks @dsouzai , then we'll just remove '~'.

@gita-omr was the fix contributed to master?

Looks like it's in master; closing.

@dsouzai can you link the PR which fixed this in case it comes in a search down the road?

Looks like it was fixed in https://github.com/eclipse/openj9/pull/6728

Was this page helpful?
0 / 5 - 0 ratings