Open cjjdespres opened 4 weeks ago
@dsouzai I happened to encounter this assert again while testing - I think we might have discussed it briefly a while ago. I only ran this particular test once, so I'm not sure how reproducible the failure is.
Somewhat hilariously, I tried running !whatis 0xc2e58
in jdmpview
just to see what it would say, and it appears that jdmpview
also crashed with exactly the assert aMethod 0xc2e58 should have already been validated
, though during the compilation of a different method.
I ran into this while working on AOT MH support; you need this patch:
diff --git a/runtime/compiler/env/VMJ9.cpp b/runtime/compiler/env/VMJ9.cpp
index b6c049e79c..733b502e99 100644
--- a/runtime/compiler/env/VMJ9.cpp
+++ b/runtime/compiler/env/VMJ9.cpp
@@ -8887,7 +8887,7 @@ TR_J9SharedCacheVM::isClassLibraryMethod(TR_OpaqueMethodBlock *method, bool vett
}
TR_OpaqueMethodBlock *
-TR_J9SharedCacheVM::getMethodFromClass(TR_OpaqueClassBlock * methodClass, char * methodName, char * signature, TR_OpaqueClassBlock *callingClass)
+TR_J9SharedCacheVM::getMethodFromClass(TR_OpaqueClassBlock * methodClass, const char * methodName, const char * signature, TR_OpaqueClassBlock *callingClass)
{
TR_OpaqueMethodBlock* omb = this->TR_J9VM::getMethodFromClass(methodClass, methodName, signature, callingClass);
if (omb)
diff --git a/runtime/compiler/env/VMJ9.h b/runtime/compiler/env/VMJ9.h
index e57f23ff7e..65a3238de0 100644
--- a/runtime/compiler/env/VMJ9.h
+++ b/runtime/compiler/env/VMJ9.h
@@ -1666,7 +1666,7 @@ public:
virtual bool hasFinalizer(TR_OpaqueClassBlock * classPointer);
virtual uintptr_t getClassDepthAndFlagsValue(TR_OpaqueClassBlock * classPointer);
virtual uintptr_t getClassFlagsValue(TR_OpaqueClassBlock * classPointer);
- virtual TR_OpaqueMethodBlock * getMethodFromClass(TR_OpaqueClassBlock *, char *, char *, TR_OpaqueClassBlock * = NULL);
+ virtual TR_OpaqueMethodBlock * getMethodFromClass(TR_OpaqueClassBlock *, const char *, const char *, TR_OpaqueClassBlock * = NULL);
virtual bool isPrimitiveClass(TR_OpaqueClassBlock *clazz);
virtual TR_OpaqueClassBlock * getComponentClassFromArrayClass(TR_OpaqueClassBlock * arrayClass);
virtual TR_OpaqueClassBlock * getArrayClassFromComponentClass(TR_OpaqueClassBlock *componentClass);
Basically OMR::SymbolReferenceTable::methodSymRefFromName
is calling
TR_OpaqueMethodBlock *method = fe()->getMethodFromName(className, methodName, methodSignature);
and if you look at TR_J9VM::getMethodFromName
, it calls
result = (TR_OpaqueMethodBlock *)getMethodFromClass(methodClass, methodName, signature);
but the mismatch in signature (ie the lack of const
) results in the non-AOT version getting called, which doesn't add the SVM validation record for result
.
Somewhat hilariously, I tried running
!whatis 0xc2e58
injdmpview
just to see what it would say, and it appears thatjdmpview
also crashed with exactly the assertaMethod 0xc2e58 should have already been validated
, though during the compilation of a different method.
Yeah it's safer to just use a diff JVM for jdmpview, or run with something like -J-Xshareclasses:none
or -J-Xint
if you must use the test JVM.
I observed this assert when running
testJITServer_0
locally, using a debug build. Console log:Looking at the core that was produced, this appears to have been a compilation that was purely local. Actually, it looks like all the test components passed, and from the command line string in the java core it looks like the crash happened in the java process that was responsible for starting the test components (which wasn't using JITServer) and not any of the child processes (which were using JITServer). So this is unlikely to be a JITServer issue.