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

OTP 27 RC3's "erl -man" tries to look up docs for -- #8477

Closed
jrfondren opened this issue May 14, 2024 · 1 comment · Fixed by #8478
Closed

OTP 27 RC3's "erl -man" tries to look up docs for -- #8477

jrfondren opened this issue May 14, 2024 · 1 comment · Fixed by #8478
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@jrfondren
Copy link

jrfondren commented May 14, 2024

Describe the bug
erl man lists shows the manpage for 'lists' (if present), and then shows an error appropriate for the command erl man --

To Reproduce

# OTP 27 RC3
$ PAGER=cat erl -man lists >/dev/null; echo $?
No manual entry for --
16

# OTP 27 RC1 (without docs)
$ PAGER=cat erl -man lists >/dev/null; echo $?
No manual entry for lists
No manual entry for --
16

# OTP 26
$ PAGER=cat erl -man lists >/dev/null; echo $?
0

Expected behavior
erl -man lists should only look up the documentation for the lists module.

Affected versions
Confirmed to be in OTP 27 RC3 and RC1

Additional context
-- is the conventional "stop processing arguments here" argument under Unix.

This happens within erlexec and isn't caused by asdf or another wrapper:

$ ~/.asdf/installs/erlang/27.0-rc1/erts-14.3/bin/erlexec -man lists
No manual entry for lists
No manual entry for --

And is not due to erlexec looping over module names, but due to "--" getting passed as an arg to man:

18:40:54 execve("/usr/bin/man", ["man", "lists", "--"],

The sep handling was recently changed, but the manpage code wasn't at all. I guess that "--" wasn't getting added to argv before in this code path. A simple fix is to not reuse argv in the execvp call, which would change behavior for anyone (probably nobody) who was passing extra arguments to man after the module name.

@jrfondren jrfondren added the bug Issue is reported as a bug label May 14, 2024
@garazdawi garazdawi added the team:VM Assigned to OTP team VM label May 15, 2024
@garazdawi
Copy link
Contributor

Thanks for the report. Fixed available in #8478.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants