Subject: bug#74805: 30.0.92; Trying to build scratch/igc on Cygwin

From: Eli Zaretskii <[email-masked]>
Date: Mon, 27 Jan 2025 18:43:43 +0200

> Date: Mon, 27 Jan 2025 11:20:24 -0500
> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> From: Ken Brown <[email-masked]>
> 
> >> 3. After I apply the patch, there are no calls to mmap or munmap
> >> (according to strace) except an initial call to mmap when the code calls
> >> malloc.  [This is an internal implementation detail, that Cygwin uses
> >> mmap in malloc.]  If I don't apply that patch, there are lots of calls
> >> to both, all of which succeed.  I don't understand why the code is not
> >> calling mmap/munmap when the patch is applied.  How else could it be
> >> trying to acquire address space?
> > 
> > A stab in the dark: could it be that the call to fprintf you added in
> > the patch causes malloc to be called from fprintf, and thus changes
> > the state of malloc and/or the arena in a way that causes the above
> > unexpected effects?  Can you try using a different print-out function
> > instead that is guaranteed not to allocate any memory?
> 
> Thanks, but that doesn't explain it.  I tried simply removing the call 
> to fprintf, but the strace output still shows no calls to mmap or 
> munmap.  Very strange.

Hmm... I guess this is where you give up and ask the MPS developers to
help (if you haven't already)?

My gut feeling is that this is somehow related to the way Cygwin
implements mmap/munmap, but I have no evidence to support that, and
definitely cannot tell what is it in the Cygwin implementation that
violates the assumptions of this test.

Thanks for working on this.