-
Notifications
You must be signed in to change notification settings - Fork 729
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
Ignore null classes when searching the FCC #17001
Ignore null classes when searching the FCC #17001
Conversation
runtime/vm/ValueTypeHelpers.cpp
Outdated
break; | ||
J9FlattenedClassCacheEntry *entry = J9_VM_FCC_ENTRY_FROM_FCC(flattenedClassCache, i); | ||
if (!J9_VM_FCC_ENTRY_IS_STATIC_FIELD(entry)) { | ||
J9UTF8* currentClassName = J9ROMCLASS_CLASSNAME(entry->clazz->romClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an existing macro J9_VM_FCC_CLASS_FROM_ENTRY()
to get the J9Class
. We can then use the J9Class
to get the romClass and className.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in e9539c9
dfc476c
to
e9539c9
Compare
In classinitialization.cpp dont we explicitly add the class for static fields
|
Oh yeah I missed that, I only saw this line where the static flag was being set so I assumed there was never any class added openj9/runtime/vm/createramclass.cpp Line 2011 in f2971b5
I guess I should change the code to only ignore the entries where |
Oh interesting, sound it sounds like the failure happens when someone queries it before the class is loaded. Who is the caller when it fails? do you have a stack trace? |
Here's a stack trace:
|
Something seems off, it shouldnt be hitting that code path
We check to make sure its not a static field |
do you know which class is being loaded? |
The crash occurs when any entry in the FCC just has its |
okay I see. I think all we need is a NULL check on |
e9539c9
to
1960bac
Compare
Ok I fixed the check to just look if the class is null |
jenkins compile win jdk8 |
Jenkins test sanity,extended xlinuxval jdknext |
Jenkins test sanity zlinuxvalst jdknext |
} | ||
} | ||
|
||
Assert_VM_notNull(clazz); | ||
return clazz; | ||
Assert_VM_notNull(foundClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this assertion still valid ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if no matching class in the FCC is found then foundClass will be null
The build failure looks like another extension repo issue, the openj9/jcl/src/java.base/share/classes/jdk/internal/foreign/abi/UpcallLinker.java Lines 35 to 37 in 511fc3d
I could fix it by changing the guard to |
@ChengJin01 ^^ |
@ehrenjulzert, there is no need to change any FFI related code in this PR given the compilation failure was due to the out-of-sync issue between the latest JDKnext (ibmruntimes/openj9-openjdk-jdk#572 plus ibmruntimes/openj9-openjdk-jdk#577 which are merged today) and the OpenJDK/Valhalla extension (already obsolete in https://github.com/ibmruntimes/openj9-openjdk-jdk.valuetypes). @JasonFengJ9, please help synchronize the the OpenJDK/Valhalla extension with the latest changes in JDKnext for JDK21. |
1960bac
to
05da787
Compare
In 05da787 I just removed the NULL assertion at the end of the function and added comments to make it clear that the caller is responsible for checking if the return value is NULL |
I think this would be a breaking change, currently all callers expect to get a return. This is used as a shortcut to internalfindClassUTF since the caller is presumably iterating the class instancefieds. |
It all comes to if it is possible for |
All the assertion does is throw an error if a class by the name |
Does the test pass or fail on the assertion if |
OpenJDK valhalla is still at jdk-21+5, there was a merging issue to consume latest openjdk update. Will give it another try. |
After talking to Hang on slack we decided it's better to put the assertion back in |
Some entries in the FCC have their clazz field set to null, these null classes should not be dereferenced For eclipse-openj9#13182 (fixes error in UninitializedInlineFieldsTest, as well as other tests) Signed-off-by: Ehren Julien-Neitzert <[email protected]>
05da787
to
3a6ff1e
Compare
Merged w/ latest https://github.com/ibmruntimes/openj9-openjdk-jdk ( |
Jenkins test sanity,extended xlinuxval jdknext |
Jenkins test sanity win jdk8 |
Jenkins test sanity plinuxvalst jdknext |
This seems to be a known issue (#16779) so it's unrelated to my change, but it does also seem to cause other tests to not run. |
Some entries in the FCC have their clazz field set to null, these null classes should not be dereferenced
For #13182 (fixes error in UninitializedInlineFieldsTest, as well as other tests)