-
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
Support long PATH values in erlexec #9331
base: maint
Are you sure you want to change the base?
Conversation
CT Test Results 3 files 143 suites 49m 0s ⏱️ Results for commit 9ac7bcf. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Hello! Thanks for the fix! Can you add a test to https://github.com/erlang/otp/blob/master/erts/test/erlexec_SUITE.erl ? |
af3cca6
to
07339e8
Compare
@garazdawi how do I run just |
Try |
d666721
to
c4257e7
Compare
@garazdawi We added some test cases for long PATHs and various combinations of the bin directory location in the PATH. |
Previously a finite 10240 buffer was used. Long paths can fail semi-silently, while long paths that already contain the erlang bindir at the end can cause a crash. Co-authored-by: Eric Meadows-Jönsson <[email protected]>
Co-authored-by: Rin Kuryloski <[email protected]> Co-authored-by: Bella Bai <[email protected]>
52cd2da
to
71e9483
Compare
Great! Thanks! Putting into testing over the weekend. |
|
The test assumes that the |
Our understanding of the code existing behavior in erlexec is that the BinPath prepended to the PATH, and any duplicates found later in the path are dropped. In the test, this has already happened once, so BinPath is at the head of the PATH. However, I suppose that leaves open a possibility of an implementation passing this test where that's not actually the case. We can strengthen the test. |
I don't know why, but when running tests through
which makes the "emulator_test" be the first in the path. You should be able to reproduce it like this:
|
The PATH should not end with `:`. Co-authored-by: Rin Kuryloski <[email protected]>
Co-authored-by: Rin Kuryloski <[email protected]>
@@ -554,38 +554,54 @@ int main(int argc, char **argv) | |||
|
|||
if (s == NULL) { | |||
erts_snprintf(tmpStr, sizeof(tmpStr), | |||
"%s" PATHSEP "%s" DIRSEP "bin" PATHSEP, bindir, rootdir); | |||
"%s" PATHSEP "%s" DIRSEP "bin", bindir, rootdir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed the trailing the PATHSEP here since the PATH should never end with :
afaik.
@garazdawi Thanks for giving us a to reproduce the error. Since ts sets a different a PATH it's hard to write tests for both ts and |
Co-authored-by: Brandon Duff <[email protected]>
Co-authored-by: Rin Kuryloski <[email protected]>
Previously a finite 10240 buffer was used. Long paths can fail semi-silently, while long paths that already contain the erlang bindir at the end can cause a crash.
Reproducible with the following bash script:
Output: