X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=Rt958v0pUX/wj08dQiBLiP2/ZayZ3l7oPnSe8++2q1GEiC3n2gmeh 1esy4mkWqPOb1GYwbO6PAjeAsVJtjD+JcnKir49QCK25jPpz/bTg2e21ozovRqMz pw6coiwNYhRjPwds3rwhxg60s5rsR091jY04tE6djYP/108/vXhO6I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=TIgv5lGlAsux7bNVr8Unp+TbSFg=; b=Jb9Ze+wfnOQTxjNpDNcZcWBKE2k4 D+CtAJazl/vFS/z2ecrspTsmgCXnYpK0QD8/jZjdjBUU8vcdLu12jucZJTlOLzNO bJZ5uYwRlcBLLHyBn9D4rGg5p+mt1h8zf2fs6a0Yvvof+U4K40N1zAVQg7c2qVoE nrdA/9FbJA+ihI8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-103.2 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mout.kundenserver.de Date: Thu, 8 Aug 2019 10:57:34 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Cc: Ken Brown , Michael Haubenwallner Subject: Re: Fork problem with hexchat if cygserver is running Message-ID: <20190808085734.GH11632@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, Ken Brown , Michael Haubenwallner References: <64c75d09-0771-901d-21bf-3ce10beecb38 AT ssi-schaefer DOT com> <20190808082440 DOT GF11632 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jyWdsH1tvGESd50Z" Content-Disposition: inline In-Reply-To: <20190808082440.GF11632@calimero.vinschen.de> User-Agent: Mutt/1.11.3 (2019-02-01) --jyWdsH1tvGESd50Z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Aug 8 10:24, Corinna Vinschen wrote: > On Aug 8 09:27, Michael Haubenwallner wrote: > > On 8/7/19 7:41 PM, Ken Brown wrote: > > > Roughly 1 out of 3 times that I try to use hexchat, I get a fork fail= ure: > > > [...] > > > 363 26064 [main] hexchat 12399 C:\cygwin64\bin\hexchat.exe: *** = fatal error=20 > > > in forked process - fixup_shms_after_fork: NtMapViewOfSection (0x7FF4= EE130000),=20 > > > status 0xC0000018. Terminating. > > >=20 > > > [status 0xC0000018 is STATUS_CONFLICTING_ADDRESSES.] > > >=20 > > > This was under cygwin-3.0.7-1. It also happens with cygwin1.dll > > > built from the current master branch, and it also happens with > > > cygwin-3.0.6-1. Not being familiar with this part of the Cygwin > > > code, my first thought was to do a bisection. But I haven't yet > > > found a good revision to start with. I will still try to do that, > > > but in the meantime I thought I should report it. > >=20 > > I doubt there is a commit that introduces this problem. Instead, this = feels > > like an address conflict with some (internal) memory allocated for some= Windows > > (or even Cygwin) object. > > So I'd wonder if early memory reservation like is done for dynamically = loaded > > DLLs may help for SHMs as well. >=20 > That sounds like a good idea for a start, but I don't think so. The > interesting thing here is not that it fails, but that it fails with the > above address: >=20 > NtMapViewOfSection (0x7FF4EE130000) > ^^^^^^^^^^^^^^ >=20 > Note that this address is a 48 bit address, starting with 0x7f. >=20 > Up to the current Cygwin 3.0.7, Cygwin's mmap only uses 44 bit addresses > below 0x0700:00000000, top-down. The reason is that older 64 bit > Windows versions only support a 44 bit address space. Starting with > Windows 8.1, Windows supports a 48 bit address space, and Cygwin 3.1 > will support that as well, by utilizing the address space top-down > from 0x7000:00000000. >=20 > However, the above address is beyond even that, in the middle of the > address space utilized by Windows itself. Combine that with ASLR... >=20 > Given that, my guess is that we're actually running into the > problem that the shmat() call does not utilize the mmap address > allocator, so the chosen address has a high probability to collide > with Windows' own stuff. >=20 > IMHO, the fix would be to make the mmap_alloc object global, so it > can be utilized by shmat() to create more sane addresses. >=20 > Does that make sense? I've sent a preliminary (untested) patch to the cygwin-patches ML. Can you two please review it? Ken, can you also test it in your scenario, please? Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer --jyWdsH1tvGESd50Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1L4/4ACgkQ9TYGna5E T6A+zw/9F/FNcngDgs9k+mv63y3aNYzYQm0ch4T4XTxStKrTNIXenrgf96PURSYg Gc8nHlR0dOrXCbHoBDbZzWXvwRKwxV1gW8JPW0r2jqIg7I6PIxZwMY50BGnPhn7M x26d+hS0mL7L/vQUDwNx59YowY9rnPjhljr7xP7lx80yn7siuCi+wiZz9U3hlV7Z ziTIq5H2dCmJEFzyyJ0MFdELdAY7L1RkuIffsUm4CDgdql8/DhdYNn5qY3V6zI/2 n4ghuEHJze8n2glqMgCtpQZGu7dPqrX+AFSMURJWQPg7DL5G8ET3BAv8zvqM+Fus MdQlUKEb5gsSLafYa1fWknij0HGyHJIxkVJIHE8Jlo1xhW8RAutoVCCo3AJgS/O0 vFmXVPd29G0Nr68G7P08ZOt9NB7ffRYz528AiMfRF+Np3Q0yrA+u1JjXGiDFistC 26s5huP6NB+mCNe2FAWxFzhICoP+FHyc9C/nLxRmUgocCMUF75xVFka6fBJ1lKPc Dq6QmKwgV7+Gw5xA8w5YwrJ730RvSOoDKKmGlAfE8rncxdl80wsLsvwu4O3kBWzA 5eu7jgPsnFtthvtRLpm44vpSYKWY3hTDmDgUAsOhJTPsA5uEVdcDACJDoiS+yaqu 1QBBF1Tmqb9+go2hdE6uj3KC8cYAXs2UDrta/N21uhEJ2RAdgjM= =G/sn -----END PGP SIGNATURE----- --jyWdsH1tvGESd50Z--