Open dlangBugzillaToGithub opened 11 years ago
Please specify the platform (operating system) on which you are encountering this issue. The underlying implementations on Windows and POSIX are very different.
Judging by the error message and the source code, this problem manifested on a POSIX OS.
I can't reproduce this problem on Linux with DMD 2.064. Please specify the platform and post some example code.
The platform is POSIX, Debian Squeeze and DMD 2.064.
It appears to happen only with a certain process. I tried reducing the program for reproduction but when I did that the problem went away. Maybe there's a problem with my code, or with the way the process is being run. I'll take another look at it and see what else I can do to isolate it.
Rob T: can you give an update on this?
I have finally re-encountered this same issue with entirely different code.
Very frustrating.
After hours of digging, including reviewing the std.process source code, it turns out that I had a signal handler set up with this line of code
signal(SIGCHLD, SIG_IGN);
Apparently the above SIGCHLD setting will cause wait(), waitid(), and waitpid() to fail and set errno to ECHILD. However, this was not always the case, for months the same code worked flawlessly until one day it stopped working after making some code changes that had nothing to do with the signal handler and did not alter the executeShell() function call.
What all this means, is that the std.process.d source code is probably fine, however there's no explanation as to why the code will work in almost all cases, then stop working later on. Whatever is going on, probably is unrelated to the std.process code, but I cannot say for certain.
One thing that can be improved, is the exception message string could include hints as to which process call had failed.
More info:
The platform/OS is now Debian Wheezy (64 bit) with all latest patches applied.
DMD64 D Compiler v2.067.1
alanb reported this on 2013-11-28T11:16:25Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=11634
CC List
Description