-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Erlang 26 breaks command line on Windows #7621
Comments
Related #7548 |
This is needed for cmd.exe to have the correct settings after it has been terminated by Ctrl-C. Powershell does not need this, but it does not hurt either. Closes erlang#7548 Closes erlang#7621
Was this fixed in 26.1.2? |
The fix is to be released in 26.2. Sine GitHub does not notify when issues are updated I never noticed that this issue had been updated with more bug reports, so not all bugs listed above have been fixed yet. I’m therefore re-opening this issue. |
Thank you for working on this. This has been a pain. May I ask, does this happen because... Windows sucks? Would this kind of problem ever happen on Linux? Or MacOS? |
The same issue has been present on most other platforms. Here is an example here we fixed the same issue on MacOS: #3796. So in this partucular case, Windows is not worse than most others 😄 One of the things were Windows is not as good as the other platforms is the fact that it is very difficult/impossible to write automated tests for the console. So it is very easy for us to change something and not knowing that it breaks on Windows until someone reports it. We do some manual testing, but it is hard to test everything that our automated tests on other platforms test. |
@thojanssens I switched to PowerShell as it doesn't have this issue. |
I have also done that, but the issue is still there on cmd |
I'm finding that OTP 26.2.1 (latest at the time of writing) + Elixir 1.16.0 will hang on Windows 11. The behaviour is intermittent but reproduces more often than not. I assume that the issue I'm encountering is related to those described on this issue hence posting here. The application continues running but nothing is echo'd back to me on the console when I attempt to interact with it. Pressing Ctrl+C a couple of times exits as expected, (perhaps) interestingly printing the BREAK message several times (more times than I would otherwise expect). It does seem like I can cause the command prompt to stay alive and continue accepting input as expected by (and I know this sounds silly) pressing return a bunch of times as soon after startup as I can. I've reproduced in these combinations:
I can revert to OTP 25 of course but the promise of being able to work without It seems to be very difficult to get any useful information out of |
If you do "Ctrl+Break" then "A" and then "Enter" you will create a crash dump of you system called erl_crash.dump. You can then use crashdump viewer to view the dump and dig around so see what is going on. If nothing if private in the dump, feel free to post it here and I can have a look. |
@garazdawi thanks for the offer. Here's an |
@garazdawi In the most polite recognising-that-you-must-have-plenty-of-other-stuff-to-do way, is there any chance that you might have found anything useful in that crash log that I attached on the previous reply to this message? Thanks for any help you're able to provide. |
Thanks for the ping, I had forgotten that you added a dump. From what I can tell Elixir has not started the reading end of the tty (that is shell:start_interactive/0 has not been called). Maybe @josevalim can shed some light on when that may happen? |
@joeapearson which command (elixir, mix, iex, etc) do you run when you see the hanging? |
Seems to be If you open the dump using crash dump viewer you will see the command line options in the stacktrace of the init process. |
Thank you @garazdawi! Looking at the @joeapearson if you are running In order to support both Erlang/OTP 26 and earlier, our boot process goes like this.
-module(custom_user).
-compile(export_all).
start() -> user_drv:start(#{initial_shell => noshell}).
@joeapearson can you try reproducing the issue with the steps above? You can try executing the third step several times. |
Yes, you are right. I thought I checked there but apparently not. Seems like this is an issue in our code. Sorry for the noise. For some reason the reader process has crashed... I wonder why... |
No worries, I am also glad to help trim down any issue that involves Elixir so you have to debug only Erlang (and not Elixir). |
@joeapearson when github actions has finished with #8103 it will produce a windows installer with an Erlang with some extra logs for when the tty reader crashes. If you could have a go and see if you can reproduce the behaviour with that version of Erlang that would be great. If you can reproduce it, then please attach the crash dump again so that I can view it. |
ping @joeapearson, do you have some time to reproduce the error or should I close this issue? |
I thought I'd give OTP 26 another go but I'm getting an intermitent error running the latest (OTP 26.2.5, Elixir 1.16.2-otp-26) when using Windows Powershell, Command Prompt or Powershell Core (aka Powershell).
in
|
strange, what you are doing "works on my machine". How often do you get that error? |
I think it was almost every time with Windows Powershell and Command Prompt and less often with Powershell Core. Originally I thought Powershell Core worked because it ran fine a few times. |
This issue remains in OTP 27 and seems to happen more frequently when running When running Simon's command from above (#7621 (comment)) I had one crash after 13 runs. Maybe run a check in the source code for unlucky numbers? ;) |
A user on ElixirForum mentioned that running |
I ran |
I have I tried it in the developer command prompt, with and without |
Still getting the overlapped IO crash intermittently when running @nixxquality @joeapearson @Ilyushya want to check on the latest versions? |
@simonmcconnell I've updated Erlang & Elixir. Luckily, I am not having that particular problem, but I do have a problem of faulty character printing when a recursive function in a Mix app grabs input from console and prints it back if it's not abusive, and prints "!@#$" in case it is.
The backspace key removes whole words. That's a problem I've experienced some time before |
|
It is still on my todo list. Hope to have it done by 27.1. A PR would help speed things along. |
If I had any clue what was causing the issue I would attempt to contribute a PR :) I ran a simple autohotkey script to repeatedly open and close an erl shell and after more than 10 minutes it hadn't crashed.
|
PR #8774 is an attempt to address the |
It seems very promising! I didn't see a single crash despite a lot of attempts. |
Great! Thanks for testing. The fix will be included in 27.1. From what I can tell this is a race that is triggered if the user types anything or resizes the console window as rebar3 is starting the shell. It may also trigger on the mouse moving, but I don't think it should. |
I don't think I've been doing any of that, but I'm willing to blame PowerShell if you are. |
I think that 27.1 will fix all issues mentioned in this issue. If you continue to have problems with the new shell on Windows please open new issues describing what is happening. |
Describe the bug
After further actions dialog appears (that one that appears after
^c
), some buttons start (like arrows andAlt
) producing incoherent mess (similar to special symbol combinations usually used for making coloured text in Windows CMD and Powershell).In June(June 26, particularly), when I experienced the issue the first time, even Clipdiary, a clipboard manager, used to break.
The backspace key starts deleting whole words.
backspace.by.word.mp4
broken.clipdiary.mp4
normal.clipdiary.example.mp4
Ctrl-C
, fineTo Reproduce
Run any BEAM app and pick a further action
Expected behavior
The console doesn't break
Affected versions
26
Notes
I suspect the disappearance of the GUI app and this flaw are linked.
The text was updated successfully, but these errors were encountered: