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#50043: 28.0.50; USABLE_SIGOI undef code paths do not work correctly Date: Wed, 17 Nov 2021 12:25:38 -0500 Message-ID: References: <874kbtfthj.fsf@gnus.org> <835yw9cwoa.fsf@gnu.org> <87mtpla013.fsf@gnus.org> <83zgtlbaw6.fsf@gnu.org> <87fsvcuttw.fsf@gnus.org> <83czn12uz1.fsf@gnu.org> <837dd80zc7.fsf@gnu.org> <92d3e509-be73-88c8-0085-f13c3716dd1b@cornell.edu> <83sfvuzzy5.fsf@gnu.org> <83ee7ezw8l.fsf@gnu.org> <4a256b21-ec50-90f8-b472-079fa98969b2@cornell.edu> <83czmyzpno.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------X8eVTQFStDiqJiV710PtaxS4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10438"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cc: larsi@gnus.org, 50043@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 17 18:28:57 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 1mnOjw-0002T8-RW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Nov 2021 18:28:57 +0100 Original-Received: from localhost ([::1]:53734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnOjv-0005wS-Pu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Nov 2021 12:28:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOh8-0001ei-93 for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 12:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnOh8-0007oC-02 for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 12:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnOh7-0007en-Sb for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 12:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Nov 2021 17:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50043 X-GNU-PR-Package: emacs Original-Received: via spool by 50043-submit@debbugs.gnu.org id=B50043.163716994929404 (code B ref 50043); Wed, 17 Nov 2021 17:26:01 +0000 Original-Received: (at 50043) by debbugs.gnu.org; 17 Nov 2021 17:25:49 +0000 Original-Received: from localhost ([127.0.0.1]:33793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOgu-0007eC-Ue for submit@debbugs.gnu.org; Wed, 17 Nov 2021 12:25:49 -0500 Original-Received: from mail-bn1nam07on2110.outbound.protection.outlook.com ([40.107.212.110]:19840 helo=NAM02-BN1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOgt-0007dy-H8 for 50043@debbugs.gnu.org; Wed, 17 Nov 2021 12:25:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NzD3B1gj0KL8BohyCNfLgei/JQ4UwgfszV/Q0NCHZl48tC6+kTLbnthSCt6C4ftVG3UnCjEFySDUF3TRIobOj7BmD3LpTuBFMQBKiSmcnamHC6dmGTOMwMqoEG64QSAF2TKzorXfFkf5J/2wenicQFjOKC3HsJ1xxjubagNZYbhRtTNQD6wPAQUPRWmJ7vjCQxr6g/PJITacmyjiszIEq8NIhSklemWxaJBfdSyjUeiw/ZO6m4re9pt5sxa+pTZb5CFNHWyd+SR688xvLChBk+/1sCUqv9ovaJKj0aq/zZiHz6ZP2J4stLQ0f5A2S2vV9T49v+VGKaVp5+rsqiKehg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jDujFu4P+++JH7LEQntHkboeXGdSZhYtnpY2PnZpNbQ=; b=dk1JYCG2rfAB1Ca5OnjkSuhNwleXRpQKkMgGCMg2zKfIMDd4x3eU1reMjvAwjnTUdZiGYZU2Kb31XpoYeUOoYZuY1aWehOBblK/WUu53aIvKccT6Y5NdMLRPkRIYvF2KWAEm/RREwpsf61EMkqqNbam7PvypgjAofbYf8WyLkEL7cSk6s1WoGpXStxdO29YfZHGKUrycFpkw87V6g4vF/YVkdC5/4HlZyuSKwbQXvZsjI9TilRXbVD204v/GuF+fAG+wrCcL3hw670/Anl+d/b2MH2Ds317AEcewsy6q6OMYDinMAEnWJmTITCwWOrjjtgPNl0H5ndCD1mRxJssdHg== 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=jDujFu4P+++JH7LEQntHkboeXGdSZhYtnpY2PnZpNbQ=; b=QI5vm3P+z1EbkmQfmXCYEuQo4f3frOhqPUn1QmkQjM7YoTAFvyfCVEVVNrTGdUW+El6AHbI6eRpTYf0ewrkB9gkPuTO/50zE1v4+TLCGGdITsN6jXWVsa/tV52iVCC4stNT5jeDlXpM0BH0QggPRZPipQ+ju1E4tx2/WzczyQVk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cornell.edu; Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) by BN7PR04MB5170.namprd04.prod.outlook.com (2603:10b6:408:8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.20; Wed, 17 Nov 2021 17:25:40 +0000 Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::88c4:79c5:1eb1:b969]) by BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::88c4:79c5:1eb1:b969%7]) with mapi id 15.20.4690.027; Wed, 17 Nov 2021 17:25:40 +0000 Content-Language: en-US In-Reply-To: <83czmyzpno.fsf@gnu.org> X-ClientProxiedBy: BL1P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::11) To BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) Original-Received: from [IPV6:2603:7081:7e3f:3419:1c5d:e1a9:7b:59ab] (2603:7081:7e3f:3419:1c5d:e1a9:7b:59ab) by BL1P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Wed, 17 Nov 2021 17:25:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e32aa6e0-41e7-4513-9ba6-08d9a9ef46c2 X-MS-TrafficTypeDiagnostic: BN7PR04MB5170: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cilu9MzV2UpKrQKRuheub6qXeMVFGNp1dOnqDBKJrONkunuYshgJdP1mS6VGVUJQjhPKsJgRLqnHTtJN2jWDpp4XKBkCYLZkidSSHj0RR8hU0Bj9Zs1U+Is/YLyRZquJ8YUdWWJ1uiImnMMyIwtA1TC16/xHnKPoJ5YEPeyPl44RqUjxnOeUol91MJyS/csm11tm2IEjhB1w66zdARdMjO0hW5zx3oqgQdEIQ+A0ohc5SKk+o5Mih2WG1XjwFUHhQFD87+/JniMDfxVrv+qK3BN4fEa1qBk5INKbd9wpmvH7E1KsgcWgMQln0ny0Q65eVRJubwsdo+wMpAT2d/7ncLFQX+yBjB1JzJwbmJKe8Ehp/8qLHl8LQX+EutNi/Ro2r0DgXHfyYmmUFXoKOh7zM1ESYPM4H+GMvJnb6o/iod4BdsYhePh1mgHGiw3oeJtRucSAXAcRtywFilBHXKhcfI5CSTnIQ2vMQQLtvM1UfL9d/8O89tWCxEUFXTZPtDBzu5QnDmhwPK9qGi8wkAbvpbq+1aOnhyOD//j46pUeA48MYcmJBlVmhvsjm2YM8QID+hYKKiWJOcFkgSWW5L/YRo8GGAFD+4JNilVwBCgjTHEaMB1P6B4KcCMeA3FQoiiSyMr6lsHnnJNqUdsWGYeBBxLcAgM0L2hLUvY9CB62tt/WWaNqcdJYjgEvw0Ps5RdUfSjo0LXsTqZwCmvujXarT0cmcnFf/NpL8A8Z7nVw6WE= 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)(75432002)(786003)(2616005)(38100700002)(6486002)(316002)(31696002)(5660300002)(66476007)(66946007)(53546011)(508600001)(33964004)(8936002)(36756003)(186003)(2906002)(83380400001)(8676002)(31686004)(235185007)(86362001)(4326008)(6916009)(66556008)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MPlOTlOyIB261S5v+4PShjW+aAkQk+V4Zy/n04P8ihmuGK+HNYJGKJS+Ti9G1EvsUkp69AyPtpB/z+XGtkrlb0SJjdob+JN0aIsBp/ThCQxqTSBzpq2XWJGMmm5gz9mmp9Z4J+M2wDAkyAadHoWi9Hmeyp6ihuRyQsIeJbwYmkBHh2BdVSNNhyhp4irkZwDbvo6TNDr4/oJpqZOlPEh7xfIubhyXD25X7QoqFmaBV5JAff3FzXdLBbHFnzzV5ioAIcnfmgUsplr51Z7Pz9NFFQwCq7nsvt/+10srDhfir2LLjD3QZYXYts2SAhqdGLAIVRDKhCU00f2lH6C9Ey+uT+mkEV7FdKvyisRmDutpuMJd4Y/yxea66Z/vJW3+nxz3fJ47ChWMjbjV/8//3J8Rjoj85XMbc05o/oz1VoPXOy4vyXG+zKI/FPpiFHVMlrUo4WGyXsELKMd792RUbZlNCCZZG4F5yxfHtYLa/vgcyl7nI7lpuVVfCz+HEs2HOdgSnI+ZyJqZhqVLYqNsVO1uXd1Os7ll4Ci38N/BCcfSTAfJKCm1vnPqMQzy51QJ54Ow3ZxQJeCZhD5M5u6kCMGD/Ft7QDtTW7rrr/kWo99oZGKBZGxa4phcee5XXkF/emJwbhvg4noWbw6BfxVmduqanuXwxwhFoMhn772FjdI8/Q/d0nyGttk2EGsYk7x7X2A0bFXMeIvv6zMGNtoPGtCQlfd7UD9JO640rBlL9ytaUJm/JuXVJIxEfxJhk/ jCut6r8XlQiCvKxXpv5pPv+/qy+B6XcUkg7MAVDLvWsBcAC3rOfbZA6kXoj1GfGnf8lte/LuI20U3vvY9yog7zc8rM78Da9rFB X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: e32aa6e0-41e7-4513-9ba6-08d9a9ef46c2 X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2021 17:25:40.1031 (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: 3ngjiQts67IeVGQLn7dDjFK/KSBoiZMp6am8O4SlA7unBD3FzKwQ9AOp1U5rJBFJkm4k9fBA/wTrlENgAdfPTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR04MB5170 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:220236 Archived-At: --------------X8eVTQFStDiqJiV710PtaxS4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/17/2021 11:57 AM, Eli Zaretskii wrote: >> Date: Wed, 17 Nov 2021 09:59:35 -0500 >> Cc: larsi@gnus.org, 50043@debbugs.gnu.org >> From: Ken Brown >> >>> But maybe it will be better to do it the same way we >>> decrease the timeout when a timer is expected to expire before the >>> timeout: we decrease the timeout, but still remember its value, and >>> don't return from waiting before the timeout unless there really was >>> some input. This would avoid affecting unrelated features such as >>> accept-process-output. >> >> I think that's already taken care of. The timeout is recalculated on each >> iteration of the main while loop: >> >> /* Compute time from now till when time limit is up. */ >> /* Exit if already run out. */ >> if (wait == TIMEOUT) >> { >> if (!timespec_valid_p (now)) >> now = current_timespec (); >> if (timespec_cmp (end_time, now) <= 0) >> break; >> timeout = timespec_sub (end_time, now); >> } >> else >> timeout = make_timespec (wait < TIMEOUT ? 0 : 100000, 0); >> >> My reduction of timeout to 25 msec occurs after this. > > So the result will be that on systems without USABLE_SIGIO we loop > more times with shorter timeouts for select? Yes. > If so, it SGTM. Thanks, I've pushed that change. There's still one more issue related to this bug, which I mentioned earlier: If x_selection_timeout is zero, x_get_foreign_selection will call wait_reading_process output with an infinite timeout rather than a zero timeout, which I'm sure is not what was intended. The attached patch fixes that. Ken --------------X8eVTQFStDiqJiV710PtaxS4 Content-Type: text/plain; charset=UTF-8; name="0001-Avoid-an-accidental-use-of-an-infinite-timeout.patch" Content-Disposition: attachment; filename*0="0001-Avoid-an-accidental-use-of-an-infinite-timeout.patch" Content-Transfer-Encoding: base64 RnJvbSA1YTBhZmRmMWNiMmVmMjc2YTJiNmU0Y2YyNmFiZjE4NDA1MTI3ZGIyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLZW4gQnJvd24gPGticm93bkBjb3JuZWxsLmVkdT4KRGF0ZTog V2VkLCAxNyBOb3YgMjAyMSAxMjoyMDoyNCAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIEF2b2lkIGFu IGFjY2lkZW50YWwgdXNlIG9mIGFuIGluZmluaXRlIHRpbWVvdXQKCiogc3JjL3hzZWxlY3QuYyAo eF9nZXRfZm9yZWlnbl9zZWxlY3Rpb24pOiBJZiB4LXNlbGVjdGlvbi10aW1lb3V0CmlzIHplcm8s IGNhbGwgd2FpdF9yZWFkaW5nX3Byb2Nlc3Nfb3V0cHV0IHdpdGggYSB6ZXJvIHRpbWVvdXQKcmF0 aGVyIHRoYW4gYW4gaW5maW5pdGUgdGltZW91dC4gIChCdWcjNT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