GNU bug report logs -
#56002
src/process.c; make-process fails to clean up stderr process on early exit
Previous Next
Full log
Message #29 received at 56002 <at> debbugs.gnu.org (full text, mbox):
> TBH, I don't understand the rationale well enough. What does it mean
> we "leak stderr process"? isn't the stderr process recycled if
> make-process fails?
When the stderrproc is created internally there is no way that it can be
reused because nothing else has a reference to it. The changes here only
deal with cases where a stderrproc is not provided by the caller.
> Is it just a matter of some simple change in the
> control flow, to make sure we always go through the cleanup code
> before we return?
There is no way easy way to modify the control flow because there are
so many possible points where process creation can fail unexpectedly
that must be handled if the stderrproc is created too early.
It is very hard to determine exactly which statements inside of make
process can produce unexpected exits, I have encountered at least
two, but I'm sure there are others. Thus the safest thing to do was to
move creation of stderrproc after all the points where process creation
can potentially fail (e.g. failures during vfork).
> In general, I'd prefer not to change timing of what we do in
> make-process unless it's really unavoidable. There's a lot of
> system-dependent stuff there, and who knows what will that cause on
> some platform?
I'm fairly certain that it is impossible for there to be any interaction between
the primary process and the stderr proc at any point in time prior to where
I moved the creation of the stderrproc because the first reference to
p->stderrproc after it is created is in create_process.
This bug report was last modified 3 years ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.