public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Cc: Jeremy Drake <cygwin@jdrake.com>
Subject: Re: frequent hangs running ldd
Date: Tue, 28 May 2024 11:16:08 +0900	[thread overview]
Message-ID: <20240528111608.7b44c054f4c71171db49d6cc@nifty.ne.jp> (raw)
In-Reply-To: <20240528105800.52e5e55e3d7576640d9150ef@nifty.ne.jp>

Hi Jeremy,

On Tue, 28 May 2024 10:58:00 +0900
Takashi Yano wrote:
> 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.

Would you make a patch for that?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  reply	other threads:[~2024-05-28  2:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 18:50 Jeremy Drake
2024-05-24 19:54 ` Takashi Yano
2024-05-24 20:09   ` Takashi Yano
2024-05-24 21:46   ` Jeremy Drake
2024-05-24 22:17     ` Takashi Yano
2024-05-24 22:24       ` Mark Geisert
2024-05-24 22:26       ` Jeremy Drake
2024-05-24 22:38         ` Jeremy Drake
2024-05-24 23:29           ` Jeremy Drake
2024-05-25  2:28             ` Jeremy Drake
2024-05-25  2:29               ` Jeremy Drake
2024-05-28  1:58                 ` Takashi Yano
2024-05-28  2:16                   ` Takashi Yano [this message]
2024-05-24 22:43         ` Mark Geisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240528111608.7b44c054f4c71171db49d6cc@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    --cc=cygwin@jdrake.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).