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

docker image : Reverse-searching (^R) a long command crashes iex #96

Closed
dorian-marchal opened this issue Aug 12, 2021 · 3 comments
Closed

Comments

@dorian-marchal
Copy link

dorian-marchal commented Aug 12, 2021

Docker Image

hexpm/elixir:1.12.2-erlang-24.0.5-alpine-3.13.5 (same issue with 3.14.0)

Description

In iex, when using the reverse-search (Ctrl+R) to get a long command (about 50 chars), the REPL crashes.

Reproducing steps

docker run -it hexpm/elixir:1.12.2-erlang-24.0.5-alpine-3.13.5 iex

iex(1)> "a short string"
"a short string"

*do Ctrl+R here, then press Enter: no problem*

iex(3)> "this is a very long string that will crash iex"
"this is a very long string that will crash iex"

*do Ctrl+R here, then press Enter: iex crashes with no error message*

This doesn't happen with the official image (elixir:1.12.2-alpine) but unfortunately I need to explicitly pick versions for erlang and alpine.

Note: if I run sh first, then iex, I get an "Illegal Instruction" error instead of a crash.

@wojtekmach
Copy link
Member

wojtekmach commented Aug 12, 2021

Thank you for the report. I was able to reproduce this on official alpine image with elixir installed with apk:

~% docker run --rm -it alpine
/ # apk add elixir
...
OK: 84 MiB in 22 packages
/ # iex
Erlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:no-native-stack]

Interactive Elixir (1.12.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> "this is a very long string that will crash iex"
"this is a very long string that will crash iex"
(search)`Illegal instructionlong string that will crash iex"
                            / #
                                / #

In fact I can also reproduce this with the erlang shell:

~% docker run --rm -it alpine
/ # apk add erlang
...
OK: 71 MiB in 19 packages
/ # erl
Erlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:no-native-stack]

Eshell V12.0  (abort with ^G)
1> "this is a very long string that will crash iex"
(search)`Illegal instructionlong string that will crash iex"
                            / #

given it's a bug in neither Bob nor Elixir, I'm gonna close this. Could you follow-up on it elsewhere, perhaps https://github.com/erlang/otp/issues/new/choose?

@dorian-marchal
Copy link
Author

Thanks, follow-up issue: erlang/otp#5116

@dorian-marchal
Copy link
Author

FYI that's fixed in OTP 24.0.6

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