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#75275: 30.0.92; `make-thread` bug on macOS 15.2 Date: Thu, 02 Jan 2025 08:12:01 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8123"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75275@debbugs.gnu.org, Alan Third To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 08:13:36 2025 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 1tTFOi-00020r-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 08:13:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTFOY-0005vb-6C; Thu, 02 Jan 2025 02:13:26 -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 1tTFOT-0005tP-US for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:13:23 -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 1tTFOA-0002FB-3g for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:13:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=JozOe9RZmV3Ooq/WG9XauZgnnHIXLialahH00HCUhvw=; b=oJX6qTBkYWpogK6bjcbBQhlpONS4OptxjCf5f3BjEXTPGf4EnIxB07wrf7b1OXipls/PuH9GK7vugym0T1lguuGkC+VdwKsN3wY0D6wfEfnqhr3/cglY70Np9jwX5zcVF4VvLtbiDl6InYPFJfesAJkjWJp623eZLSEFn5RyLArZvXOOL16GvMbNPvM0sREGos/1rlaaCFaat/jpProq0cjk3dDUdE3jHS6dxYcXu6gGjwJqujv/NX/7r0BdOLv9DXAQwhE1yzrwyLkHG7+yBlcKPoMsZ4QHpy9ga6YGU2rosNvas0rnS0VpobRKQVqbX0Ba3JJIGgagJ7i8O5QkIA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTFO9-0000br-TW for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:13:01 -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, 02 Jan 2025 07:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75275 X-GNU-PR-Package: emacs Original-Received: via spool by 75275-submit@debbugs.gnu.org id=B75275.17358019342263 (code B ref 75275); Thu, 02 Jan 2025 07:13:01 +0000 Original-Received: (at 75275) by debbugs.gnu.org; 2 Jan 2025 07:12:14 +0000 Original-Received: from localhost ([127.0.0.1]:42534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTFNN-0000aQ-DT for submit@debbugs.gnu.org; Thu, 02 Jan 2025 02:12:13 -0500 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:47526) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTFNK-0000aA-Uv for 75275@debbugs.gnu.org; Thu, 02 Jan 2025 02:12:11 -0500 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso109661766b.3 for <75275@debbugs.gnu.org>; Wed, 01 Jan 2025 23:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735801924; x=1736406724; 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=JozOe9RZmV3Ooq/WG9XauZgnnHIXLialahH00HCUhvw=; b=VcCMd4vVSSf+0bFshWvX4Zgftf5Xo3NldDP8h0Lp6PUliA6DcDwXAUNLOOsfsHJT/l Qh7/MmHkZ6JmWzaZXy6YlavxRkc531Y0ilDwfHKBFegrOQhc7tTW8C3X3HfXXbYkyP5O Am3IZ+KTOoqut97zVfdpAKCQHu16yzt52gvaaC7NbNsUOO++v5CssK39j8kAtdoFz8u4 6pWTErLIxVIV1baNq3LdvYgnu8LhKQdrsxGQQCYkDRXr4+06SnEOBc468NdF31qIgkZc Lx2r4SqmI4ExeCPRFYRFT7kDjfLbCg25EiDY2knBkD1j/EKjnlhY9Zq2E1MGmFqwWCiC WhFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735801924; x=1736406724; 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=JozOe9RZmV3Ooq/WG9XauZgnnHIXLialahH00HCUhvw=; b=Fv2QhEkMm3pGKr3f2+u5p4rDMOiK38zYkf6FlIK6pzgqnMJ6awuarXia98j/uDo5x8 OvfpElE9v3xE2MTgpIGr3s5knZEqFyuSeffmCaR61gfEFPVClORT1h1tPdOiTjSHdKLb jttIEXVd2jmz4vaiMUiv9/fezq5kWbtv37ynlLhIvNiaU9ts9QFHuCvcL5XRFU8LKbXg qJHzFpkUcONkqZf2KrUBMmuMl8IcxmsSi2oNxss/dYqQ9ustjMoZWseoB7FWrMrcJgYj Brj/GjFtOl1XrP82ZNWhxkJMpZ5KIYm9FhKGw6yNs3Mb3luJo62xXVuVzV/+ZjDKbvQE lfcg== X-Gm-Message-State: AOJu0YxP84YKNCNX1Ek8eApbm3B6Tl88DkJZUd9ne9BQ4k9JkFVTlNZb Ke9iIwv0+m77jcygdMdK8XjFOvqqkTZQXv7LZbMK5yxmORiRoNFh X-Gm-Gg: ASbGncvBBmhJ5UmwDY7gjHbyFwLoZFM8Y/Iwg4wz5JqMKy8iRAVNdQcqphaFFthciIQ MJbWY1ie0PHReURHrodeQidhxajp67B3ghMop00tbs/oqLB88VvE9uYNRjOml0KYJ+yc81QyRBu N7Ca+v0a4sy9TIQY6ZWwBCDYBZexas+/2A4uJzYX3jTtGnmTp/MizH7ub0AX5yU42Ef17LElE1e luFeu1ROO3t7oj2cOIVNax5nvOphcLbSp3MP+C6/K+3V+SZPkUGJ088XIiyg9D4nDBY6WHWld78 lJ5vF//OZ3thCoTvXB/5n2q/gpTwxcLJ65Og9arBOMe4A1PCfcl8qBLAZZVeQQdr X-Google-Smtp-Source: AGHT+IHd9GkhGw+8OpHP5n86vEEPgbE/IhPYdMHGeWKJM2C2AAioPn9Vkknop7Q33trrT0613oK8pA== X-Received: by 2002:a17:907:d9e:b0:aa6:8676:3b3b with SMTP id a640c23a62f3a-aac2cc722f0mr4224442066b.30.1735801924030; Wed, 01 Jan 2025 23:12:04 -0800 (PST) Original-Received: from pro2 (p200300e0b7290d009d701914d6a76d9d.dip0.t-ipconnect.de. [2003:e0:b729:d00:9d70:1914:d6a7:6d9d]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaef76c461asm1168744466b.125.2025.01.01.23.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jan 2025 23:12:02 -0800 (PST) In-Reply-To: (Stefan Kangas's message of "Thu, 2 Jan 2025 00:47:06 -0600") 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:298135 Archived-At: Stefan Kangas writes: >> Curious question: Do you see a beach ball? > > Yes, I do see a beach ball. It takes a second or so to show up, which I > guess is expected. Then it's the other category of freezes I see with NS, and not bug#72496. Which doesn't mean the cause might not be the same, in some way. > >>> When I kill the process in the lldb window with Ctrl+C, I can get the >>> following (this is on emacs-30): >>> >>> frame #12: 0x0000000100403fec emacs`-[EmacsApp >>> run](self=0x0000000156610fe0, _cmd="run") at nsterm.m:5938:7 >>> frame #13: 0x00000001004024b0 emacs`ns_select_1(nfds=0, >>> readfds=0x00000001708c26bc, writefds=0x00000001708c263c, >>> exceptfds=0x0000000000000000, timeout=0x00000001708c2610, >>> sigmask=0x0000000000000000, run_loop_only=NO) at nsterm.m:4954:3 >>> frame #14: 0x000000010040202c emacs`ns_select(nfds=0, >>> readfds=0x00000001708c26bc, writefds=0x00000001708c263c, >>> exceptfds=0x0000000000000000, timeout=0x00000001708c2610, >>> sigmask=0x0000000000000000) at nsterm.m:5006:10 >> >> I'm asking because of bug#72496. The part of the backtrace above reminds >> me a bit of what I trued to describe in that bug: EmacsApp.run never >> returning to ns_select_1. Can you see if it ever returns? > > After recompiling with NSTRACE_ENABLED, and based on reading at the > terminal output, it seems like it does not return to ns_select_1 after > the first line that reads > > nextEventMatchingMask should only be called from the Main Thread! > > Is there a better way to see if it returns to that function? I think it doesn't matter for this bug. The curious thing about 72496 is that EmacsApp.run apparently handles events so that no beach ball appears, but Emacs doesn't get a chance to handle its events. It's as if the Cocoa event handling decouples itself from Emacs. And that's because it doesn't return to ns_select_1. Anyway, different construction site apparently. I have something in my notes which might or might not help: * Breakpoint for errors displayed by macOS on stderr Set a breakpoint on CGPostError to find sources of errors. #+begin_src sh To find out from where macOS prints stuff to stderr, like 023-07-20 13:41:17.073449+0200 emacs[53072:1205906] [default] CGSWindowShmemCreateWithPort failed on port 0 b _os_log_error_impl b _os_log_impl b _os_log_debug_impl b _os_log_fault_impl #+end_src If on of these breakpoints is hit when the error is displayed, we could perhaps see why ns_select_1 calls EmacsApp.run. In my understanding, it shouldn't because Cocoa event handling should only be done in the main thread. If the breakpoints are not hit, we could instrument ns_select_1 to call an empty function do_break on which we could set a breakpoint. if (![NSThread isMainThread]) do_break (); [NSApp run]; Or something like that. The question would be what in the code above the [NSApp run] is wrong so that we land here. Probably some if condition. CC to Alan Third.