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

Crash while throwing ClassCastException #7002

Open
JamesKingdon opened this issue Sep 6, 2019 · 0 comments
Open

Crash while throwing ClassCastException #7002

JamesKingdon opened this issue Sep 6, 2019 · 0 comments

Comments

@JamesKingdon
Copy link
Contributor

The crash is specific to the x86 platform running 64 bit with compressed references. The crash occurs in internalSendExceptionConstructor and analysis will find that one of the two class pointers has been sign extended. The incorrect value can be found in J9VMThread.floatTemp1 which is the storage location used to pass the value from jitThrowClassCastException to impl_jitClassCastException. The two classes are passed from the jit'd method body to jitThrowClassCastException on the stack. The variable class is passed with a push reg instruction while the constant class is passed with a push imm32 instruction. Unfortunately the latter sign extends the data, so if the constant class is allocated at an address greater or equal to 2GB we get an incorrect value on the stack.

An alternative encoding is used when running 64 bit non-compressed references which uses an 8 byte data snippet to hold the constant class pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants