delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/19/04:23:24

X-Spam-Check-By: sourceware.org
Date: Thu, 19 Jul 2007 09:50:30 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: CVS 1.7.0 heap errors
Message-ID: <20070719075030.GU20662@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT CYG DOT 4 DOT 58 DOT 0706060942220 DOT 2432 AT PC1163-8460-XP DOT flightsafety DOT com> <Pine DOT CYG DOT 4 DOT 58 DOT 0706221208270 DOT 4400 AT PC1163-8460-XP DOT flightsafety DOT com> <20070627075842 DOT GH7379 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0706270916500 DOT 3924 AT PC1163-8460-XP DOT flightsafety DOT com> <20070627170744 DOT GN7379 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0707171447420 DOT 2512 AT PC1163-8460-XP DOT flightsafety DOT com> <20070718100457 DOT GN20662 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20070718100457.GN20662@calimero.vinschen.de>
User-Agent: Mutt/1.4.2.2i
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 12:04, Corinna Vinschen wrote:
> On Jul 17 14:54, Brian Ford wrote:
> > > > On Wed, 27 Jun 2007, Corinna Vinschen wrote:
> > > You could also try to eliminate any change from
> > > http://cygwin.com/ml/cygwin-cvs/2007-q1/msg00139.html which is not
> > > related to your problem, [...]
> > 
> > You don't have any suggestions for how to best separate the patch into
> > pieces do you?
> 
> Look into the ChangeLog for the patch.  It can be divided into two
> different changes:
> 
> - Changing the cygheap->shared_prefix handling.
>   [...]
> 
> - Changing the way the user privileges are set at process startup.
> 
>   Affects dcrt0.cc, sec_helper.cc and security.h.
> 
>   Stupidly glaring at this change, I'm wondering if this is the culprit.
>   The change itself looks quite harmless.  But the non-obvious result
>   is that already very early in the process initialization functions from
>   advapi32 are called.  OTOH, Cygwin is load-time linked against advapi32.
>   So that shouldn't have any negative effect.  Hmm.

I found an actual bug in this patch.  I moved the call to
set_cygwin_privileges (hProcToken); at process initialization to a point
at which hProcToken wasn't even initialized.

  *hitting myself with a big stick*

Weird that it worked at all.

This *might* be the cause of the failing heap_init.  The problem is that
the calls to AdjustTokenPrivileges in set_privilege fail and
debug_printf is called (too?) early in process initialization, which in
turn results in dynamically loading user32.dll or some other Windows
DLL.  If this happens before the heap is initialized, there's a chance
that the Windows DLL reserves space which is needed for the heap.

What you could do to verify this:  Apply the patch from
http://cygwin.com/ml/cygwin-cvs/2007-q3/msg00039.html
to Cygwin from right after the patch from
http://cygwin.com/ml/cygwin-cvs/2007-q1/msg00139.html
and try if the heap problem still occurs.


Corinna

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

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