delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/05/27/21:58:30

DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 44S1wTu11008101
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=ErGcwKbJ
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 810C13884502
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1716861508;
bh=7ZS8eZA04e5rqkhdRjrFaTfRubUtX3ohy1ZHm9DM+l4=;
h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=ErGcwKbJlpXC5k3kIcBkfb4cXJNhLMWFzWglneYgdRXOCK+fQWxGYeQHARRQk22TQ
hvoNiSPNrw6QhBOMUgI5VotMSVpItU/1bo06mLAIRZx989e4m9gRgxoix/awT/q+yc
Sa8wqJ0S5PJcigUA1nz4MqZcLEAgxfTS7IyWDRag=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECF833846096
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECF833846096
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716861486; cv=none;
b=IDy1HDTpXZKZ29RfIB7D3Is4urttkwzCppDY6SoHroePalS1IjGW4ljwRF11JgzWXpdMkq8DIHK0zK6lDBbHrTsnduCPMsUn7fNweErw98GtfTB693zWKyR1bQjUymyCiw1waY/f/JN5c+iBv6qgZfpsrwb2X1T2n4uUAA5ckUc=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1716861486; c=relaxed/simple;
bh=OGSlQdZYxCbVZPh+zzAwOw3ZcBXK8eE/EQa2KBkrx4o=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=aqZ+fw0KyCFQt/z9b5pCdo+GlFZIOv047zSKgmZ0edT09EUYtkLe2kh4WcZXzGGBWlmk1HowRid+O1CoWPREY0zmAFwyn0uYUrdDUsdjZME01hzgkCDAdK7itGDpUi63j8K1DftG+XGyZA068CFGmZLf5HYwDrg4fj2gOc4sWz4=
ARC-Authentication-Results: i=1; server2.sourceware.org
Date: Tue, 28 May 2024 10:58:00 +0900
To: cygwin AT cygwin DOT com
Cc: Jeremy Drake <cygwin AT jdrake DOT com>
Subject: Re: frequent hangs running ldd
Message-Id: <20240528105800.52e5e55e3d7576640d9150ef@nifty.ne.jp>
In-Reply-To: <cebac6b9-51e9-63fa-9d67-ef4f913160ca@jdrake.com>
References: <fd3b2d14-0d16-9e66-f7ea-daadc0c5bfcc AT jdrake DOT com>
<20240525045424 DOT ac58c0ff5e325706b2a5f014 AT nifty DOT ne DOT jp>
<0bd2f49b-93f6-7db4-32b6-7f3021db211e AT jdrake DOT com>
<20240525071739 DOT 167d0f2b66b3dd8d2313be19 AT nifty DOT ne DOT jp>
<199f58b5-be55-a490-b94c-8b1ec7ff10fe AT jdrake DOT com>
<74e13efb-885a-3a90-f530-a6aa14bc5953 AT jdrake DOT com>
<1048b7a2-34fc-616e-1f9e-ce46dbc6d704 AT jdrake DOT com>
<8292a53a-15f6-da7c-c1d8-201418d1c589 AT jdrake DOT com>
<cebac6b9-51e9-63fa-9d67-ef4f913160ca AT jdrake DOT com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS,
SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Fri, 24 May 2024 19:29:43 -0700 (PDT)
Jeremy Drake wrote:
> On Fri, 24 May 2024, Jeremy Drake wrote:
> 
> > On Fri, 24 May 2024, Jeremy Drake wrote:
> >
> > > Looking at !address, it seems Windows put the PEB, TEBs, and stacks in the
> > > area where the cygheap should be.  Way to go, ASLR :P
> >
> > I think the fix for this would be to add -Wl,--disable-high-entropy-va to
> > ldh_LDFLAGS, as was done for strace and cygcheck at least.  I used peflags
> > -d0 /usr/bin/ldh.exe and I'm not seeing a hang after that.
> 
> Sorry, that was peflags -e0 not -d0 (dynamicbase is still on):
> $ peflags -v /usr/bin/ldh.exe
> /usr/bin/ldh.exe:
> coff(0x0226[+executable_image,+line_nums_stripped,+bigaddr,+sepdbg])
> pe(0x0140[+dynamicbase,+nxcompat])

You are right!

It seems that VirtualAlloc() in cygheap_init() in mm/cygheap.cc
fails when the address range which cygwin uses is occupied due to
high-entropy-va in ldh.exe.

Thanks for the analysis.

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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