| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| 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 |
| Message-ID: | <42E76865.4000301@familiehaase.de> |
| Date: | Wed, 27 Jul 2005 12:56:37 +0200 |
| From: | "Gerrit P. Haase" <gerrit AT familiehaase DOT de> |
| User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 |
| MIME-Version: | 1.0 |
| To: | Krzysztof Duleba <krzysan AT skrzynka DOT pl> |
| CC: | cygwin AT cygwin DOT com |
| Subject: | Re: perl - segfault on "free unused scalar" |
| References: | <dc7n8k$m72$1 AT sea DOT gmane DOT org> |
| In-Reply-To: | <dc7n8k$m72$1@sea.gmane.org> |
| X-IsSubscribed: | yes |
Krzysztof Duleba wrote:
> While playing with perl in interactive mode, I experienced strange
> memory error in Cygwin perl. Trying the same scenario on Linux boxes
> results in perl being killed after using all memory (tested on machines
> with 128 - 2048 MB RAM), but on Cygwin perl dies in a different way.
>
> The following script was executed to run perl in interactive mode:
>
> $ cat inter.pl
> #!/usr/bin/perl
>
> use Term::ReadLine;
> use IO::Handle;
>
> my $prompt = "perl> ";
>
> my $term = new Term::ReadLine $prompt;
> my $OUT = $term->OUT;
>
> while ( defined($_ = $term->readline($prompt)) ) {
> next unless /\S/;
> eval $_;
> chomp $@;
> printf "%s\n", $@ if $@;
> }
>
> Now how perl died:
>
> $ ./inter.pl
> perl> sub foo($){$a=shift;foo($a+1);}
> perl> foo 1
> Out of memory during "large" request for 134221824 bytes, total sbrk()
> is 273211392 bytes at (eval 18) line 1.
> perl> foo 1
> Out of memory during request for 67289644 bytes, total sbrk() is
> 394086400 bytes
> !
> Attempt to free unreferenced scalar: SV 0x1d079aec, Perl interpreter:
> 0x10140240 at (eval 18) line 1.
> Segmentation fault (core dumped)
With 5.8.7 I get the core dump after calling `foo 1` the first time:
$ ./inter.pl
perl> sub foo($){$a=shift;foo($a+1);}
perl> foo 1
Out of memory during request for 4040 bytes, total sbrk() is 402624512
bytes!
Segmentation fault (core dumped)
Gerrit
--
=^..^=
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |