delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/29/10:48:33

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
Date: Fri, 29 Jul 2005 10:48:24 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bug identified [was RE: perl - segfault on "free unused scalar"]
Message-ID: <20050729144824.GK9031@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <SERRANOjrHVuIMrNfDb00000032 AT SERRANO DOT CAM DOT ARTIMI DOT COM> <42E9594A DOT 8020703 AT familiehaase DOT de> <20050729004546 DOT GC1210 AT trixie DOT casa DOT cgf DOT cx> <42E9FAA1 DOT 3080207 AT familiehaase DOT de>
Mime-Version: 1.0
In-Reply-To: <42E9FAA1.3080207@familiehaase.de>
User-Agent: Mutt/1.5.8i

On Fri, Jul 29, 2005 at 11:45:05AM +0200, Gerrit P. Haase wrote:
>Christopher Faylor wrote:
>
>>On Fri, Jul 29, 2005 at 12:16:42AM +0200, Gerrit P. Haase wrote:
>>
>>>Dave,
>>>
>>>Some comments on your analysis.
>>>
>>>The latest perl uses auto-image-base and the base address should be 
>>>different than default.  It fails anyway.
>>>
>>>Perl uses its own malloc, rebuilding with the system malloc shows
>>>that it behaves similar than the C examples, I think the recent
>>>changes in Cygwin do what they should do: make setting the heap
>>>size superflous.
>>
>>
>>Could someone point to what these changes are that are supposed to
>>make setting the heap size irrelevant?  Dave mentioned "cygload".  I
>>don't really know what that is, unless it has something to do with
>>the minor changes made to get cygwin somewhat working when loaded
>>dynamically.
>>
>>I'm not really aware of any changes which would make setting the heap
>>size irrelevant.
>
>I don't know ;)
>
>At least we figured that perl crashes when it uses more than 384 MB RAM,
>similar C programs don't crash.

I don't think the C program was similar since it was allocating in
chunks rather than extending the size of a single allocated region.
perl, presumably, just tries to call sbrk repeatedly until it fails.  If
there's something in the way of the heap at that point, it will limit
the amount of allocated space available.

>This could be fixed with setting the heap size in te registry to a
>suitable maximum.  Perl used its own malloc, now with the latest
>release of Cygwin Perl it uses cygwin malloc and it works better
>(setting the heap size is no longer neccessary, it works without
>patching the registry now in this special case, may well be that it
>still breaks in other scripts).

That's great.

>IIRC it was you who said that there were some changes to malloc (in Feb.
>2003): "Maybe the overflow code in the new malloc is actually working."
>
> -> http://www.cygwin.com/ml/cygwin/2003-02/msg00166.html
>
>This is quite old news, however it seems that it really helps.  At least
>since I build perl it used the included malloc instead of cygwin malloc.

Yes, that's been in there for some time.  malloc should fall back to using
mmap for a long time now.  I forgot to turn it on in CVS after the latest
malloc refresh from Doug Lea, but it should be on now.

That doesn't solve the problem of roll-your-own malloc implementations,
of course.

cgf

--
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/

- Raw text -


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