f



ActiveState Perl 5.10 on Windows XP - can't shell!!??

Searched high and low on this and have found absolutely nothing.  It's
so bizarre.  I've never actually heard of this happening anyway.
(It's Windows, so there's half of the problem there, IMO...)

Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
seemingly no reason at all (of course none that I know about), I can't
shell out of Perl.  For instance:

C:\> perl -e "$dir = `dir`; print $dir;"

Prints nothing.  The `dir` doesn't happen.  I've tried using qx{} as
well.  I have Cygwin running on my machine and it works fine using
Cygwin Perl v5.10.  But not under ActiveState.  I checked with our
security group and as far as they know, no restrictions are being made
on system() or shell calls on software on our systems.  I tried
installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
seem to shell.

Anyone else run into this?  It's so bizarre, I can't even conceive of
what would be blocking this.

-pj
0
Perl
8/30/2010 7:32:05 PM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

7 Replies
9970 Views

Similar Articles

[PageSpeed] 37

Quoth Perl Junkie <perljunkie@gmail.com>:
> Searched high and low on this and have found absolutely nothing.  It's
> so bizarre.  I've never actually heard of this happening anyway.
> (It's Windows, so there's half of the problem there, IMO...)
> 
> Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
> seemingly no reason at all (of course none that I know about), I can't
> shell out of Perl.  For instance:
> 
> C:\> perl -e "$dir = `dir`; print $dir;"
> 
> Prints nothing.  The `dir` doesn't happen.  I've tried using qx{} as
> well.  I have Cygwin running on my machine and it works fine using
> Cygwin Perl v5.10.  But not under ActiveState.  I checked with our
> security group and as far as they know, no restrictions are being made
> on system() or shell calls on software on our systems.  I tried
> installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
> seem to shell.

Do you have either COMSPEC or PERL5SHELL set to something weird in the
environment? Are you attempting to do any of this from a non-standard
terminal emulator (such as 4NT)?

What do you get if you run

    perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"

Are you able to run perl under a C-level debugger, and find out what API
calls it's actually making? (Is there a Win32 equivalent of [ks]trace?)

Ben

0
Ben
8/30/2010 8:22:53 PM
On Aug 30, 3:22=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Perl Junkie <perljun...@gmail.com>:
>
>
>
>
>
> > Searched high and low on this and have found absolutely nothing. =A0It'=
s
> > so bizarre. =A0I've never actually heard of this happening anyway.
> > (It's Windows, so there's half of the problem there, IMO...)
>
> > Running ActiveState Perl v5.10 on Windows XP. =A0All of a sudden, for
> > seemingly no reason at all (of course none that I know about), I can't
> > shell out of Perl. =A0For instance:
>
> > C:\> perl -e "$dir =3D `dir`; print $dir;"
>
> > Prints nothing. =A0The `dir` doesn't happen. =A0I've tried using qx{} a=
s
> > well. =A0I have Cygwin running on my machine and it works fine using
> > Cygwin Perl v5.10. =A0But not under ActiveState. =A0I checked with our
> > security group and as far as they know, no restrictions are being made
> > on system() or shell calls on software on our systems. =A0I tried
> > installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
> > seem to shell.
>
> Do you have either COMSPEC or PERL5SHELL set to something weird in the
> environment? Are you attempting to do any of this from a non-standard
> terminal emulator (such as 4NT)?
>
> What do you get if you run
>
> =A0 =A0 perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:=
"
>

Result is:

:65280:65280:No such file or directory:The filename or extension is
too long:

But $! isn't alwaya reset.  I was getting "Bad filename descriptor" at
one point in time.  Interestingly, we used similar delimiters for a
similar command I also issued. :-)  Freaky how techs think. :-)

I'm still submarined.  (Man, I hate Windows, but there's no choice in
the matter here.)

-PJ
0
Perl
8/30/2010 9:56:57 PM
Quoth Perl Junkie <perljunkie@gmail.com>:
> On Aug 30, 3:22�pm, Ben Morrow <b...@morrow.me.uk> wrote:
> >
> > Do you have either COMSPEC or PERL5SHELL set to something weird in the
> > environment? Are you attempting to do any of this from a non-standard
> > terminal emulator (such as 4NT)?

I presume since you didn't answer that these are all 'no's?

> > What do you get if you run
> >
> > � � perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"
> 
> Result is:
> 
> :65280:65280:No such file or directory:The filename or extension is
> too long:

OK, well that doesn't say much. 65280 is just a POSIX-wait-statussed
255, so this is probably a failure of win32_spawnvp.

My next step, were I trying to solve this, would be to build a perl with
a whole lot of debugging statements sprinkled throughout win32/win32.c,
but I can see you might not be in a position to do that.

Something else you could try: can you start processes with
Win32::Process? That's a good deal closer to CreateProcess(3), so it
might give us some idea of where the problem is. (It also might give an
accurate error indication that hasn't been stomped on by some other
code.)

Ben

0
Ben
8/30/2010 10:20:38 PM
On Mon, 30 Aug 2010 12:32:05 -0700 (PDT), Perl Junkie <perljunkie@gmail.com> wrote:

>Searched high and low on this and have found absolutely nothing.  It's
>so bizarre.  I've never actually heard of this happening anyway.
>(It's Windows, so there's half of the problem there, IMO...)
>
>Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
>seemingly no reason at all (of course none that I know about), I can't
>shell out of Perl.  For instance:
>
>C:\> perl -e "$dir = `dir`; print $dir;"

I have no problem running this from my command line.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\temp>perl -v

This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 5 registered patches, see perl -V for more detail)

Copyright 1987-2007, Larry Wall

Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com
Built Sep  3 2008 13:16:37

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

-sln
0
sln
8/30/2010 11:35:30 PM
On Mon, 30 Aug 2010 21:22:53 +0100, Ben Morrow <ben@morrow.me.uk> wrote:

>
>Quoth Perl Junkie <perljunkie@gmail.com>:
>> Searched high and low on this and have found absolutely nothing.  It's
>> so bizarre.  I've never actually heard of this happening anyway.
>> (It's Windows, so there's half of the problem there, IMO...)
>> 
>> Running ActiveState Perl v5.10 on Windows XP.  All of a sudden, for
>> seemingly no reason at all (of course none that I know about), I can't
>> shell out of Perl.  For instance:
>> 
>> C:\> perl -e "$dir = `dir`; print $dir;"
>> 
>> Prints nothing.  The `dir` doesn't happen.  I've tried using qx{} as
>> well.  I have Cygwin running on my machine and it works fine using
>> Cygwin Perl v5.10.  But not under ActiveState.  I checked with our
>> security group and as far as they know, no restrictions are being made
>> on system() or shell calls on software on our systems.  I tried
>> installing/upgrading to AS Perl v5.12 -- the latest -- but still can't
>> seem to shell.
>
>Do you have either COMSPEC or PERL5SHELL set to something weird in the
>environment? Are you attempting to do any of this from a non-standard
>terminal emulator (such as 4NT)?
>
>What do you get if you run
>
>    perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"

This is not quoted properly

    perl -le "system 'dir'; print \":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:\""

Even fixed, it just shows the directory, then some junk at the end
 :0::No such file or directory::

-sln
0
sln
8/30/2010 11:40:12 PM
On 31.08.2010 00:20, Ben Morrow wrote:
> 
> Quoth Perl Junkie <perljunkie@gmail.com>:
>> On Aug 30, 3:22�pm, Ben Morrow <b...@morrow.me.uk> wrote:
>>>
>>> Do you have either COMSPEC or PERL5SHELL set to something weird in the
>>> environment? Are you attempting to do any of this from a non-standard
>>> terminal emulator (such as 4NT)?
> 
> I presume since you didn't answer that these are all 'no's?

I agree, this is an important question.

>>> What do you get if you run
>>>
>>> � � perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"
>>
>> Result is:
>>
>> :65280:65280:No such file or directory:The filename or extension is
>> too long:
> 
> Something else you could try: can you start processes with
> Win32::Process? That's a good deal closer to CreateProcess(3), so it
> might give us some idea of where the problem is. (It also might give an
> accurate error indication that hasn't been stomped on by some other
> code.)

Hm... indeed very strange. As Ben mentioned CreateProcess, another idea
came to my mind. Is a "Personal Firewall" installed on your machine or
any other "security" software? If yes, that could be the cause for these
problems.

Wolf
0
Wolf
9/1/2010 8:58:02 AM
On Sep 1, 3:58=A0am, Wolf Behrenhoff
<NoSpamPleaseButThisIsVal...@gmx.net> wrote:
> On 31.08.2010 00:20, Ben Morrow wrote:
>
>
>
> > Quoth Perl Junkie <perljun...@gmail.com>:
> >> On Aug 30, 3:22 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> >>> Do you have either COMSPEC or PERL5SHELL set to something weird in th=
e
> >>> environment? Are you attempting to do any of this from a non-standard
> >>> terminal emulator (such as 4NT)?
>
> > I presume since you didn't answer that these are all 'no's?
>
> I agree, this is an important question.
>
> >>> What do you get if you run
>
> >>> perl -le "system 'dir'; print ":$?:${^CHILD_ERROR_NATIVE}:$!:$^E:"

FYI, I re-quoted this with qq{} first before running.  Yes, as it was
originally submitted, it had quoting issues.

>
> >> Result is:
>
> >> :65280:65280:No such file or directory:The filename or extension is
> >> too long:
>
> > Something else you could try: can you start processes with
> > Win32::Process? That's a good deal closer to CreateProcess(3), so it
> > might give us some idea of where the problem is. (It also might give an
> > accurate error indication that hasn't been stomped on by some other
> > code.)
>
> Hm... indeed very strange. As Ben mentioned CreateProcess, another idea
> came to my mind. Is a "Personal Firewall" installed on your machine or
> any other "security" software? If yes, that could be the cause for these
> problems.

No firewalls or anything.  I'm over here doing the same thing --
thinking something was installed on my machine... a patch? ...a new
GPO? ...a new setting in McAfee?  I mean, it just STOPPED WORKING and
it makes NO SENSE.

The Win32::Process idea is a good idea.  I'll try that.  Otherwise, I
may have to actually reimage my machine over this.  Another notch in
my "Why I hate Windows" belt...

-pj
0
Perl
9/7/2010 8:11:15 PM
Reply: