JDK-8240518 : Incorrect JNU_ReleaseStringPlatformChars in Windows Print
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,14,15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2012
  • CPU: x86_64
  • Submitted: 2020-03-04
  • Updated: 2021-06-21
  • Resolved: 2020-03-09
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 13 JDK 15 JDK 7 JDK 8 Other
11.0.8Fixed 13.0.4Fixed 15 b16Fixed 7u311Fixed 8u301Fixed openjdk8u312Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.18.1, JRE 11 Windows Server 2012 R2 amd64-64-Bit Compressed References 20200122_442 (JIT enabled, AOT enabled)
OpenJ9   - 51a5857d2
OMR      - 7a1b0239a
JCL      - da35e0c380 based on jdk-11.0.6+10)

ADDITIONAL OS VERSION INFORMATION :
Windows Server 2012R2

A DESCRIPTION OF THE PROBLEM :
Eclipse OpenJ9 VM detected some JNI errors about ReleaseStringChars in Windows Print.
(Hotspot VM has different checks and other warnings were detected.)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Launch SwingSet2 demo with jni checking and OpenJ9
2. Move to TableDemo
3. Click "Print" button
Then, the following errors were detected.

$ java -Xcheck:jni:nonfatal -jar SwingSet2.jar
JVMJNCK001I JNI check utility installed. Use -Xcheck:jni:help for usage
JVMJNCK056E JNI error in ReleaseStringChars: Got memory 0x000000A290E3F3E8 from object 0x00000000002F47E0, releasing from 0x00000000002F47E8
JVMJNCK077E Error detected in sun/print/Win32PrintService.getCapabilities(Ljava/lang/String;Ljava/lang/String;)I

JVMJNCK023E JNI error detected. Continuing...
JVMJNCK056E JNI error in ReleaseStringChars: Got memory 0x000000A290E403A8 from object 0x00000000002F47B8, releasing from 0x00000000002F47C0
JVMJNCK077E Error detected in sun/print/Win32PrintService.getAllResolutions(Ljava/lang/String;Ljava/lang/String;)[I

JVMJNCK023E JNI error detected. Continuing...

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: No errro
Actual: JNI errors were detected

REPRODUCIBILITY :
This bug can be reproduced always.
Comments
Fix Request (8u): Backport to 8u requested because it is a part of 8u301-oracle. Patch applies cleanly after paths changes. Testing: jtreg:javax/print, jck:api/javax_print. Exported 8u changeset: https://cr.openjdk.java.net/~akasko/jdk8u/8240518/8240518_8u.patch
02-06-2021

Fix request (13u) Requesting backport to 13u for parity with 11u, applies cleanly.
09-06-2020

Thank you, Christoph.
28-04-2020

Hi [~tnakamura], I'll sponsor this for you, after running through SAP's regression tests. Cheers Christoph
28-04-2020

Fix Request Backporting this patch solves potential issues of freeing memory. Patch applies cleanly to 11u. Additionally, I'd like to ask a sponsor of the fix, since I'm not a committer.
02-04-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/401496a02949 User: psadhukhan Date: 2020-03-22 11:49:29 +0000
22-03-2020

URL: https://hg.openjdk.java.net/jdk/client/rev/401496a02949 User: pbansal Date: 2020-03-09 09:38:28 +0000
09-03-2020

Added noreg-hard label, since this problem could be checked by the specific JVM.
06-03-2020