delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/07/18/04:47:30

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 18 Jul 2011 10:45:52 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: please fix heap_init
Message-ID: <20110718084552.GA4735@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <ivvg3l$ios$1 AT dough DOT gmane DOT org> <20110718071159 DOT GA31364 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20110718071159.GA31364@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
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

On Jul 18 09:11, Corinna Vinschen wrote:
> On Jul 18 05:20, jojelino wrote:
> > this is following of 'infinite recursion in git-svn'
> > #to reproduce this problem,
> > #1. please use latest cvs trunk
> > #2. set HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\heap_chunk_in_mb=0x400
> > Starting program: /usr/bin/perl.exe /usr/lib/git-core/git-svn clone
> > -rHEAD http://google-perftools.googlecode.com/svn/trunk/
> > [New Thread 5352.0x9c4]
> > warning: section .gnu_debuglink not found in
> > /cygdrive/d/cygwin/bin/cygwin1.dbg
> > 
> > Breakpoint 1, heap_init () at /tmp/winsup/winsup/cygwin/heap.cc:81
> > 81                    start_address = roundup2 (start_address +
> > mbi.RegionSize,
> > 2: largest_found_size = 0x35680000
> > 1: start_address = 0x55690000
> > (gdb) i b
> > Num     Type           Disp Enb Address    What
> > 1       breakpoint     keep y   0x61078875 in heap_init()
> >                                            at
> > /tmp/winsup/winsup/cygwin/heap.cc:81
> >         breakpoint already hit 1 time
> > (gdb)
> > 
> > start_address continues to grow, and in heap.cc:94 it is used as
> > base address.
> > which is not we wanted. and sbrk could fail if it used up MINHEAP_SIZE.
> 
> This is what we want.  Did you compare the behaviour of the code with
> the comments in the code?  Can you please *explain* what is wrong with
> the code?

I had a closer look and I found a bug in the code.  When no memory area
has been found which is bigger than the requested memory area, the code
was supposed to allocate the largest memory area found.  At this point
the code used start_address accidentally, rather than largest_found.
Is that what you were refering to?  If so, that should be fixed now in
CVS.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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