-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
src/std/process.d: _spawnvp error handling is broken #10099
Labels
Comments
danny.milo commented on 2014-11-19T21:36:22ZCreated attachment 1454
Tests whether spawnvp magically forks processes for the caller
Tests whether spawnvp magically switches processes. Try with version(Posix) implementation of spawnvp. |
danny.milo commented on 2014-11-19T21:56:03ZCreated attachment 1455
Patch to make _spawnvp less bad
checks waitpid() return value, does not magically put the caller into a new process. Does not properly handle EINTR. |
danny.milo commented on 2014-11-19T22:00:46ZSee http://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html |
danny.milo commented on 2014-11-25T18:25:13ZAlso, both the OSX and the Posix version of browse in the same file are broken in the same way... |
bugzilla (@WalterBright) commented on 2019-12-10T10:27:22Zspawnvp seems only to exist for windows now. But I did not check if this has been the case in 2014 too.
Tried to adapt the test for "browse":
```
import std.process;
import core.thread;
int main() {
auto pidBefore = getpid();
try {
browse("DOESNOTEXIST");
assert(false);
} catch(Exception e) {
auto pidAfterwards = getpid();
assert(pidBefore == pidAfterwards); // make sure we are still in the same process
}
return 0;
}
```
This produces an Assertion failure (POSIX). And the process seems still to be running after the main process has stopped. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
danny.milo (@daym) reported this on 2014-11-19T21:33:14Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=13753
CC List
Description
!!!There are attachements in the bugzilla issue that have not been copied over!!!
The text was updated successfully, but these errors were encountered: