delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/24/13:57:11

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=UFNRfO1MjxU5hkhSiLOIoTndFP8fFtVy83GAZDZMizFusV2e7lbgz
ElNggetDaYwSwOLO/6b3+4OnoCla6fta9WOShAJlxunWXkk9AqHJDD7pvcYVCr5U
jOVVQ+aIoBkRWqJQbEwdN7INiLBb1yIJq2foUU9WXO+DwYMwzwJISU=
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=97XipdLnZjPMNbDl1sfnK2Vq97E=; b=HFHYWXrHcg6rWA4o9C49uJsSh1f/
ommBBtKC6euww7cuqHnbGxSD8bYiqCirUPhdBAmWQdKxi9nwBoUTVL3sD8Ujxdn5
vU8lekkozKWzpd7r688hKX63hq8jeujeK6iJcg/eZqKPNMuOx18lcHmmkYP12DG1
0YkJQ9Dp7YjFexo=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-125.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=emacsX11, emacsx11, emacs-x11, emacs-X11
X-HELO: mout.kundenserver.de
Date: Sun, 24 Feb 2019 19:55:24 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: Ken Brown <kbrown AT cornell DOT edu>
Cc: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Fork issue with timerfd
Message-ID: <20190224185524.GE4133@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: Ken Brown <kbrown AT cornell DOT edu>, cygwin <cygwin AT cygwin DOT com>
References: <ca9a38b7-c147-78a3-0660-70aa65b41eb3 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <ca9a38b7-c147-78a3-0660-70aa65b41eb3@cornell.edu>
User-Agent: Mutt/1.11.3 (2019-02-01)

--HnQK338I3UIa/qiP
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Feb 24 17:27, Ken Brown wrote:
> I'm seeing sporadic errors like this on 64-bit Cygwin when I first start =
emacs:
>=20
>        0 [main] emacs-X11 864 C:\cygwin64\bin\emacs-X11.exe: *** fatal er=
ror in=20
> forked process - Can't recreate shared timerfd section during fork!
>        0 [main] emacs 860 dofork: child 864 - died waiting for dll loadin=
g, errno 11
>=20
> If I exit and restart, everything will be fine almost every time.

I think I see where the thinko was here.  Can you try this?

diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc
index 7e6be72b225a..7eda71ddb235 100644
--- a/winsup/cygwin/timerfd.cc
+++ b/winsup/cygwin/timerfd.cc
@@ -408,6 +408,7 @@ void
 timerfd_tracker::fixup_after_fork_exec (bool execing)
 {
   NTSTATUS status;
+  PVOID base_address =3D NULL;
   OBJECT_ATTRIBUTES attr;
   SIZE_T vsize =3D PAGE_SIZE;
=20
@@ -416,11 +417,12 @@ timerfd_tracker::fixup_after_fork_exec (bool execing)
     return;
   /* Recreate shared section mapping */
   status =3D NtMapViewOfSection (tfd_shared_hdl, NtCurrentProcess (),
-			       (void **) &tfd_shared, 0, PAGE_SIZE, NULL,
+			       &base_address, 0, PAGE_SIZE, NULL,
 			       &vsize, ViewShare, MEM_TOP_DOWN, PAGE_READWRITE);
   if (!NT_SUCCESS (status))
-    api_fatal ("Can't recreate shared timerfd section during %s!",
-	       execing ? "execve" : "fork");
+    api_fatal ("Can't recreate shared timerfd section during %s, status %y=
!",
+	       execing ? "execve" : "fork", status);
+  tfd_shared =3D (timerfd_shared *) base_address;
   /* Increment global instance count by the number of instances in this
      process */
   InterlockedAdd (&tfd_shared->instance_count, local_instance_count);


Thanks,
Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

--HnQK338I3UIa/qiP
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxy6JwACgkQ9TYGna5E
T6DtlA/9FdHOf7RKzl1lMHvn0/cXA7wVKf9ZImYuA62b2YgkIFaJZkwr2zcUQV8o
auNZ9ycxeHatwcoDmtPDR6oZLF15khbULn90ji78Pf6q7nBdGermR+9DeIl+R8ju
sx/fBgQyXztma7C8CevdAO5IUhMq80R4H5eixh+XsIFX1WJ/ifs4jqzWBGT1ERw8
6+88tIeFX3UXpogBynecYCwlvhFrhC0A+SscsdS2zU/KBlmmZh2s6I5zHDp8oIkr
1EQk79kXnhjYDM4e6sI6nsOBsh3D4ZU3DCxnMEo1ZumEt1UToAtxaMBGWC2fPtcQ
0w4q7O9m84T1b7nmT5+1AMScMeYg/B23OfDlrK+W6kIffTl2RADUieGRv8QEHkQR
uhaGCjz8PGzsRgNZYKIiSzl7mIECRMiFLFJFhsDwZ2i3AVbuvHIBiQF1OaZGH2Xy
8sri0biPT9DFSqjmRZSTbiQWqM0CkkE8P3trIidNjFG0fsodjaFQwo4VDBwJ1v+c
OtvhkSXEjQUoosaKoek1/AX/x5TyA7AjwZYfMvSuADdqwCeQ7o1pDTRPkuom7q5G
UIN57KI0xfCLJdbpnmhbr+aR77MFofYw1OeHf2QjBrPhTiY1ityTCH7TtdGpVTfp
6s/uzFB8ZtyIJsj6YME/MgHFGXUXzMu6KsGl+7lL6Tpo7ongLYM=
=BLXd
-----END PGP SIGNATURE-----

--HnQK338I3UIa/qiP--

- Raw text -


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