Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JLine 3.24.0 crashes #889

Closed
wendigo opened this issue Oct 31, 2023 · 4 comments
Closed

JLine 3.24.0 crashes #889

wendigo opened this issue Oct 31, 2023 · 4 comments
Milestone

Comments

@wendigo
Copy link

wendigo commented Oct 31, 2023

JLine 3.21.0 was working, while Jline 3.24.0 crashes with following exception for trino-cli (https://github.com/trinodb/trino/tree/master/client/trino-cli):

master$ client/trino-cli/target/trino-cli-431-SNAPSHOT-executable.jar
trino> s;
Exception in thread "main" java.io.IOError: java.io.IOException: Error executing '/opt/homebrew/opt/coreutils/libexec/gnubin/stty icrnl ixon echo icanon iexten min 1 time 0': stty: 'standard input': unable to perform all requested operations
	at org.jline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:57)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:774)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:553)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:538)
	at io.trino.cli.InputReader.readLine(InputReader.java:71)
	at io.trino.cli.Console.runConsole(Console.java:244)
	at io.trino.cli.Console.run(Console.java:192)
	at io.trino.cli.Console.call(Console.java:109)
	at io.trino.cli.Console.call(Console.java:79)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at io.trino.cli.Trino.main(Trino.java:47)
Caused by: java.io.IOException: Error executing '/opt/homebrew/opt/coreutils/libexec/gnubin/stty icrnl ixon echo icanon iexten min 1 time 0': stty: 'standard input': unable to perform all requested operations
	at org.jline.utils.ExecHelper.exec(ExecHelper.java:48)
	at org.jline.terminal.impl.exec.ExecPty.doSetAttr(ExecPty.java:104)
	at org.jline.terminal.impl.AbstractPty.setAttr(AbstractPty.java:46)
	at org.jline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:55)
	... 17 more
@wendigo
Copy link
Author

wendigo commented Oct 31, 2023

It can be reproduces with homebrew installed coreutils on MacOS:

❯ PATH=/opt/homebrew/opt/coreutils/libexec/gnubin/:$PATH ./client/trino-cli/target/trino-cli-431-SNAPSHOT-executable.jar
trino> s;
Exception in thread "main" java.io.IOError: java.io.IOException: Error executing '/opt/homebrew/opt/coreutils/libexec/gnubin/stty icrnl ixon echo icanon iexten min 1 time 0': stty: 'standard input': unable to perform all requested operations
        at org.jline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:57)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:774)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:553)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:538)
        at io.trino.cli.InputReader.readLine(InputReader.java:71)
        at io.trino.cli.Console.runConsole(Console.java:244)
        at io.trino.cli.Console.run(Console.java:192)
        at io.trino.cli.Console.call(Console.java:109)
        at io.trino.cli.Console.call(Console.java:79)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at io.trino.cli.Trino.main(Trino.java:47)
Caused by: java.io.IOException: Error executing '/opt/homebrew/opt/coreutils/libexec/gnubin/stty icrnl ixon echo icanon iexten min 1 time 0': stty: 'standard input': unable to perform all requested operations
        at org.jline.utils.ExecHelper.exec(ExecHelper.java:48)
        at org.jline.terminal.impl.exec.ExecPty.doSetAttr(ExecPty.java:104)
        at org.jline.terminal.impl.AbstractPty.setAttr(AbstractPty.java:46)
        at org.jline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:55)
        ... 17 more
(base)

It works with the MacOS provided stty (tested on Sonoma)

@wendigo
Copy link
Author

wendigo commented Oct 31, 2023

I don't know whether 12219fa was removed intentionally, but applying this change to master fixes this issue.

gnodet added a commit to gnodet/jline3 that referenced this issue Oct 31, 2023
@gnodet
Copy link
Member

gnodet commented Oct 31, 2023

I don't think it was, I've pushed a possible fix if you could double check.

@wendigo
Copy link
Author

wendigo commented Oct 31, 2023

@gnodet works!

@gnodet gnodet added this to the 3.24.1 milestone Oct 31, 2023
@gnodet gnodet closed this as completed in 47f1ec9 Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants