JDK-8328703 : Illegal accesses in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ioctl0
  • Type: Bug
  • Component: tools
  • Affected Version: 21,22,23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2024-03-21
  • Updated: 2024-05-27
  • Resolved: 2024-04-25
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 21 JDK 22 JDK 23
21.0.4Fixed 22.0.2Fixed 23 b20Fixed
Related Reports
Relates :  
Description
In Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ioctl0 we see:

    ws.ws_xpixel = env->GetIntField(data, ws_xpixel);

This is wrong: all of the fields in class winsize are of type short.

I don't know if this bug is confined to this particular method.

As an aside, I'm shocked that the JNI accessors, even in debug mode, don't check the types of the fields they access. 
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/172 Date: 2024-04-29 08:54:54 +0000
29-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/540 Date: 2024-04-29 08:55:52 +0000
29-04-2024

[jdk21u-fix-request] Approval Request from Aleksey Shipilëv Fixes the JDK 21 regression. Applies cleanly, simple fix. There are no regression tests, but the jshell tests (AFAICS, the largest jline user) pass. Risk is low: fixes a simple problem with a simple patch.
29-04-2024

[jdk22u-fix-request] Approval Request from Aleksey Shipilëv Fixes the JDK 21 regression. Applies cleanly, simple fix. There are no regression tests, but the jshell tests (AFAICS, the largest jline user) pass. Risk is low: fixes a simple problem with a simple patch.
29-04-2024

Changeset: 87e864bf Author: Jan Lahoda <jlahoda@openjdk.org> Date: 2024-04-25 08:11:56 +0000 URL: https://git.openjdk.org/jdk/commit/87e864bf21d71daae4e001ec4edbb4ef1f60c36d
25-04-2024

Sounds like introduced by JDK-8306983 in JDK 21.
23-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18910 Date: 2024-04-23 09:48:22 +0000
23-04-2024