delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/01/30/20:48:01

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_CZ,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
In-Reply-To: <CAHiT=DE-ja0iAxb5MdE3QZRc-Ro-RcZfaZnAEj2quAfspdJiGg@mail.gmail.com>
References: <201201272150 DOT q0RLoW6A030621 AT fumar DOT sanjose DOT ibm DOT com> <CAHiT=DH+CZAxXZn3bBF3fFnU-HNaC=jzs9VnKAtAQi+MpGwOvw AT mail DOT gmail DOT com> <OFC255D9D8 DOT B30A86FF-ON88257995 DOT 00614BDA-88257995 DOT 0061923D AT us DOT ibm DOT com> <CAHiT=DE-ja0iAxb5MdE3QZRc-Ro-RcZfaZnAEj2quAfspdJiGg AT mail DOT gmail DOT com>
To: Reini Urban <rurban AT x-ray DOT at>
Cc: cygwin AT cygwin DOT com, reini DOT urban AT gmail DOT com
MIME-Version: 1.0
Subject: Re: Perl system() function works sometimes.
X-KeepSent: BDCA45BA:1562BC85-88257996:0006E2AF; type=4; name=$KeepSent
Message-ID: <OFBDCA45BA.1562BC85-ON88257996.0006E2AF-88257996.0009D64B@us.ibm.com>
From: Gary E Barnes <gebarnes AT us DOT ibm DOT com>
Date: Mon, 30 Jan 2012 17:47:28 -0800
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12013101-7282-0000-0000-0000060CFA4B
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I'm confused about what you are talking about.  In particular the "perl 
within perl" part.  I have a perl script.  It puts together shell commands 
and tries to run them using the system() call.  There is no perl calling 
perl so far as I know. 

The script has worked fine for about two years on three machines.  Now 
suddenly it doesn't work on any of them.  I'm hoping that someone has an 
idea.  It may not have anything whatsoever to do with perl as such.  That 
is just where I am seeing the problem.

"There is not enough DLL space."  Interesting, I wasn't aware it was a 
limited resource as such (modulo those inherent in 32-bit addressing).  Is 
there a way to determine what DLL space is in use at a given moment and 
what program(s) are using it?  When I'm running this script the machine is 
a completely idle as I can make it.  It is running only those things I 
have no way to turn off, like anti-virus.  Could this problem be "just" 
that I need to find even more things to halt before running the script?

My main questions are: 
  1) What could possibly have changed?  I mean on the computer.  I don't 
think all of our copies of Cygwin have changed recently.  So some other 
DLL(s) changed perhaps?  Got bigger?
  2) Is there some way to truly diagnose this problem?  How would I go 
about it?

I might be able to rearrange things so that I could call system with a 
list of strings most of the time.  However simple things like this,

      system ("scp machine:remote.file local.file");

have started failing where they've never failed before.  My "perl -e" 
examples were just minimal-failing-programs that I discovered while trying 
to diagnose the problem.  The script is no longer capable of getting to 
the more complicated stuff such as:

    system ("((tar czf - ...... ; echo $? >/tmp/status) | ssh machine 'cat 
- > remote.file) ; exit `cat /tmp/status`'");

I don't think things like that can be turned into a list of string 
arguments.  I really do need to invoke a subshell (or do a great deal of 
process piping on my own).

Would it help reduce DLL space usage if I wrote the commands out to a file 
and ran the file as a shell script underneath Perl? 

        Gary

On Mon, Jan 30, 2012 at 11:45 AM, Gary E Barnes wrote:
> I have tried perlrebase and also rebaseall.  I tried deleting cygwin 
from
> the machine and reinstalling from scratch.
> None of that fixes the problem.  If it is some sort of rebase problem 
then
> the usual tools don't fix it.
>
> And from what you said about calling execve when there are no 
interesting
> shell redirections, it would appear
> that perl calling system() simply doesn't work at all for some reason.

Yes, it failed with a rebaseall-related fork failure because you used 
system
with the system sh-wrapper. If you call it as list you wouldn't see this 
error.

Yes, Calling perl within perl within perl will lead to memory conflicts.
This a known problem we will have to live for a while unfortunately.
There's not enough DLL space. Even less the more apps are loaded.
Yes, this is fragile.

That's why I recommended not to use system with strings.
-- 
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019