[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: Crash when dying on warning from backticks with vfork() (5.6.1 on Lamp)
On Mon, Sep 29, 2008 at 10:15:49AM -0500, Steve Peters wrote:
> On Mon, Sep 29, 2008 at 12:05 AM, Joshua Juran <jjuran@gmail.com> wrote:
> > A related issue exists for fork-enabled systems:
> >
> > $ perl -we '$SIG{__WARN__} = sub { die }; `/dev/null/`;'
> > Died at -e line 1.
> > $ echo $?
> > 0
> > $ perl -v | head -2 | tail -1
> > This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
> >
> > Arguably, perl shouldn't be indicating success in the presence of an
> > uncaught exception. In this case, perhaps the child should merely
> > communicate the failure back to the parent, and let it issue the warning,
> > which would solve both problems.
> >
> > Josh
> >
> >
>
> When the "die" happens, its in the child process. I'm assuming you
> want a wait() somewhere in there if the child process exit status is
> important to you. For example...
True. But I see that as an implementation detail. Perl defines what `` mean,
and whilst it happens that they have to be implemented with fork on an OS
that is only good at one thing*, I don't see why we have to enforce the side
effects onto the programmer.
So if making the error appear in the parent is consistent with solving a
crash on (admittedly rare) vfork-only systems, it seems like a good idea.
Nicholas Clark
* by design.
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]