New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failed system() doesn't set $? #10186
Comments
From davem@pigeonCreated by davem@pigeon.(none)When the fork of a system() fails, the return value of system() is For example, on a system where there isn't enough virtual memory left, my $ret = system("date"); gives this: ret=-1 See also http://www.perlmonks.org/?node_id=823579 . Perl Info
|
From @rgarciaOn 18 February 2010 17:43, none via RT <perlbug-followup@perl.org> wrote:
$? is supposed to return the status from the child process, which in |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Thu, Feb 18, 2010 at 4:57 PM, Rafael Garcia-Suarez <rgs@consttype.org>wrote:
Except in the reported case, $? *is* set to -1 on error, and people rely on $ perl -wle'print Changing that behaviour will needlessly break backwards compatibility. I |
From @AbigailOn Thu, Feb 18, 2010 at 06:55:56PM -0500, Eric Brine wrote:
But here the fork *succeeds*, it's the exec that's failing. There is still Abigail |
From @iabynOn Thu, Feb 18, 2010 at 10:57:57PM +0100, Rafael Garcia-Suarez wrote:
The system() docs since at least 5.000 have been deeply ambiguous about Note that we already fake up the value of $? under some circumstances: I think system should set $? to -1 on fork failure because: 1) it makes things easier; it is no longer the case that $? and system() 2) We make a lot of code already out there that relied on our ambiguous 3) I for one was very confused by the perlmonks thread and look me along Anyway for info, the history of the system() documentation in perlfunc, ad 5.000 has this basic entry: The return value is the exit status of the program as 5.005_03: added usage examples: @args = ("command", "arg1", "arg2"); You can check all the failure possibilities by inspecting 5.6.0 added: Return value of -1 indicates a failure to start the program (inspect $! 5.10.0 amended return value description and updated the $? processing Return value of -1 indicates a failure to start the program or an if ($? == -1) { -- |
From @ikegamiOn Fri, Feb 19, 2010 at 3:58 AM, Abigail <abigail@abigail.be> wrote:
That's only true if exec() failing and fork() are different classes of To the user, the relevant modes are: system() goes to great lengths to provide that interface. exec() errors are (IPC::Open3 is broken in this regard. Fix pending 5.12's release) |
From @doyWhat kind of system would be able to replicate this problem? Linux seems -doy |
From @iabynOn Mon, Jul 09, 2012 at 10:51:26AM -0700, Jesse Luehrs via RT wrote:
Can't you use 'ulimit -v' or '-u' or similar? -- |
From @doyOn Wed, Jul 11, 2012 at 05:49:26PM +0100, Dave Mitchell wrote:
I tried that, the subprocess just ended up either receiving SIGKILL or -doy |
Migrated from rt.perl.org#72930 (status was 'open')
Searchable as RT72930$
The text was updated successfully, but these errors were encountered: