-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: report more precise error from StartProcess #3649
Labels
Comments
If we remove the current check, we need to do something else to address the problem it is fixing. Maybe it would work to send back more than just the one number from the child process. If we sent back both what was going on and the error, that might be enough. The problem is that the child sends back <error-from-chdir> and then the parent makes an error that says exec program: <error-from-chdir> which inevitably ends up saying something confusing like exec program: path does not exist which is bogus. The current code checks the directory early so that it can return an error like chdir dir: path does not exist instead. Status changed to Accepted. |
I understand that exec() errors can be confounding. Since there is a pipe in startProcess() for communication, the child process could simply send a complete error string down the pipe, maybe prefixed with an errno number? If that is not possible within the constraints (no malloc, no locks, etc.) in the child, we could send the syscall number instead, so the error would be "SYS_CHDIR failed: ENOENT" (I'd be happy to try to send a patch, it's overdue for me to get my hands dirty with the go source code.) |
This issue was closed by revision d36c095. Status changed to Fixed. |
rsc
pushed a commit
that referenced
this issue
May 11, 2015
««« backport 2aaa88600d48 os: make POSIX StartProcess work with chroot again. Skip directory check in startProcess in the presence of SysProcAttr. Fixes #3649. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6297083 »»»
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: