-
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
Unable to eval using -s init stop in OTP 26 #6916
Comments
Keep in mind the original code is faulty.
But if you increase the timeout:
So you should move the |
I have debugged the root cause of the error:
The io device has since them been terminate (due to |
Per @josevalim I'm going to close this. Thanks! |
Re-opened this per other reports of this issue and someone on Erlang/OTP team saying this is indeed a bug. |
According to documentation:
|
In Erlang/OTP 26 a race condition was uncovered when using `-eval` with `-s init stop` (i.e., it was always there, but most of the community lucked out in not running into it). See erlang/otp#6916 for details
Also resolves issues with erlang/otp#6916 for erlang 26.
* doc: use ex_doc * dep: update srly Ref: erlang/otp#6916
* doc: use ex_doc * dep: update srly Ref: erlang/otp#6916
Update deps for erlang 26 (erlang/otp#6916).
* add otp26 to precompile workflows * fix -s init stop see erlang/otp#6916 * using -s erlang halt for quicker shutdowns --------- Co-authored-by: Cocoa <[email protected]>
Before OTP 26 `-s init stop` seemed to suffice, but it no longer seems to work for evaluating include/lib dirs. Using `-s erlang halt` is recommended per erlang/otp#6916 (comment)
In Erlang/OTP 26 a race condition was uncovered when using `-eval` with `-s init stop` (i.e., it was always there, but most of the community lucked out in not running into it). See erlang/otp#6916 for details
Describe the bug
Up until erlang otp 26 using -s init stop with an -eval switch would allow one to grab some info about erts, this was useful in that one could use this method such in Makefiles, shell scripts, etc.
This now fails with a failed to eval error message. There is a work around for this, which is simply to call
init:stop/0
as part of the eval. This in fact may not be a bug and is intentional, but I didn't see it listed anywhere in release notes.To Reproduce
Expected behavior
$ erl -noshell -s init stop -eval "io:format(\"~s\/erts-~s/include/\", [code:root_dir(), erlang:system_info(version)])." /path/to/erlang/26.0-rc1/erts-14.0/include/
Note that the output will of course differ from platform to platform and depending how exactly you installed erlang/otp.
Work around :
$ erl -noshell -eval "io:format(\"~s\/erts-~s/include/\", [code:root_dir(), erlang:system_info(version)]), init:stop()." /path/to/erlang/26.0-rc1/erts-14.0/include/
Affected versions
The OTP versions that are affected by this bug.
OTP-26.0-rc1
Additional context
No additional context.
The text was updated successfully, but these errors were encountered: