On Mon, 13 Mar 2023 16:37:18 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

> > I'm currently wondering about the TestArrayStructs failures. Passing arrays 
> > with up to 7 elements seems to work fine. When I pass 8 elements, the last 
> > element of capturedArgs gets observed as 0. When I pass more than 8 
> > elements, element 5 and 6 of capturedArgs get observed as 0.
> > DowncallLinker.invokeInterpBindings has the correct args, but 
> > UpcallLinker.invokeInterpBindings doesn't receive the correct values as 
> > lowLevelArgs. They contain the wrong zeros. The remaining elements look 
> > correct.
> > Do you have an idea what could be going wrong? Otherwise, I'll have to 
> > continue debugging.
> 
> This sounds like there might be a mismatch between the Java and native side. 
> I suggest looking at the assembly generated for the native function for the 
> failing case, and seeing if it matches what is generated by CallArranger. 
> Here is also where adding a CallArranger test can be useful (in 
> test/jdk/java/foreign/callarranger), to test whether the resulting bindings 
> match your expectation for that function descriptor.
> 
> Also, you might want to check the layout the native compiler uses for the 
> particular struct, and verify that it matches the Java side. (i.e. there's no 
> weird padding or something, it's just a struct of 8 bytes).

Note that argument and return value passing works. I'm getting all values back. 
So, the native side seems to be ok. Only (one or two) values in `returnBox` are 
broken.

-------------

PR: https://git.openjdk.org/jdk/pull/12708

Reply via email to