JDK-8213845 : ARM32: Interpreter doesn't call result handler after native calls
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,9,10,11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: arm
  • Submitted: 2018-11-14
  • Updated: 2021-04-09
  • Resolved: 2018-11-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11.0.12Fixed 12 b22Fixed
Related Reports
Relates :  
Description
ARM32 interpreter and C1 doesn't use JNI call result handers properly since "returned value is already in appropriate format" (templateInterpreterGenerator_arm.cpp:32) . Now (since JDK-8209637) we have JNIBooleanTest.java test that shows the approach is not correct: the JNI call jboolean return value >1 makes a mess in further java execution.

JTwork/runtime/BoolReturn/JNIBooleanTest.jtr:
----------System.err:(13/852)----------
java.lang.RuntimeException: Error: bar(2) = false in iteration 2
        at JNIBooleanTest.main(JNIBooleanTest.java:61)

Comments
Sorry, I got that wrong. Approved.
09-04-2021

Hi Christoph, the fix is for 32-bit arm, not 64-bit, so I would still like to backport it. With "I will ignore it then as well", I meant the arm64 port, which is inside the "arm" cpu type directories and which is no longer maintained. This backport might introduce additional problems into the arm64 port, but since it is no longer maintained, it shouldn't be a problem. Currently, it is not possible to build the arm64 port, only the aarch64 port. I am adding the request again.
09-04-2021

Removed jdk11u-fix-request label as per https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-April/005637.html. Please correct me if that was wrong.
09-04-2021

Fix Request(11u) Backporting stabelizes the JNI interface if the user is writing not-so-clean C code and isn't using JNI_TRUE or JNI_FALSE for boolean values. It also fixes the test case "JNIBooleanTest.java" which is testing this case. Patch doesn't apply cleanly, because the arm64 CPU type is still present. Risk for backporting seems low. Review: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-April/005636.html Webrev: https://cr.openjdk.java.net/~cgo/8213845/webrev.11u.00/ Tested: * Hotspot tier1 on linux aarch32 * Hotspot tier1 on linux aarch32 with -XX:+VerifyOops and -Xcheck:jni * Hotspot tier1 on linux ARMv7-A
08-04-2021

OK, the review thread: http://mail.openjdk.java.net/pipermail/hotspot-dev/2018-November/035311.html
20-11-2018

Hi Ningsheng, thank you! I am not working on the issue now. Feel free to go on public review with the patch.
19-11-2018

Here is the patch that Nick has worked out: http://cr.openjdk.java.net/~njian/8213845/webrev.0/ With this patch, jtreg tests passed without regression.
19-11-2018

Hi Boris, Are you working on this? My colleague Nick Gasson also found this issue and had a patch ready - still running tests and should finish soon.
19-11-2018