Bug 11634 – std.process executeShell() Exception message is incomplete

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-11-28T11:16:25Z
Last change time
2024-12-01T16:19:15Z
Assigned to
No Owner
Creator
Rob T
Moved to GitHub: phobos#9618 →

Comments

Comment #0 by alanb — 2013-11-28T11:16:25Z
If the process being launched does not exist, the reported message in the Exception does not state what process is missing. All you get is this: "Process does not exist or is not a child process." A lot more information concerning the process should be available for reporting that will help identify what went wrong.
Comment #1 by dlang-bugzilla — 2014-02-11T16:08:06Z
Please specify the platform (operating system) on which you are encountering this issue. The underlying implementations on Windows and POSIX are very different.
Comment #2 by dlang-bugzilla — 2014-02-11T16:09:34Z
Judging by the error message and the source code, this problem manifested on a POSIX OS.
Comment #3 by dlang-bugzilla — 2014-02-11T16:50:19Z
I can't reproduce this problem on Linux with DMD 2.064. Please specify the platform and post some example code.
Comment #4 by alanb — 2014-02-11T17:03:22Z
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.
Comment #5 by justin — 2014-06-06T17:14:58Z
Rob T: can you give an update on this?
Comment #6 by alanb — 2015-07-21T03:43:39Z
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
Comment #7 by robert.schadek — 2024-12-01T16:19:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9618 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB