From unknown Wed Jun 18 23:06:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#72496 <72496@debbugs.gnu.org> To: bug#72496 <72496@debbugs.gnu.org> Subject: Status: 31.0.50; macOS: freezes without beach ball Reply-To: bug#72496 <72496@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:06:34 +0000 retitle 72496 31.0.50; macOS: freezes without beach ball reassign 72496 emacs submitter 72496 Gerd M=C3=B6llmann severity 72496 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 09:40:17 2024 Received: (at submit) by debbugs.gnu.org; 6 Aug 2024 13:40:17 +0000 Received: from localhost ([127.0.0.1]:60464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbKQC-0005pI-JA for submit@debbugs.gnu.org; Tue, 06 Aug 2024 09:40:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:55782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbKQA-0005p3-2G for submit@debbugs.gnu.org; Tue, 06 Aug 2024 09:40:14 -0400 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 1sbKPl-0000RX-PZ for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 09:39:49 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbKPk-00076y-0J for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 09:39:49 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5af326eddb2so10782544a12.1 for ; Tue, 06 Aug 2024 06:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722951586; x=1723556386; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=yT8IysYloHTeukmTnWln9jS23IlXFQO4Vcw4j26/ZfE=; b=GtevZgLW4ODXrrq9FYL+GGXY7sv/ap37l2uz+eUPaTQAXthc3uIqzgEamx3UxqSxe3 0bVcKjZDuBSqhL0wNgxWrxRD1GFKpgpsTirzo6sNKln30fWwkzBibRZXMPXWx+BDHRNf jY8Ypmet5X02i8iSNnoCx7U1yLUgkX3+KEbqYNVabROG9xFgimDHRtr1ghwqVcdBJTLQ YjLouvL0cplbvqwPVg4664KPNSzXQ4Sf20JANJaLUydt7zvQpgzRyJrX964VvfleN3O8 ft2JjW/FQ166PLZ7mTkHvJsjzGMgWONbqB4rXDTI0R0kSCnDP4Y4dkrHfrAf+6X+WVrk Vf2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722951586; x=1723556386; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yT8IysYloHTeukmTnWln9jS23IlXFQO4Vcw4j26/ZfE=; b=izqlmY7+6IR+jZjcsZTO0rbHZy10pdGKCn1Ao40WCCJlJKfY49ifsw4x5TI2OAv+2c z8ylMw5tYGd3wvIAsqorA2/gVraHlKCupkKYpdEaSO5r9ovbTw32rH5PwA3fygZm0ow6 hJiIgj7yuFM36cruyEkV5s5TM4AEnUf19JvtC3VvbrYvWnzFuoXUGeWIwFCoePDb5CJy hp0zdbVTQIns6Njq11fkLDdXpMVGthp0KOgQwci/EBVaiWste9eQSoDpSCL3OFBLgjxw JajgJQ934pSNR7s7QjFgwmUQ6WBIfppzl3ga82/eLxURB4ABVEbYyaAv7POotJoTowln KIYA== X-Gm-Message-State: AOJu0YzQoTseE/6n/2s3y3IFXU9ElTwBzqqr3i3j3RlWYaLzTrVniNJL hN18BZUM6O7mNUVmOOLj+yi0iglxD6qdIG1rd85P4FlHYeUoy8n+Qf80ew== X-Google-Smtp-Source: AGHT+IGGXTFrXX3bN9CwYAv7M+rnV60KgMlS1iFa5i1jxy5EI9FRCQRnobepui2+mm4EECfkuTRhvw== X-Received: by 2002:a05:6402:354c:b0:582:7394:a83d with SMTP id 4fb4d7f45d1cf-5b77da8e2f9mr14543490a12.12.1722951585220; Tue, 06 Aug 2024 06:39:45 -0700 (PDT) Received: from pro2.fritz.box (pd9e36fc1.dip0.t-ipconnect.de. [217.227.111.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bb87ea2a79sm2761972a12.35.2024.08.06.06.39.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 06:39:44 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: bug-gnu-emacs@gnu.org Subject: 31.0.50; macOS: freezes without beach ball X-Debbugs-Cc: Date: Tue, 06 Aug 2024 15:39:43 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x535.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.6.0, NS appkit-2487.70 Version 14.6 (Build 23G80)) of 2024-08-05 built on pro2.fritz.box Repository revision: c7d9cd722e5a7042a52c92f8497f903bfe9870b8 This is one of the problems on macOS that I'm experiencing quite often. I have no idea what is causing this, and I haven't found a way to make it reproducible. I guess I should file a bug report anyway. Let me first try to describe briefly how NS GUI event handling works in Emacs. The whole story starts with get_input_pending which calls gobble_input which calls a terminal's read_socket_hook, which is ns_read_socket in macOS. ns_read_socket calls [NSApplication run] to process macOS GUI events. The problem starts with [NSApplication run] being an endless loop that gets the next event, and dispatches it by calling the application's sendEvent method. The only way to make the run loop terminate is by calling [NSApplication stop]. This sets a flag that [NSApplicatoin run] is supposed to check and then return, so that we eventually return to ns_read_socket. We call [NSApplicaton stop] in our [EmacsApp sendEvent] method. To get there, we post special application-defined events to the application which [NSApplication run] processes and dispatches via sendEvent which calls stop and makes [NSApplication run] return to its caller. Note that stop only sets a flag, so we need to process another event to make run terminate. That's at least my understanding. We are posting these events all over the place, not only before ns_read_socket calls [NSApplication run]. And, to complicate matters, whether or not ns_send_appdefined actually posts an event depends on a global boolean variable. IOW, it's impenetrable. (I'm also leaving out the generation of input_events for Emacs here, which is another can of worms.) Problem is that this not always works. More specifically, this code in ns_read_socket_1 /* Run and wait for events. We must always send one NX_APPDEFINED event to ourself, otherwise [NXApp run] will never exit. */ send_appdefined = YES; ns_send_appdefined (-1); [NSApp run]; gets stuck in the GUI event loop, and the last line never returns. The effect being that Emacs freezes without a beach ball of death. It processes Cocoa events but Emacs never sees any input_events. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 10:53:52 2024 Received: (at 72496) by debbugs.gnu.org; 6 Aug 2024 14:53:52 +0000 Received: from localhost ([127.0.0.1]:32859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbLZP-0008GT-Qg for submit@debbugs.gnu.org; Tue, 06 Aug 2024 10:53:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbLZN-0008GB-NL for 72496@debbugs.gnu.org; Tue, 06 Aug 2024 10:53:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbLYu-0001KA-01; Tue, 06 Aug 2024 10:53:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=BfdCdrGQgFJc3iNgM6NKNM9ZdyRDaSHeihHBfAgXqPk=; b=ddt7/lHprKaJYjE8R9os Gfm6roR8+N0ipL5wujnBeWmXDe6DzOYvQ01Xb/aDRArjS57IABflg5FpH49YQteXCwRWAzL6cgBWQ 4AWzLgN4cWR6dkbjEO1pvhtqSxmmI5OzpZ+k2lWDliCsE9jpkBKD7P2W992W43CjgeYiQFx1oswdv QoyWeaptclPyxbF8vMl4NFDpNeUkxrpUr6tlNBV6+zImlR3T6bkQUq7qoJernCtiZIu8FcoPby0Ga cFun5ZM7Z5AD/vB9jtX5/G35kd5FcDFTTq12e8cpmgAxHVlNv0piDJ6r0gj+BGttU07v75rrwMKJM CtKZp8CFTLYHig==; Date: Tue, 06 Aug 2024 17:53:17 +0300 Message-Id: <865xsdpusi.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Tue, 06 Aug 2024 15:39:43 +0200) Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gerd Möllmann > Date: Tue, 06 Aug 2024 15:39:43 +0200 > > We call [NSApplicaton stop] in our [EmacsApp sendEvent] method. To get > there, we post special application-defined events to the application > which [NSApplication run] processes and dispatches via sendEvent which > calls stop and makes [NSApplication run] return to its caller. Is there any way to initiate posting that "special application-defined event" when Emacs is stuck thusly? For example, from some system signal-like event, or from a debugger? Then you at least would have a fire escape. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 12:38:13 2024 Received: (at 72496) by debbugs.gnu.org; 6 Aug 2024 16:38:14 +0000 Received: from localhost ([127.0.0.1]:32960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbNCP-0003Ew-Ju for submit@debbugs.gnu.org; Tue, 06 Aug 2024 12:38:13 -0400 Received: from mail-ed1-f53.google.com ([209.85.208.53]:50220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbNCN-0003Ef-Gu for 72496@debbugs.gnu.org; Tue, 06 Aug 2024 12:38:12 -0400 Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5b3fff87e6bso1073436a12.0 for <72496@debbugs.gnu.org>; Tue, 06 Aug 2024 09:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722962201; x=1723567001; 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=8p7C8fry4RtiXoa8uOO6Jaa6Z9VFPnx2BMNPYPWvZjY=; b=YczBWpYar76OJ9OH4/AbIRNL3BesRTF6m4Lq8OCnej7NOY/O6Bv2csEmp2PfiTcML2 LkXPPe1mkAJFWbR6955e1f6buskYpv4fQtfxOWiGoeTjzoOlVzg/J6MxyyzX/B8NCpDN I1OFFeepdcCMZgNV452wG7GLUeyI8cj4NXu/Pu4nnEymma4n5wSiDQR6KkQdTTwPiP/G 1QaGZN+sDAqlAFto/PdacYsScWB55t4W8SS4XnU1ucRM86PbeQN1M9N1JSsSAgq1r5T7 fExVRlovtl4rwnXEuVtO47tcm98MQgVub/NCrJsr2L+/GZmuNVeb40snCkxNM5Id4pix ucsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722962201; x=1723567001; 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=8p7C8fry4RtiXoa8uOO6Jaa6Z9VFPnx2BMNPYPWvZjY=; b=R0XVyO8W6VB4TxC2CG5iwq+LlWd06bU8qO746/iq/pmybzg1Tb/ZnQJXTNOUoG+FPi VBamnWaeL7H/eARZIhMNsKLm9VnTE91Ep7JKvXw24rx3XXJHISsNZaPGidrFpU7y0GlE ImsatZ1Xx39ZGnZojezqb9SAC4Akr3IRJhQApyEFyZUH4rBT0/sShc9hQ68dzhIhDLyz avf3F9GOkPmDHkEjbUcKmWpAhrSaq6KtyvuYTxxM7VsOfPwXDN9C8CtGMJmzN4E1Jk2u 7JrBHQNRkgSB7Q1VoPkFW7St6NoThXGM6e7hUyb+qiqlQLpj3F/MfKzc5VOYd8Qt6lrA Gaew== X-Gm-Message-State: AOJu0YzxzUOzHVFIUiC1j1iYUxl6Pa50sTBe8NGH/4YHeiTt71sreD+4 ocixFNDQACrJVjkV4pxIGuC0P83WCYMV+NJQn60EvxbnJ2WvX/XXHd83Sg== X-Google-Smtp-Source: AGHT+IHjimZRJ6gFNDVsVNTmxBsTOYZWT3XBtrcad2HIVXfyK3U+eQG64j615PYZmo5WFuvem75Rpw== X-Received: by 2002:a05:6402:60f:b0:5a3:a9f8:cf20 with SMTP id 4fb4d7f45d1cf-5b7f58eb70dmr10883623a12.34.1722962200850; Tue, 06 Aug 2024 09:36:40 -0700 (PDT) Received: from pro2.fritz.box (pd9e36fc1.dip0.t-ipconnect.de. [217.227.111.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b839708c56sm6129786a12.2.2024.08.06.09.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 09:36:40 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: <865xsdpusi.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Aug 2024 17:53:17 +0300") References: <865xsdpusi.fsf@gnu.org> Date: Tue, 06 Aug 2024 18:36:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Date: Tue, 06 Aug 2024 15:39:43 +0200 >>=20 >> We call [NSApplicaton stop] in our [EmacsApp sendEvent] method. To get >> there, we post special application-defined events to the application >> which [NSApplication run] processes and dispatches via sendEvent which >> calls stop and makes [NSApplication run] return to its caller. > > Is there any way to initiate posting that "special application-defined > event" when Emacs is stuck thusly? For example, from some system > signal-like event, or from a debugger? Then you at least would have a > fire escape. Running under LLDB I can do something, with a little code change in ns_send_appdefined. (lldb) expr ns_send_appdefined(-42) where I let -42 force posting an event, ignoring the global variable I mentioned, send_appdefined, that prevents the posting. Sometimes I have to do that twice before Emacs receives key strokes again. And it seems something is also broken afterwards, for example the cursor stops blinking, tooltips don't work and such things. But at least one can save buffers and exit. I've tried this (when (fboundp 'ns-app-stop) (defun sigusr1-handler () (interactive) (message "SIGUSR1 - stop event loop") (ns-app-stop)) (keymap-set special-event-map "" 'sigusr1-handler)) where ns-app-stop does such a ns_send_appdefined, but that didn't work for a reason unknown to me. I also tried to do that in the signal handler directly, but couldn't make it work either. BTW, there are also freezes with beach ball, where the situation seems to be reversed, i.e. for some reason [NSApplication run] seems to no longer processing events, hence the beach ball. I haven't event a theory what that could oossibly be caused by. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 14:04:59 2024 Received: (at 72496) by debbugs.gnu.org; 6 Aug 2024 18:04:59 +0000 Received: from localhost ([127.0.0.1]:33005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbOYN-0005R8-J4 for submit@debbugs.gnu.org; Tue, 06 Aug 2024 14:04:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbOYL-0005Qt-RZ for 72496@debbugs.gnu.org; Tue, 06 Aug 2024 14:04:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbOXs-00021F-Ax; Tue, 06 Aug 2024 14:04:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=sFfsOb1zLcaZBQPB2p/On2+Ih/rlwgJpFB0Psusg074=; b=AMMS8HYtsWn+/q2Mporj oO0gRwpw4CzlgKjiTywA4tehSstNBuEHng+xNXrogyz6HMwH/5EESy/fTpe74ADo2NVudTfeuDL9F M2mvzdXN9p2dgIRJ2boOg8V50fVvj4K3EfaEx8C/JMzb6m+szGpFJ/7IXRWe1NlTpf4UtgE6Zbqvn CrTg8vLhpJD3bA21g1+x5vFTGT8SuXEO2vvqEK+xtEguHC8wtnKHzm5PVlbvtgeeBxcWGKivINq8A g4SY9lagUzWxmoJK4dGsNLtQFCjFEIDJtnfnAXY+ROCnDHdNgkO1ESjGQCn4dXhJUBD7IU1QIDwuo owohNXa3HfXxog==; Date: Tue, 06 Aug 2024 21:04:26 +0300 Message-Id: <86wmkto7dh.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Tue, 06 Aug 2024 18:36:39 +0200) Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball References: <865xsdpusi.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gerd Möllmann > Cc: 72496@debbugs.gnu.org > Date: Tue, 06 Aug 2024 18:36:39 +0200 > > I've tried this > > (when (fboundp 'ns-app-stop) > (defun sigusr1-handler () > (interactive) > (message "SIGUSR1 - stop event loop") > (ns-app-stop)) > (keymap-set special-event-map "" 'sigusr1-handler)) > > where ns-app-stop does such a ns_send_appdefined, but that didn't work > for a reason unknown to me. Maybe the way SIGUSR1 is handled involves the same event queue that is botched in this scenario? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 14:39:17 2024 Received: (at 72496) by debbugs.gnu.org; 6 Aug 2024 18:39:17 +0000 Received: from localhost ([127.0.0.1]:33044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbP5Z-0006Jk-3L for submit@debbugs.gnu.org; Tue, 06 Aug 2024 14:39:17 -0400 Received: from mail-ed1-f53.google.com ([209.85.208.53]:50324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbP5U-0006JR-Q8 for 72496@debbugs.gnu.org; Tue, 06 Aug 2024 14:39:15 -0400 Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5b3fff87e6bso1216753a12.0 for <72496@debbugs.gnu.org>; Tue, 06 Aug 2024 11:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722969462; x=1723574262; 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=xINGUaLMcQ8TqD+ytEO6FVNj7OZTv+xhP/CYU54Hxf8=; b=YrRVDP1ZsQb9oC8Simg2NJEIMSeCwJn9M0n5n5Az6+f96QE4VID3/9THP9QRtdvABI zKNfCbhzaz/Xeg8KckzmCkcFYjkrjeX+bG3E+7a7B5FWrpkA79vPMh6Ed9ma6ndx1doB z1UQWcyuV42K1zeh3DTR7mLstC7089Ht4Afd6YIk6narpcYp+m0kyzgJ8loEgJRGnEjn Wa7Glg2l9QDiClM5Y9lCVd6vRgmqAo7ynS8FydJUwKXiAmbBshGKQlBArAzseF47M9DK FZBV4wKvidik4r+p9uHsOPBkyOHawQD5eEQpSQWY3WshqK7FEnZV6KQ02JWWV05DEnkt axUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722969462; x=1723574262; 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=xINGUaLMcQ8TqD+ytEO6FVNj7OZTv+xhP/CYU54Hxf8=; b=YTpa7vd8GA6o4n+qRe31GLx6sQ/+iG6E9oHgviWcNV/Fuk8s920BNWSk6P14c/RBXO UQ6oGsZR0Fls6XTuDl1QQQEFR0NbxJy6Jn2yzRN2LWE7T+DjcG1SRTEaVtlq80x+/CQg LYHfX2v86hUqq0CwDGFc0PX8h+ExIG9/lq+WQRINT2SmqLtW69f0Wn96osK/yLf09PE1 XvtdMpbAPfaZro/Hh3NqOtNvJk9gowI3IiCtFyMtK+RXP+i9IQCiGDIzKcIgYYtQ/K3r gv8vblrrYG6yBaucsyU0+ePZ2vBY/omCWfOaoXZZQtO7WgRVA0DwGrPU7r+S+r9LGkbA oBnw== X-Gm-Message-State: AOJu0YzjVfB63KGqdWLKEvyJ2Gbl/79qmrwAXQQWxJOZWsfwwldm+ocq e3ry94P4w8so5s9fmHHYgAKabDvEoET3fclKuocWLqMPW0XkZTx8XGv04A== X-Google-Smtp-Source: AGHT+IG3/UH7vUu6ESYbPVDvJFpuCPuOLRztSgLFhKtY+/Sj7xlp4J3bcrAx+WB2f7aiKqAwvr5XJQ== X-Received: by 2002:a05:6402:a42:b0:5a2:cc1c:4cf0 with SMTP id 4fb4d7f45d1cf-5b7f36f59ffmr11135474a12.7.1722969462070; Tue, 06 Aug 2024 11:37:42 -0700 (PDT) Received: from pro2.fritz.box (pd9e36fc1.dip0.t-ipconnect.de. [217.227.111.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b83a03b403sm6306992a12.42.2024.08.06.11.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 11:37:41 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: <86wmkto7dh.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Aug 2024 21:04:26 +0300") References: <865xsdpusi.fsf@gnu.org> <86wmkto7dh.fsf@gnu.org> Date: Tue, 06 Aug 2024 20:37:40 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: 72496@debbugs.gnu.org >> Date: Tue, 06 Aug 2024 18:36:39 +0200 >>=20 >> I've tried this >>=20 >> (when (fboundp 'ns-app-stop) >> (defun sigusr1-handler () >> (interactive) >> (message "SIGUSR1 - stop event loop") >> (ns-app-stop)) >> (keymap-set special-event-map "" 'sigusr1-handler)) >>=20 >> where ns-app-stop does such a ns_send_appdefined, but that didn't work >> for a reason unknown to me. > > Maybe the way SIGUSR1 is handled involves the same event queue that is > botched in this scenario? Yes, that's quite likely. I had a little hope that a signal would maybe handled in some special way, but apparently not. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 08 01:26:34 2024 Received: (at 72496) by debbugs.gnu.org; 8 Aug 2024 05:26:34 +0000 Received: from localhost ([127.0.0.1]:35333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbvfW-00071F-4R for submit@debbugs.gnu.org; Thu, 08 Aug 2024 01:26:34 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:47488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbvfU-000711-8z for 72496@debbugs.gnu.org; Thu, 08 Aug 2024 01:26:32 -0400 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a7d2a9a23d9so62361566b.3 for <72496@debbugs.gnu.org>; Wed, 07 Aug 2024 22:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723094700; x=1723699500; darn=debbugs.gnu.org; h=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=AZaygRDVDWgT1DJoBxfVJM8urYw2ew99cd2EgkLsQuo=; b=D02riPIfuOuNqlXvDKcFEgnbUggJnXt4MMm5Tj7N1/BNBA0HIOrywzhVtYHcTBWlcq tVdGrYcegqiYo2dlOxEzy6hY+leRyiLULjP+y72ed26Ei7b34BXX3X1KzEvBaggLcg1u S70PKmLXkT0+6xk4ry2Wfx99c3ZZbyRMTmjVOMAFzMsB1WYYOE2M0ENTShousB2Jim2O p0siuMjopsl4u79AsRyRMlKHf6864kFpjPI1Fmshach3IXsdDHzfYJ1Wqywh/yzZzxwB dHL7VYS+J42mn7CV1ymWnXJ1cyBYDIicfI3xDVZzurTb3lysqLnqTXml22+iUkgLi13G wkWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723094700; x=1723699500; h=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=AZaygRDVDWgT1DJoBxfVJM8urYw2ew99cd2EgkLsQuo=; b=VwM1ZKoEkkEqh6Ma0t0m2W3Lj6N3I7nqF9gZFjGwMmiBWUNr9FLVjpKQqBbRJUT9j1 1YK738xhJHHamWLGiHB0alFz4SiFdS7VD322nHryYz3nbIMT1qE7Gnt41Fp+0kGgurBl GRqSj5fOgfPwhJoWeL8/iLmb1C0hh5ZE6woPJpcEPGqCwQ6eb7pEz/6F4I6btfFMl/Gx UjUl3QcCG3w1fF++PLVZB/tWPdhU/yWBUtNcbB2r2AVwrMQPDB8xZTBvuf9m/8vhQQaG Fyjy23DG6Lx3asryvdVETTe+ZrkGe3MVNTeiNJm7EAbWObr/9ZO55TZbRl1Y0UxJSGlW UdCw== X-Gm-Message-State: AOJu0Ywg/ERX2DY3KQKKGsCNa7jwSEllfYqhuxzRW1zwPsl0cSMrMlCq WCq/L+dTnFLzZCjFw3Ek1taCjndYxzeknKV5iaDPsWndVteQAfP6tBoJEQ== X-Google-Smtp-Source: AGHT+IE1S5lU0U9sN3nS6GhrTwybiTnd4r8rn9zc5CqU3av5ZjBCOI5eEmpGfVZGFI6W26r+Vtk6HQ== X-Received: by 2002:a17:907:d581:b0:a77:bfca:da57 with SMTP id a640c23a62f3a-a8090e62284mr42513966b.44.1723094699699; Wed, 07 Aug 2024 22:24:59 -0700 (PDT) Received: from pro2.fritz.box (p4fe3a254.dip0.t-ipconnect.de. [79.227.162.84]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bc3d77sm695741066b.43.2024.08.07.22.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 22:24:59 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Tue, 06 Aug 2024 20:37:40 +0200") References: <865xsdpusi.fsf@gnu.org> <86wmkto7dh.fsf@gnu.org> Date: Thu, 08 Aug 2024 07:24:57 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >>> From: Gerd M=C3=B6llmann >>> Cc: 72496@debbugs.gnu.org >>> Date: Tue, 06 Aug 2024 18:36:39 +0200 >>>=20 >>> I've tried this >>>=20 >>> (when (fboundp 'ns-app-stop) >>> (defun sigusr1-handler () >>> (interactive) >>> (message "SIGUSR1 - stop event loop") >>> (ns-app-stop)) >>> (keymap-set special-event-map "" 'sigusr1-handler)) >>>=20 >>> where ns-app-stop does such a ns_send_appdefined, but that didn't work >>> for a reason unknown to me. >> >> Maybe the way SIGUSR1 is handled involves the same event queue that is >> botched in this scenario? > > Yes, that's quite likely. I had a little hope that a signal would maybe > handled in some special way, but apparently not. I'm now running locally with the attached change. This removes the global variable that can prevent sending app-defined events when set wrong. Instead, I'm using [NSApplication nextEventMatchingMask] to check if an app-defined event has already been posted. This is infinelty less dangerous. Let's see if that is the problem. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-NS-Send-application-defined-event-differently-bug-72.patch Content-Description: nsterm.m patch >From f48aafd73c7d2694bf2c9e980e9624bde9ab3b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Thu, 8 Aug 2024 06:57:21 +0200 Subject: [PATCH] NS: Send application-defined event differently (bug#72496) * src/nsterm.m (send_appdefined): Global variable removed, all uses removed. (ns_send_appdefined): Check if an application-defined event is already queued with [NSApplicaton nextEventMatching]. Post an event if not. --- src/nsterm.m | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 5588425686b..594f7ba974b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -309,7 +309,6 @@ - (unsigned long)unsignedLong #endif /* event loop */ -static BOOL send_appdefined = YES; #define NO_APPDEFINED_DATA (-8) static int last_appdefined_event_data = NO_APPDEFINED_DATA; static NSTimer *timed_entry = 0; @@ -507,7 +506,6 @@ - (unsigned long)unsignedLong hold_event_q.q[hold_event_q.nr++] = *event; /* Make sure ns_read_socket is called, i.e. we have input. */ raise (SIGIO); - send_appdefined = YES; } static Lisp_Object @@ -4689,13 +4687,17 @@ Function modeled after x_draw_glyph_string_box (). /* Only post this event if we haven't already posted one. This will end the [NXApp run] main loop after having processed all events queued at this moment. */ - if (send_appdefined || value == -42) + + NSEvent *app_defined_event = + [NSApp nextEventMatchingMask: NSEventMaskApplicationDefined + untilDate: nil + inMode: NSDefaultRunLoopMode + dequeue: NO]; + + if (app_defined_event == nil) { NSEvent *nxev; - /* We only need one NX_APPDEFINED event to stop NXApp from running. */ - send_appdefined = NO; - /* Don't need wakeup timer any more. */ if (timed_entry) { @@ -4812,7 +4814,6 @@ Function modeled after x_draw_glyph_string_box (). { /* Run and wait for events. We must always send one NX_APPDEFINED event to ourself, otherwise [NXApp run] will never exit. */ - send_appdefined = YES; ns_send_appdefined (-1); [NSApp run]; @@ -4907,7 +4908,6 @@ Function modeled after x_draw_glyph_string_box (). // outerpool = [[NSAutoreleasePool alloc] init]; - send_appdefined = YES; if (nr > 0) { pthread_mutex_lock (&select_mutex); @@ -4951,7 +4951,6 @@ Function modeled after x_draw_glyph_string_box (). else /* No timeout and no file descriptors, can this happen? */ { /* Send appdefined so we exit from the loop. */ - ns_send_appdefined (-1); } block_input (); @@ -6051,10 +6050,6 @@ - (void)sendEvent: (NSEvent *)theEvent last_appdefined_event_data = [theEvent data1]; [self stop: self]; } - else - { - send_appdefined = YES; - } } @@ -7727,7 +7722,7 @@ - (void)mouseMoved: (NSEvent *)e help_echo_object, help_echo_pos); } - if ((*emacsframe)->mouse_moved && send_appdefined) + if ((*emacsframe)->mouse_moved) ns_send_appdefined (-1); } @@ -8336,8 +8331,7 @@ - (void)windowDidExpose: sender SET_FRAME_VISIBLE (*emacsframe, 1); SET_FRAME_GARBAGED (*emacsframe); - if (send_appdefined) - ns_send_appdefined (-1); + ns_send_appdefined (-1); } -- 2.46.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 10 05:19:57 2024 Received: (at 72496) by debbugs.gnu.org; 10 Aug 2024 09:19:57 +0000 Received: from localhost ([127.0.0.1]:39065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sciGT-0008Bj-3D for submit@debbugs.gnu.org; Sat, 10 Aug 2024 05:19:57 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:56754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sciGP-0008BS-0n for 72496@debbugs.gnu.org; Sat, 10 Aug 2024 05:19:56 -0400 Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5af51684d52so3133305a12.1 for <72496@debbugs.gnu.org>; Sat, 10 Aug 2024 02:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723281497; x=1723886297; 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=2DpSXqZBPmJuIQ0SmhAJR3awarKKoUt52YYe5R9uuCw=; b=MnhuG1ckUI1vxUW3oIQBvyZMJ8eMuLoLMx0XA0XAHNRGVCWNS0TD8qHYYSAQib8p32 +kZgR5t3/UvwWM+f1YlyfpY/rXn0BMoKTNxSDW5SdSn3DlfCp1/tQay35nidvbrwmcJk p3Ou3Ucxt1kfBqLScq4UgluYU6AzMJ79aRz44xnLCt7N3XcPl9nrAnJidx15/I8iCwJ7 o9DCIrUEeLWq5OPiClJhv09nl7pnJVtgaSGaRy03lXWTEZxTWcNjDCiVpgB8eMV2hOgS LX0BXXHOPfTucOF4NkBeksq3w5bgbA6NWsC/hjPxi/3e1ux7Fn3clQ0Q0F9zYhcJpkgb 8YBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723281497; x=1723886297; 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=2DpSXqZBPmJuIQ0SmhAJR3awarKKoUt52YYe5R9uuCw=; b=pgf138buwfBswJOb3dHE6nImOIpzCaMFocdixPYw/EdcniEMVCJxmb+fYD2xIHbZKQ wah8w9+r1CFjng4xPPmBJuOblK+TvRwgxEX9z4AuTqOMEz7vmdEHZ8X+POKxNTu/eXoq giuUkrf3nRM3GbPFcSOAi4DibjZii9LHlbiPvdq2pnLLrcRElVTyOjtau6NPwgeA8bPF YZYqeh9XSBW24UF5+7FdAfrPjua0eCX3rV0fd+h9Iv+QHMoJjTEyCbjXIASh9QoqMLl1 mzXDE0IXKT4GY5HdjfVzwVwjr3hIdGH55DHlMu0iZf5KfjqbCb2bzsFw5pTL3sztcOfT u3Iw== X-Gm-Message-State: AOJu0Yyn7rrp1BhiyP5nBnd+pCaLusgigN0Qcd5bLDOfRA3AZUePgGPX d8jEDGMePjWJgU5dQWLlT0KDgYGVJGcku1qDGa19pxChWWYg7dxlet5tBw== X-Google-Smtp-Source: AGHT+IErxom1Me4CWjZrLI5cpPl7ET1+W5pKnW+98tR4aSZsrMEprtZLAr9Gk/WexAdeAsPiwq3trg== X-Received: by 2002:a17:907:f716:b0:a7a:9d1e:3b26 with SMTP id a640c23a62f3a-a80aa5e56b0mr282195766b.37.1723281497083; Sat, 10 Aug 2024 02:18:17 -0700 (PDT) Received: from pro2.fritz.box (p4fe3a01c.dip0.t-ipconnect.de. [79.227.160.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a80bb1cd2a8sm53054966b.117.2024.08.10.02.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Aug 2024 02:18:16 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Thu, 08 Aug 2024 07:24:57 +0200") References: <865xsdpusi.fsf@gnu.org> <86wmkto7dh.fsf@gnu.org> Date: Sat, 10 Aug 2024 11:18:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Eli Zaretskii writes: >> >>>> From: Gerd M=C3=B6llmann >>>> Cc: 72496@debbugs.gnu.org >>>> Date: Tue, 06 Aug 2024 18:36:39 +0200 >>>>=20 >>>> I've tried this >>>>=20 >>>> (when (fboundp 'ns-app-stop) >>>> (defun sigusr1-handler () >>>> (interactive) >>>> (message "SIGUSR1 - stop event loop") >>>> (ns-app-stop)) >>>> (keymap-set special-event-map "" 'sigusr1-handler)) >>>>=20 >>>> where ns-app-stop does such a ns_send_appdefined, but that didn't work >>>> for a reason unknown to me. >>> >>> Maybe the way SIGUSR1 is handled involves the same event queue that is >>> botched in this scenario? >> >> Yes, that's quite likely. I had a little hope that a signal would maybe >> handled in some special way, but apparently not. > > I'm now running locally with the attached change. This removes the > global variable that can prevent sending app-defined events when set > wrong. Instead, I'm using [NSApplication nextEventMatchingMask] to check > if an app-defined event has already been posted. This is infinelty less > dangerous. > > Let's see if that is the problem. I don't even know if this is related to my change to ns_send_appdefined, but I got a freeze today while using child frames (vertico + posframe) that I haven't seen before. Event the mouse behaved strangely on the whole macOS until I killed the process. That was without beach ball. So, whatever that was, my patch at least didn't help, if it wasn't causing it. I give up. I'll switch to using tty Emacs. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 16 08:02:38 2024 Received: (at control) by debbugs.gnu.org; 16 Nov 2024 13:02:39 +0000 Received: from localhost ([127.0.0.1]:52455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCIRi-0001PL-NL for submit@debbugs.gnu.org; Sat, 16 Nov 2024 08:02:38 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:54607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCIRh-0001PC-Fg for control@debbugs.gnu.org; Sat, 16 Nov 2024 08:02:38 -0500 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4315c1c7392so5148555e9.1 for ; Sat, 16 Nov 2024 05:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731762096; x=1732366896; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:from:to:cc:subject:date:message-id:reply-to; bh=wF3vUhIfURO61ukxXLBealMFgaixCM4m42cIg4UToik=; b=kQZoBylUS/kmB01LC2WW9AAGPz8FyAGhScu3hd9ha22iCrWICnpZxbHXO4oQW8hJii 7XBL5a8K1W1z1/+IFyPyT+PJJCItGLaocPolBGFQLPX9fuhRCIAY6brxjHVVwFWm1hlb 8bQvwm/mt3Vpo0D4JPjWdis2k0zFlgmG0khU3k1O6JpqSTkxWcSuezdWpit3SINOciJ0 X7bXobq4OTW3YhuDYWuVdI3wyrXGrOc7BkKDwiUg9YX8TCR5sUlhlT7h7ZR1Jp9t6S5P a1hXo9tT2Z/jrQ0YGpmhwD/gj32DCROg8hq8yGJUvJykgkr17WQkhA4YUBSgUf8hMQPN dl+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731762096; x=1732366896; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wF3vUhIfURO61ukxXLBealMFgaixCM4m42cIg4UToik=; b=Z4csCxGxQD9+tHgpZon093+CMP+U5AlMjRJBpRRAt5Ejv590gZ4nJnlfVTM0O9ZKsn Queoxi5l1aJlHT2SDnKJphwxubSZ71ejnqhF/dFHXjDTKzrGGi0Em5rgrcC/4GgfMEUN 5/lB828zGeTlFxKp4Y55sVTO5hPPWl18eCQLMNkk60wgVpxYmvV0bNyoyCrNUvMr7qC5 +kFuVOuFJoVpk0wiqJQpfujIyseOMFghB5YPwqtJ3xHOs3B+K9LBQjcihrRELWSEs8gL S6xNloMvXPn+WdpDQ0Cp9w81Bwpel0lvxSwMkwVTg+VbKgPxNIZmdI40Q6z+x3luJ2JQ uD8Q== X-Gm-Message-State: AOJu0YxwiBLha1q4KdxNv7kPWzE3ocRiwzVENxHP6/rS+wbaJT9Y08tP lth7LFHrf8BnePCcq7XH3q4GpOYareDZuv6g1OQMW8ZBF5mmJXLKQNbYAQ== X-Google-Smtp-Source: AGHT+IE5Kl0O4v0nRmXF8pExGb38NztT9/AOSuNEx4lO0FoBgTotUMprMHct6qICvStwwfWAZEXVYA== X-Received: by 2002:a5d:64c7:0:b0:37d:4fe9:b6a4 with SMTP id ffacd0b85a97d-38225aafea7mr4937382f8f.50.1731762096138; Sat, 16 Nov 2024 05:01:36 -0800 (PST) Received: from pro2 (pd9e36998.dip0.t-ipconnect.de. [217.227.105.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-382321b7fc2sm2621828f8f.75.2024.11.16.05.01.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2024 05:01:35 -0800 (PST) Date: Sat, 16 Nov 2024 14:01:34 +0100 Message-Id: To: control@debbugs.gnu.org From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Subject: control message for bug #74369 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) merge 74369 72496 quit From debbugs-submit-bounces@debbugs.gnu.org Wed May 28 00:41:28 2025 Received: (at 72496) by debbugs.gnu.org; 28 May 2025 04:41:28 +0000 Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uK8bX-0004tJ-Hx for submit@debbugs.gnu.org; Wed, 28 May 2025 00:41:27 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:45277) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uK8bP-0004sB-C4; Wed, 28 May 2025 00:41:20 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43cfebc343dso31444755e9.2; Tue, 27 May 2025 21:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748407273; x=1749012073; 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=NwnshL1bKVA3OkaBlnKsFmsEUqmAcyhXtPveR9F/7hA=; b=RVAwqepMeLA7OQqvC74CxxNnmQk35IlMKsPkVUm3Q/PNJ1wjG3DvlHM+hnxAmWndTM rLZSvwsvuONY952uhaEuDZSVAuM7ly8Dtv4ntbPvDw5Z6XtyWZmXWYdw6b1TP6xBZRDd sKOmpKtzXtGnqDIZbJd4oyn2KFYim5tZcuus8SGHW3BMjgXdx5bXgZa5WwW46WAG29G5 j0/gpw5ebYDgpVVPt7hwt+S/c+oHzAwX7HPmfpU/O6bxV1eWXXpAWOdnPal/+7OnNSXv /DjgvLmBPCzWIjfoxXdAk5TMN9U3nZPHR0/guLAIYurb2wZcUVw+gZ/3FNOu7FKVX3qT hHLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748407273; x=1749012073; 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=NwnshL1bKVA3OkaBlnKsFmsEUqmAcyhXtPveR9F/7hA=; b=jeR+gxdt8K5dqAhAS+qH2Dcp5iHOv4+xbIi87olE4sxe26lpMFY75FdqjlI+RxaozS HP0Jv3NvS2Gkh36Pv5xyAL4W0S7lKaWpAtBQTZHTYJ//cSj0ZsFmVFZQnBIjtDhdg8OJ cwg8JIDiNDnX3o5mQOIhVC8iOHe4ZYZ1qILqt3P/sQfh4epqUv3ZKSk7yGKxBqlXrpJT 2E7ABTfJ3WzFzRcZZW2cKTaVn7ABvXvi3kT41DBO+kBe3rtIWVAO/Z60dVsRfdv4uGlQ YnCyLk980HFd8wCtnZUdbHordB4DL5K5AWi/luJbZpLdf5ryeBFb+wNeI6Hzm5X7geJ2 ypsA== X-Forwarded-Encrypted: i=1; AJvYcCUDBc9oWekYR5KLvZv71Xz1YXyakutR43r4+c6JzaXVrOV6Wpas5uj1CZTP7lzXOThVz/tWrA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzU+0/yTQmIVaaSXKFMt15phY26iTy2TF7StDxbDXScIbX79etf gLGd5KZ/qkxwzVQlSK/ky5FhYGF4UKH3soAtQuqlsazkMDiabrniIAKWDtGx8w== X-Gm-Gg: ASbGnct3UkkiIHeuGW3kKLIY/LS74nt1zgUulM1VEWNbqn6Jd2X8kVNBp/VFRW5JDWu oIegCktTNhfOyQOL6c2B7W4McFpXDBzVfyQus03rKFJ7h06Qu0dw81RMj6p5+t1bX6JwAo5ptE9 QZpHLjhNYzo/vQOZRKXurpPw3vUOjSu3PZfjXhtNo5x2xIuvlB1DJEe9T3BQm7TLEyGxh5UTgdN Ugd/KM1+Hik7UvXU08qphSewYLewm7IdbV89qsaSpJih4ynopX5fVn2/9sX+ERcnLrnByhqTa0E uowA0HGH76cPAcYoqeC8r8rl4xOqwLv28CcP+9TRvtrqtg8S53QwGrWiBBF7hxxuU4glPcUZDzf 4vFn6sG69RUJ8A9tNvlxIV8sPjCW9dLx7eYGM1KbLMZ1Y1WQBMVg8HEO/DG8D X-Google-Smtp-Source: AGHT+IHAdVUAcoYrw9tHDu2P9vWepCvEjQRxdfHgeiNhtxA9RU8TfkHWTkoJ9UMBnnXbsxzQnV/LrA== X-Received: by 2002:a05:600c:5396:b0:43c:fe5e:f040 with SMTP id 5b1f17b1804b1-45077e36cc8mr3773085e9.23.1748407272719; Tue, 27 May 2025 21:41:12 -0700 (PDT) Received: from pro2 (p200300e0b7415d0058eee22c49b89973.dip0.t-ipconnect.de. [2003:e0:b741:5d00:58ee:e22c:49b8:9973]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450064a1bdbsm8452185e9.14.2025.05.27.21.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 May 2025 21:41:11 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: References: <861pzbimu0.fsf@gnu.org> <86h687gxrf.fsf@gnu.org> Date: Wed, 28 May 2025 06:41:10 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: 74369@debbugs.gnu.org, adamkshannon@gmail.com, 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: FWIW, and for posterity, I am now using the patch below. This makes the freezes without beach ball that I described literally impossible.=20 1 file changed, 17 insertions(+), 1 deletion(-) src/nsterm.m | 18 +++++++++++++++++- modified src/nsterm.m @@ -6132,7 +6132,23 @@ - (void)sendEvent: (NSEvent *)theEvent =20 NSTRACE_UNSILENCE(); =20 - [super sendEvent: theEvent]; + [super sendEvent:theEvent]; + +#ifdef NS_IMPL_COCOA + /* We have the problem that app-defined events get lost for an unknown + reason. When that happens, Emacs still processes NS events, and no + beach ball is displayed. But Emacs' own event loop does not gain + control again and it doesn't react to input anymore. */ + if ([NSApp modalWindow] !=3D nil) + return; + + static int count =3D 0; + if (++count =3D=3D 10) + { + count =3D 0; + [self stop: self]; + } +#endif } =20 =20 From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 08 00:43:42 2025 Received: (at 72496) by debbugs.gnu.org; 8 Jun 2025 04:43:42 +0000 Received: from localhost ([127.0.0.1]:50365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uO7sk-00065C-BB for submit@debbugs.gnu.org; Sun, 08 Jun 2025 00:43:42 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:45257) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uO7sh-00064q-Hp; Sun, 08 Jun 2025 00:43:40 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-453066fad06so3317515e9.2; Sat, 07 Jun 2025 21:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749357813; x=1749962613; 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=xvqoda8CT7lDG9/BJg6BSvzeVdAk8DOZKMamuKO0Rqc=; b=bLRwzoxkeGWW5s4nm2nheQ1GnPJ9FSECAoEJ1ltL1NR//ON65aXPYIl4anfq8byDoX hls4UXuj/RRCqdcpJwgP3jfkoc3yWVFBgVEH8LC5zsTW4S+v72OrrCg5oy6zGNN+gn0I 0Z0CofcHT9FFjpNZGfR53UCtfHhW8LOPmBD6LH0K0f3HIPWBs4i6Gx7Xh7+uabBnHTn3 zImoA9ydhv5okT9QH027ufUHFbqccnkJ6mXgZgLNEoJyVzsh0KLgv3zTqP2SG5oJB3zW foAMXiYJvS3lV2/eFUCAiYAohFOUUNTGPguBjRjkcFJn+AihFbcETfF4nKuIIV95irOv re+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749357813; x=1749962613; 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=xvqoda8CT7lDG9/BJg6BSvzeVdAk8DOZKMamuKO0Rqc=; b=vSg+QqpNEoefsfwlfxNQIxGa1YLmV4dUnIU6myKpB1CJb7CgYIyTV5GJG+9wIFMnMG R+uhvGisW9/2Gw82qahjjrRzoh6BRBPqnuLVjQ0CNtngiyw5R3KhPijcYJeXl7hiE+Pq yl1bTRn+esOdB7tW9TxqdH/e3e5Dwt/wh6+4SGuX9hrWv5wVVvOxmvbkOhG9ItgvuAL/ I/1bCZimOHB6zYv4DS0hwsGW74KWxvhku4LrheEatUboFMWMNkpZCKt5VYd7Qc7MBZ4u E4J16fZymU4H1OkNnXvN/aIp83tZtzuF56iFJc5CNbgLmIYD3E8jveEiVIwmRNYlscoa WWBg== X-Forwarded-Encrypted: i=1; AJvYcCXtLekOo9MSwfp7YxJAMwugWM8yVBzFol3rqMiZh7MGqSNmO/6Za6Nyi9U6EyiuHJJS2Ns27Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzYy5Bdx+n2lP1jkzpWOjoC0ybWuRMmsoxVmM5zBJLXm6oNVk3k jqTKXuQR5m91cl5MNl2bmTBKEbbnfj8sssk33vPBIZOy/tfEjTWzBZ40ML696bdt X-Gm-Gg: ASbGncvU0korCWHZBtuxUJTBb+L+Ary7TDRgOWtP3+I8Dto61t/y1iSU6O08XMmYYEP ddx7cx34+9D1o2wA+aJBrBw5+eQ4Woqo+fwYUe9tGyO70gC2JCJ0Qh8Jwpi425NbyXlvYfq9lGY 9nme37dB95I22kttBIt+BiLlxV7Fmlijg8G+EEBtCkmsboVynfNuD38bj7EkL04T4UqnIGkyO5u plwKR3KX+bz4F4wOieR4ukRETNL2po+G+cnVJ6iLg8pGX5dgECoplp8cVBDBdflLR4bHQpvk5sU edzwAxoIbkqNi7bmsS8SrFaaNL5HnXq98i+jPth9wJQuh+A8AP/XQXFXT40iL47WmTted5D/782 dGzpaFedWFWg0A4gCeHU5DDq3iij6e0e+xx5DAHXDMfiivPXDKFnNB/KCavFd X-Google-Smtp-Source: AGHT+IE5iuuUfsRj3kBORulKv/jeL3XkxHqvc5Tljb0qd4bj668wb0iqcMVx2TEs+eq2jNIGY8I2Hw== X-Received: by 2002:a05:600c:1e1c:b0:43c:fe5e:f040 with SMTP id 5b1f17b1804b1-452fbbf6c36mr55144555e9.23.1749357812576; Sat, 07 Jun 2025 21:43:32 -0700 (PDT) Received: from pro2 (p200300e0b72aee005cffa46ecc1e2213.dip0.t-ipconnect.de. [2003:e0:b72a:ee00:5cff:a46e:cc1e:2213]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-451f828715esm74323115e9.0.2025.06.07.21.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jun 2025 21:43:32 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#72496: 31.0.50; macOS: freezes without beach ball In-Reply-To: References: <861pzbimu0.fsf@gnu.org> <86h687gxrf.fsf@gnu.org> Date: Sun, 08 Jun 2025 06:43:31 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72496 Cc: adamkshannon@gmail.com, 74369@debbugs.gnu.org, 72496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > > FWIW, and for posterity, I am now using the patch below. This makes the > freezes without beach ball that I described literally impossible.=20 I take that back since I got another freeze with that patch.