From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#49496: 28.0.50; process-tests/fd-setsize-no-crash/make-network-process hangs on Cygwin Date: Fri, 9 Jul 2021 14:01:33 -0400 Message-ID: <8dec2b34-f041-35e8-1971-da2596a8b760@cornell.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33847"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: 49496@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 09 20:08:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1uv4-0008bX-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jul 2021 20:08:10 +0200 Original-Received: from localhost ([::1]:52410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1uv3-0002kt-8m for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jul 2021 14:08:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1uux-0002kl-3C for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 14:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1uuw-0006dZ-S7 for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 14:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1uuw-0007GZ-Dw for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 14:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jul 2021 18:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49496 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162585404527880 (code B ref -1); Fri, 09 Jul 2021 18:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jul 2021 18:07:25 +0000 Original-Received: from localhost ([127.0.0.1]:59657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1uuL-0007Fa-E2 for submit@debbugs.gnu.org; Fri, 09 Jul 2021 14:07:25 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1uuK-0007FT-2W for submit@debbugs.gnu.org; Fri, 09 Jul 2021 14:07:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1uuJ-0002is-Oq for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 14:07:23 -0400 Original-Received: from mail-bn7nam10on2070a.outbound.protection.outlook.com ([2a01:111:f400:7e8a::70a]:13664 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1uuH-0006KZ-QI for bug-gnu-emacs@gnu.org; Fri, 09 Jul 2021 14:07:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWEdOsmgGSWfyMtVadUvumQM02Q+kJU/eflAhK3V9dmJcA1StZMjid2I33l0eoREUOwIQd9fsHMi+T8B/XMyPAubn9lZ3fPBQc4mhCzPXmb8J3LRl+vZ71Bbw0/wqywtN3gXRMDNQ9Zv1pOUbUci271FH0v9sMYFNNgcYfE2rCEYGrfYx9Amk091KYtl7ZfeurEmkGYuCYFR+z1Hifu1BoOtt8EMavrTVQKbaIEUpb3+h7b05fGN39kP29BnzKwUK8U6Fc8U6aHz1SM4AiogFjyU0WiGiT4xBreQ83R+2XiVpSGa7rZ0bGHFmSvmmh0Y4PawfxyoL8kjXKsf8MSjcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gzsGUljH0HOufoG8ohuONAMUGx/u4meQk26Q43UDwbc=; b=m5S71jr5NiHmx0NulBUayS1px+8+9kR2sHC0Ugn2GgqpQ73iYAByZbk7TM4juKwmI/VXnPniVZ7eWr2LFhWw1CvjMz0B5sIVEHTnE7seQN1D01lgsw7NFx81rukwagh7CpkOApdrtIkUPWsIuE99JrkCMCi+bQJfUO19KohZGgtshxpkYtkbvRq/cmwEs4h87S59jm2qyAw4K9uqEQEQPC56nPHEOk5fbIOSB/q/wFWV+wzeQweXCVK8vktONGOlDIQ+b0OhmEjXNrxq90GWek1DuLD6bYiqIJ6KG+7v905XV5NEUqmJDppPuFJNGFugfRyqgmwr/mKzrLp96xGNhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gzsGUljH0HOufoG8ohuONAMUGx/u4meQk26Q43UDwbc=; b=BtHe6/fIlEZoStevry3OPl72+ztPefCziVc0qqHYMzlcUIllQSCFR+ZUOxII2Xx7wMaRuGDaGlJaHCS6naiGfbG+gYVF7ctQzqgGdn9Ih1Yh35yZD0dk8w7as37Wj1Xyq5+IehhyWYVLTeNTcPsGLqZN2JIvD3tyN4ezrm+JM08= Authentication-Results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=cornell.edu; Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) by BN8PR04MB6372.namprd04.prod.outlook.com (2603:10b6:408:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Fri, 9 Jul 2021 18:02:18 +0000 Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::cda2:359c:cb66:5c42]) by BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::cda2:359c:cb66:5c42%7]) with mapi id 15.20.4308.021; Fri, 9 Jul 2021 18:02:18 +0000 Content-Language: en-US X-ClientProxiedBy: BL1PR13CA0217.namprd13.prod.outlook.com (2603:10b6:208:2bf::12) To BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from [192.168.0.18] (24.194.34.31) by BL1PR13CA0217.namprd13.prod.outlook.com (2603:10b6:208:2bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.12 via Frontend Transport; Fri, 9 Jul 2021 18:02:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a12d1e8-6321-44d8-8848-08d94303b0cf X-MS-TrafficTypeDiagnostic: BN8PR04MB6372: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VnvveOATkGkVC/WyTtVVPNQfA1DKji7hzxpIepgpAwYBlDxEp8XXKuiJnDo7dwi3mMolSFxOrrnpKFIOSax3wHqWUrQPrDvkv3zfw+wUhn8V0CAr2nFL83fE0zA2R5dKzyACifipb1+gU/ILlpLyZx97nzw7bqHYcFcwVUAQGAaYiYnoZC46h/iof7i7LocJXMKy+Bw+/Umk+eS4nfYYPz8dUuI7BMjp1S1QHhvT4VDYaX1yZTjYyHltWUuZUV6xKvJBOhcB1qE+hUKtiMfrOlS0P/THKkh7HGpwvEl7TWBzJODPWkGGcFqPhPL/a5LqsoP+/8WLeaRQ5OP3KqxSk3wUY1K2Kbx5L31yVSQLgLSr1EMIXIbMEbg/yw/JKE/SrG08GSDAisZSwe/vA7ZOX6v1nY+z34tpCTbjpqNb0NzkXH17oeKAlBikGDgo2uV9hqHTxqk8Jmr6cLwy6s0etJI2tCIQbhH2oOwyQOA4/aAIG0bhaD6wa1eXaXQwgsNI5KWSB21yQnv75grtsgbHkXveRqiH47Vb0KS1jHteRFbvrXKjLllP1ao43ek/UvAI97rjpJTK/FoQ6pF4s/owyT/y7eznalsjuM1mXouOEFCA02wPBlDBd7j3bMX7w1M2kKXhmTbY0bHfdppbaRgyPgSx/4n0u1oDGEA1b7c3z9uvIuZTbxzEwmKTi7x7X/WpBS73larkPP/mJpFXW+sT3lMlY4ci+J3pDmGL03wNPqw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(346002)(396003)(136003)(376002)(186003)(2616005)(66476007)(478600001)(83380400001)(8676002)(956004)(75432002)(66946007)(86362001)(5660300002)(2906002)(6666004)(6916009)(66556008)(31696002)(8936002)(36756003)(31686004)(16576012)(786003)(6486002)(26005)(38100700002)(316002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wyOwY/lpnA4QDJXLCxcdOmEEhTj66K2oRKzy9hnmogCePRZPLLxquaHejnG33qSHbSjb1uwd7xAWfD2eQ9Fh744U4uEQaG4LPcmgxAZZ1KvZf3NhJwKRsfkN/TdH4gB1GhWmBRF9M3ATPrAOczCFMzamq2pjv7fnR0k+HVcPI+l/nNiG0mPTKwrFgdiWHuizfiFRyCfjrala0Diun8/Lb5yZrxD9I/iY4qpiiECK84bebciiEfvXdpJcqpd3kPV4aZ5zdElsAtkEn+geuC1rIni6r85AsS1jLpByi1HkvZuUxfy6kpAupN1f/C95wKUuAam8WUPrCLXbUfD+0f5j3i8PzrCfcv44vOx2ExMfrcLY/Dss48KMT9gdLAc7+jh9MAw3CCIsskmcoD6C4XETmFqr2rfZUldtw1J51x4WKC9sPYW526R5g+gfv9+G6GKuFUuMrSO+7VWSxTBvCX1oCKAxPUqIZX3H24hCve1JNF3hNVBCp0+Y63wL3MDu01M5NeuxtVrErRBCVP4FII6Fc7qfiIcxLiItvd3mfikqUU/l7EJzM3iOZPmjwdJtRPWkvMap0llTZRUyuuI45nQ7iH3o7G2cPAFoxoAswyvZRMJh8B3vSqYp5v0C6r6zSjH7+sY56tpVeKWW8CNd1n2zv4WB7UegRM7HyTILwq+w8Lx87T9tZf5jyuDBxo2maY40nbtPUrMiEADKeIRaM6SLuYGOZDskYFx6B13Ty5mItPOIGrMgkUeBzIqJEa idI3i6F7z5qFjrBUtShGbSpP1Kx6KRXcAAifWvipYtrR+86b4/Hl9/w7UNXDGSYOJGXY9y8vDVxEnabuETZTopB4gliWp1XHMT X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 7a12d1e8-6321-44d8-8848-08d94303b0cf X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 18:02:18.2028 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IT8aK4tcM+Gr7FH6Mns51uDf1lTqewVoexQxATb4Eq+uCWNXMGQ6UPCsJMlyamNO8ZwmEcy2kIpL8cdpraTm3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR04MB6372 Received-SPF: pass client-ip=2a01:111:f400:7e8a::70a; envelope-from=kbrown@cornell.edu; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209730 Archived-At: The hang can actually be triggered by evaluating the following, extracted from the test in the subject: (setq socket-name "/tmp/socktest/socket") (delete-file socket-name) (make-network-process :name "server" :server 10 :buffer nil :service socket-name :family 'local :coding 'no-conversion :noquery t) (make-network-process :name "client" :service socket-name :family 'local :coding 'no-conversion :noquery t) The reason for the hang is that Cygwin does a blocking handshake in accept/connect to exchange credentials. This can hang in certain situations in which connect is called before a listening socket is ready to accept connections. It is possible to work around this problem by disabling the credential exchange as in the following patch: diff --git a/src/process.c b/src/process.c index b8c3e4ecfb..01548c8ab5 100644 --- a/src/process.c +++ b/src/process.c @@ -3355,6 +3355,12 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, xerrno = EMFILE; continue; } +#ifdef CYGWIN + /* Avoid possible hang in connect/accept. */ + if (family == AF_LOCAL && p->socktype == SOCK_STREAM + && setsockopt (s, SOL_SOCKET, SO_PEERCRED, 0, 0) < 0) + report_file_error ("Cannot disable credential exchange", Qnil); +#endif } if (p->is_non_blocking_client && ! (SOCK_NONBLOCK && socket_to_use < 0)) But this seems too drastic just to fix a potential problem that doesn't seem to occur in practice, but only in the contrived situation of process-tests/fd-setsize-no-crash/make-network-process. So my preference is to simply skip that test on Cygwin. OK? In GNU Emacs 28.0.50 (build 9, x86_64-pc-cygwin, GTK+ Version 3.22.28, cairo version 1.17.4) of 2021-07-09 built on moufang2 Repository revision: 68276f6d30bbdc09cc26fb49d7f0c3aa4bce35f2 Repository branch: master Windowing system distributor 'The Cygwin/X Project', version 11.0.12011000 Configured using: 'configure 'CFLAGS=-g -O0'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY GFILENOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB