RFR: 8261920: [AIX] jshell command throws java.io.IOError on non English locales
Ichiroh Takiguchi
itakiguchi at openjdk.java.net
Mon Feb 22 11:08:40 UTC 2021
On Mon, 22 Feb 2021 10:52:28 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> jshell uses JLine library.
>> JLine checks word "columns" in "stty -a" command output to find out terminal size.
>> The word "columns" was translated on AIX's Japanese locale (other locales also), so above error was happened.
>>
>> OpenJDK for AIX developer could not find this issue because he/she requires AIX Toolbox's coreutils rpm package as build tools.
>> Another stty command is in /opt/freeware/bin/stty, it's in coreutils rpm package.
>>
>> Standard users' system may not have coreutils rpm package or they may not set /opt/freeware/bin in PATH environment variable.
>> stty command should be executed with C locale to get English message.
>> Additionally, JLine library requires -F option. AIX's stty command does not support -F option,
>> but stty command which is in coreutils rpm package supports -F option.
>> On standard jshell usage, -F option may not be used. But when the system has coreutils rpm package, jshell should use this one.
>
> This seems reasonable. Which tests did you run?
No testcase is available for this issue, because it's related Locale setting and translated message on AIX platform.
I just execute jshell command on X11's dtterm and aixterm with Ja_JP locale.
(\uXXXX is actually, Japanese character)
$ ./jshell
| JShell\u3078\u3088\u3046\u3053\u305d -- \u30d0\u30fc\u30b8\u30e7\u30f315.0.2
| \u6982\u8981\u306b\u3064\u3044\u3066\u306f\u3001\u6b21\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044: /help intro
Exception in thread "main" java.io.IOError: java.io.IOException: Unable to parse columns
at jdk.internal.le/jdk.internal.org.jline.terminal.impl.AbstractPosixTerminal.getSize(AbstractPosixTerminal.java:62)
at jdk.internal.le/jdk.internal.org.jline.terminal.Terminal.getBufferSize(Terminal.java:216)
at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.doDisplay(LineReaderImpl.java:741)
at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.<init>(LineReaderImpl.java:298)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$2.<init>(ConsoleIOContext.java:133)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.<init>(ConsoleIOContext.java:133)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:978)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
Caused by: java.io.IOException: Unable to parse columns
at jdk.internal.le/jdk.internal.org.jline.terminal.impl.ExecPty.doGetInt(ExecPty.java:278)
at jdk.internal.le/jdk.internal.org.jline.terminal.impl.ExecPty.doGetSize(ExecPty.java:263)
at jdk.internal.le/jdk.internal.org.jline.terminal.impl.ExecPty.getSize(ExecPty.java:170)
at jdk.internal.le/jdk.internal.org.jline.terminal.impl.AbstractPosixTerminal.getSize(AbstractPosixTerminal.java:60)
... 8 more
$
-------------
PR: https://git.openjdk.java.net/jdk/pull/2622
More information about the kulla-dev
mailing list