-
Notifications
You must be signed in to change notification settings - Fork 721
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
[Jtreg/FFI] Invalid struct offset returned from getArgPointer() in upcall on zLinux #16214
Comments
Hi @dchopra001, could you take a look at this issue? Let me know if you need any help. |
Hi @dchopra001, is there any progress on the issue? |
This problem is exposed by a native function with the following parameter list:
As per our design, parameters What I'm seeing happening at the moment is that the address where I'm not sure why this is happening at the moment as the original caller frame is populated by the caller before the glue routine is invoked. I'll investigate further to figure out why. I hope to have a resolution to this problem soon. |
@dchopra001 Do you think this will be resolved within 2 weeks? |
Yes, I'll have a fix for this soon. If I run into any blockers I'll update here. |
When getArgPointer is invoked while an upcall is performed the gprIndex must be incremented if hidden parameters have to be accounted for. This commit implements the suggested change. Fixes: eclipse-openj9#16214 Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
The crash occurred when running https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/openj9/test/jdk/java/foreign/TestUpcallStack.java (the corresponding native code at https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/openj9/test/jdk/java/foreign/libTestUpcallStack.c
It crashed in
copyForwardU64()
when copying from the invalid source pointer (offset) originated fromgetArgPointer()
:with the debugging output as follows:
So the JIT team need to take a look to see why the returned offset for struct is invalid given
getArgPointer()
is part of the thunk generation code on zLinux.Note:
the failing test case might be
test TestUpcallStack.testUpcallsStack(6069, "f10_S_S_PI", NON_VOID, [STRUCT], [POINTER, INT])
based on the result on other platforms, in which case the passed-in struct argument should be[POINTER, INT]
in upcall.FYI: @dchopra001, @0xdaryl, @tajila, @pshipton
The text was updated successfully, but these errors were encountered: