hexpm / bob

The Builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dorian-marchal opened this issue · comments

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.

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?

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

FYI that's fixed in OTP 24.0.6