-
Notifications
You must be signed in to change notification settings - Fork 540
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
During a system(), unquoted Perl vars are evaluated _after_ the fork() call #13561
Comments
From gpiero@rm-rf.itCreated by gpiero@rm-rf.itHi, I've recently noticed the following behaviour: $ perl -l The last pid printed (from the system() with unquoted $$) is the pid of From my tests, this behaviour is in place since 5.16.0. With previous At first I thought it was shelling out even if it shouldn't, but both a $ perl -l Attached you can find the system-evaluate-vars-after-fork.t test file system-evaluate-vars-after-fork-portable.t should be an equivalent test Thanks, [0] Some minor releases missing, but the latest release of every major Perl Info
|
From gpiero@rm-rf.itForgotten attachments. Ciao, |
From gpiero@rm-rf.it#!./perl use strict; use File::Spec; require 't/test.pl'; # Blatantly copied from _fresh_perl() sub _capture # Given the choice of the mis-parsable {} open TEST, ">$tmpfile" or die "Cannot open # VMS adjustments # VMS file locking print TEST $prog; my $results = runperl(%$runperl_args); # Clean up the results into something a bit more predictable. # bison says 'parse error' instead of 'syntax error', if ($is_vms) # pipes double these sometimes return $results; my $perl sub generate_echo_exe my $echo = generate_echo_exe(); SKIP: my @tests = ( for my $t (@tests) |
From gpiero@rm-rf.it#!/usr/bin/env perl use strict; use Test::More; my my ( chomp( $system, $quoted_system, $backticks ); is( $system, done_testing(); |
From perl5-porters@perl.orgGian Piero Carrubba wrote:
I think this is related to #104084. |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Thu, Jan 30, 2014 at 01:53:35PM -0000, Father Chrysostomos wrote:
It bisects to commit 0e21945 Turn $$ into a magical readonly variable that always fetches getpid() instead of caching it Maybe system() should call get magic on its args *before* forking? -- |
From perl5-porters@perl.orgDave Mitchell:
Zigackly. |
From @rjbs* via RT <perlbug-followup@perl.org> [2014-01-28T14:15:39]
Thanks, that's a great catch! -- |
From jkahrman@mathworks.comCreated by jkahrman@mathworks.com$$ ($PID, $PROCESS_ID) is not being passed correctly to the process spawned by 5.20.2 (debian 8's package and built independently from source) 5.8.8 DB<5> x system 'echo', $$ ----------------------------- Running these statements as part of a script behave the same way as the Given this: print "2\n"; print "3\n"; print "4\n"; 5.8.8 and 5.14 return the same value everywhere: But Perl 5.20 doesn’t return the same value: Nor does ActivePerl 5.18: Perl Info
|
From @jkeenanOn Fri, 16 Dec 2016 17:41:21 GMT, jkahrman@mathworks.com wrote:
Feature, not a bug. The behavior you are observing was introduced five years ago: commit 0e21945 Turn $$ into a magical readonly variable that always fetches getpid() instead of caching it -- |
The RT System itself - Status changed from 'new' to 'open' |
@jkeenan - Status changed from 'open' to 'rejected' |
From @LeontOn Sat, Dec 17, 2016 at 2:56 AM, James E Keenan via RT <
I don't think this can reasonably be described as a feature. This clearly This is a a duplicate of #121105, and the fix proposed there still sounds Leon |
@jkeenan - Status changed from 'rejected' to 'open' |
From @LeontOn Thu, Jan 30, 2014 at 4:00 PM, Dave Mitchell <davem@iabyn.com> wrote:
The simplest solution would be to just create mortal copies of the stack in Though to be honest, that function has been a mess for a long time and the Leon |
From zefram@fysh.orgFixed in commit 64def2a. -zefram |
@xsawyerx - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#121105 (status was 'resolved')
Searchable as RT121105$
The text was updated successfully, but these errors were encountered: