This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug identified [was RE: perl - segfault on "free unused scalar"]


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]