This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: fork() and NT error 0xC0000135 (STATUS_DLL_NOT_FOUND)
- From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr at ncbi dot nlm dot nih dot gov>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Tue, 29 Oct 2013 18:13:15 +0000
- Subject: RE: fork() and NT error 0xC0000135 (STATUS_DLL_NOT_FOUND)
- Authentication-results: sourceware.org; auth=none
- References: <5F8AAC04F9616747BC4CC0E803D5907D0C40B026 at MLBXv04 dot nih dot gov> <526FED2A dot 20906 at cygwin dot com> <20131029172157 dot GA6342 at calimero dot vinschen dot de>
> platforms expect /bin and/or /usr/bin to be in your path
I'm not following... cygrunsrv.exe is started by Windows service controller,
and then spawns the server binary. There's no point in this sequence of actions
to modify PATH. I also believe, PATH is made compliant with what POSIX requirement
by that very cygwin1.dll implicitly (and that happens when cygrunsrv gets launched,
so cygwin1.dll figures out the CYGWIN "root" directory, then evaluates the path where
to expect all other CYGWIN dlls). For cygrunsrv, the server binary is specified as an
absolute path with -p "/opt/path/to/bin/server.exe", which is within the rudimentary
CYGWIN tree that also has "/bin" (rooted at some Windows directory, C:\Apps\CYGWIN).
> Two points:
>
> - cygrunsrv adds /bin to $PATH before calling the service executable.
>
> - STATUS_DLL_NOT_FOUND does *not* imply that cygwin1.dll isn't found.
> It could be any other DLL required by the executable but not in $PATH.
>
Without chdir("/") fork() is able to succeed; and the server binary does not
depend on any other non-Windows DLLs that are not in the "/bin" CYGWIN directory.
But with chdir("/") in place, if I insert (when manually simulating the very same
failure from a limited user account) "C:\Apps\CYGWIN\bin" into Windows PATH before
calling the server binary, it is able to fork successfully. (Without the addition,
it fails same way with the same error 0xC00000135 even when run interactively.)
Anton Lavrentiev
Contractor NIH/NLM/NCBI