From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#69561: 30.0.50; Freeze from M-x gnus on macOS Date: Thu, 07 Mar 2024 17:30:28 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12974"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69561@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 07 17:33:03 2024 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 1riGg2-00032p-6j for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Mar 2024 17:33:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riGfd-0003i3-Hr; Thu, 07 Mar 2024 11:32:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riGfX-0003he-BW for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 11:32:31 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1riGfX-0003VR-1a for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 11:32:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riGg2-0000Nh-GR for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 11:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2024 16:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69561 X-GNU-PR-Package: emacs Original-Received: via spool by 69561-submit@debbugs.gnu.org id=B69561.17098291301379 (code B ref 69561); Thu, 07 Mar 2024 16:33:02 +0000 Original-Received: (at 69561) by debbugs.gnu.org; 7 Mar 2024 16:32:10 +0000 Original-Received: from localhost ([127.0.0.1]:54789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riGfB-0000MA-Iu for submit@debbugs.gnu.org; Thu, 07 Mar 2024 11:32:09 -0500 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:43162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riGf9-0000LY-6s for 69561@debbugs.gnu.org; Thu, 07 Mar 2024 11:32:08 -0500 Original-Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-56781070f38so3876696a12.0 for <69561@debbugs.gnu.org>; Thu, 07 Mar 2024 08:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709829030; x=1710433830; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GlIluBa/vf7fZko8UjuKTpIgthsIOxwIxwnXAteeTFg=; b=HRECixkEUBHMnif25LzqglIovaO8e3x/nYz6pcWNxTwH0W+8Q6uh50n/IxkUklERzs LnmuAFOdWOIOaMQejfCckx2j2u1Tvdf0DcEZ8U9Wu+dkHn/NptU91wZuQqq77Ja90KJc 1TrUWDVlwdwLyzG4oAt5cQxJamNPHTBIJbV+Ie+uB+2A6/vpVEztLdezycG8gsuMc6jb Pnkk6LwBR1GDr4SiEMjwTqMqRMFGHHB+N19oOJY9dAWHgVsdiH3POIQ5C09gIq1h7lgc 8dHahSjMtresJwAIjTv3NCbdil84NEjV7Nc+TQT70uqB2nVBNXJixlC5gLv6R+HN1Y7f 2btQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709829030; x=1710433830; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GlIluBa/vf7fZko8UjuKTpIgthsIOxwIxwnXAteeTFg=; b=muw2eZ3MyNRgp8mqqbQn3xGiAR/KqQRlhr0bMc6pAQkogkJIFSsNZlhgmljjVLTQSR D+KCOvw0CCaFKTuhrTa3DFmNVKJnlXSTmQzp0FJjOS6Ee4ae1e4vrNbpRdWcfx88w+ZK hkUVv5mfm/yEPHFFSp+bLm3EWoSc/7ASEH7I0s6uR77cj2BdNZGEEMBqFfvJXQhFbhct bcCX4mdXkqHjcLUYSjn1ovtAQPEQtm0SsPyNrdmejbiEVsRRlqkNYpPNPYBU6zFq8bJ7 3Q7uZ3GRYBTfRtyq/R7DgT1bVlroWQuTIwc0sT2qkFMqE78wmMyobZngBTwdHbkLupCW 7tpA== X-Gm-Message-State: AOJu0YwUR2KEUsCvWwI2uGEtf1xsngXhVPo2NvZvM5dL7i0so5Ja0FMT klRJKks1k2ewzcHXKlr1KdDj+cOWfehIDaC/xagPsG6czD5TNKXXjGPFDkvq X-Google-Smtp-Source: AGHT+IFGkwwA5HCCNScqJeZ1ZQLmZXK7QLFTek2FxQAyaWxsMzs13AP/NnlM+Xvaad3jj+m090IEoQ== X-Received: by 2002:a50:8e14:0:b0:566:abbd:c390 with SMTP id 20-20020a508e14000000b00566abbdc390mr187842edw.6.1709829029344; Thu, 07 Mar 2024 08:30:29 -0800 (PST) Original-Received: from Pro.fritz.box (pd9e3631f.dip0.t-ipconnect.de. [217.227.99.31]) by smtp.gmail.com with ESMTPSA id g16-20020a056402321000b00567e27c72c4sm2076181eda.62.2024.03.07.08.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 08:30:28 -0800 (PST) In-Reply-To: (Alan Third's message of "Thu, 7 Mar 2024 16:05:55 +0000") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281178 Archived-At: Alan Third writes: > On Thu, Mar 07, 2024 at 04:18:00PM +0100, Gerd M=C3=B6llmann wrote: >> (CC'd to Alan.) >>=20 >> As a reminder, the freezes are especially annoying because one cannot >> C-g out of them. I read the NS code today, and I think I at least have a >> strong suspicion why that is. >>=20 >> Let's just simplify things and say that the NS code has a queue named >> hold_events_q of struct input_event (global variable). The queue is >> filled when EmacsView receives NS events from the system, for example >> C-g. NS events are processed by calling [NSApp run] with some >> ornamention around it to make sure the calls returns. ns_select and >> ns_read_socket do that. >>=20 >> The input_events in hold_events_q are given to Emacs in ns_read_socket, >> which is installed for terminal type as read_socket_hook. That's how >> normally a C-g is recognized by kdb_store_event and Vquit_flag is set. >>=20 >> But hold_events_q are _not_ kbd_store'd in ns_select. Instead we have >>=20 >> if (hold_event_q.nr > 0 && !run_loop_only) >> { >> /* We already have events pending. */ >> raise (SIGIO); >> errno =3D EINTR; >> return -1; >> } >>=20 >> So, ns_select returns -1 to wait_reading_process_out which loops, >> AFAICT. >>=20 >> if (nfds < 0) >> { >> if (xerrno =3D=3D EINTR) >> no_avail =3D 1; >> ... >> if (no_avail || nfds =3D=3D 0) >> continue; >>=20 >> And Vquit_flag is never changing because the C-g is still in >> hold_events_q, and maybe_quit does nothing. >>=20 >> Does that make sense?=20 > > But keyboard input (ns_read_socket) is handled immediately after that > "if (nfds < 0)" block and well before the "if (no_avail...". Could you please tell the line number? > That would imply to me that keyboard input, and therefore the C-g, is > being blocked for some reason. Perhaps block_input() has been called? > > I'm no expert on how this part of Emacs works so I'm probably > completely misunderstanding this. Me neither, so many things have changed in only 20 years... :-)