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 09:41:38 +0100 Message-ID: References: <86bjwplmc1.fsf@gnu.org> <865xmxlivo.fsf@gnu.org> 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="40581"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75275@debbugs.gnu.org, alan@idiocy.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 09:42:43 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 1tTGmv-000APK-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 09:42:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTGmM-0007dK-Bu; Thu, 02 Jan 2025 03:42:06 -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 1tTGmJ-0007cg-CA for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 03:42:04 -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 1tTGmJ-0008K3-3l for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 03:42:03 -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=VqFv02C2EEpuhPfE1RZ1g9akak9Dx5aY2dqLZrsrRY4=; b=gZ57YxyOfQ1h1kUIO1KjVp04GRFIgQ2u5uJSZRvjutkfdiRgS8FGhHmGrZFcv/808KARlKGh15/VGRPBeg5c2YJUzhaPaLAKj3OWnzBVw6t5dF7qPt6PxAoi64I6G86MFUh8LKZHZUco3AyNi6Nh43s1jxOs81/EW3BXEtbb6Ro10937cfuFSutaeL86Sl3nCpfZ3gfBZKkQnuPp5DiA/arfMshQW5uj29tqiEklC30MIV5NrjN5/5AwpuNV2mcoxLBArFEXMdvZ/ht+SpZe4jVx1nyjaUcyP1VRGe3QooQburhZBkKV7tXNxk19bet5mcrTZrF5hJJPzbgg38YZbA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTGmI-0004cc-Ua for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 03:42: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, 02 Jan 2025 08:42:02 +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.173580730917738 (code B ref 75275); Thu, 02 Jan 2025 08:42:02 +0000 Original-Received: (at 75275) by debbugs.gnu.org; 2 Jan 2025 08:41:49 +0000 Original-Received: from localhost ([127.0.0.1]:42708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTGm4-0004c2-Tc for submit@debbugs.gnu.org; Thu, 02 Jan 2025 03:41:49 -0500 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:53751) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTGm2-0004bo-FH for 75275@debbugs.gnu.org; Thu, 02 Jan 2025 03:41:47 -0500 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso18231507a12.3 for <75275@debbugs.gnu.org>; Thu, 02 Jan 2025 00:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735807300; x=1736412100; 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=VqFv02C2EEpuhPfE1RZ1g9akak9Dx5aY2dqLZrsrRY4=; b=AMlqhOV8ppcEPYvqXMBEOXcdEzyOdflrx1t72nzsShmwVCONujHrFEO1PcZJ9Iea2t cYeczm5nQwLKwcJOAprALhM8wa8NOeY3Kf8oOumYryclt8AbtwUZzOxPOOlM81ad/jQp ksjG6HqgXfVAqEDoWtkZj0mX0pjk+SQQJTNRxDfhH4RQqwYsK+j/tZJh+j5I8pX2C2Z8 0Ejlub0M8I+Q6Nc9YSv1K++5Lhg3PEsDRb7jQCQiVRkMYmunOzf+jLxgCFNjLS9FPhQp 71tUnY9w6cWKtrDOYHwmzyCc/dRQUGDJ5qNxuzYL71cMzoBkH1k9Is1iyohaNIIBYwKJ ncmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735807300; x=1736412100; 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=VqFv02C2EEpuhPfE1RZ1g9akak9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received: by 2002:a05:6402:1590:b0:5d0:d818:559d with SMTP id 4fb4d7f45d1cf-5d81dda6576mr110924146a12.11.1735807300019; Thu, 02 Jan 2025 00:41:40 -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-aaf5ca700a8sm431469566b.173.2025.01.02.00.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 00:41:39 -0800 (PST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Thu, 02 Jan 2025 09:33:41 +0100") 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:298150 Archived-At: Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >>> From: Gerd M=C3=B6llmann >>> Cc: Stefan Kangas , Alan Third , >>> 75275@debbugs.gnu.org >>> Date: Thu, 02 Jan 2025 08:30:25 +0100 >>>=20 >>> Eli Zaretskii writes: >>>=20 >>> > From the backtrace of the new Lisp thread, it looks like it finished >>> > sleeping for 1 sec and then it proceeds to calling [NSApp run] >>>=20 >>> I think that's the problem, see my other reply to Stefan. >> >> So should we add a condition before calling [NSApp run] that we are in >> the main thread? > > ATM, I don't understand how we land in that line in ns_select_1 if not > [NSThread isMainThread]. Maybe I need new glasses. I asked Stefan if he > can see something in LLDB. It must something in here: if (![NSThread isMainThread] || (timeout && timeout->tv_sec =3D=3D 0 && timeout->tv_nsec =3D=3D 0)) thread_select (pselect, nfds, readfds, writefds, exceptfds, timeout, sigmask); Should we return here? else { struct timespec t =3D {0, 0}; thread_select (pselect, 0, NULL, NULL, NULL, &t, sigmask); } /* FIXME: This draining of outerpool causes a crash when a buffer running over tramp is displayed and the user tries to use the menus. I believe some other autorelease pool's lifetime straddles this call causing a violation of autorelease pool nesting. There's no good reason to keep these here since the pool will be drained some other time anyway, but removing them leaves the menus sometimes not opening until the user moves their mouse pointer, but that's better than a crash. There must be something about running external processes like tramp that interferes with the modal menu code. See bugs 24472, 37557, 37922. */ // [outerpool release]; // outerpool =3D [[NSAutoreleasePool alloc] init]; What is the following about? What is select_mutex or, for example? send_appdefined =3D YES; if (nr > 0) { pthread_mutex_lock (&select_mutex); select_nfds =3D nfds; select_valid =3D 0; if (readfds) { select_readfds =3D *readfds; select_valid +=3D SELECT_HAVE_READ; } if (writefds) { select_writefds =3D *writefds; select_valid +=3D SELECT_HAVE_WRITE; } if (timeout) { select_timeout =3D *timeout; select_valid +=3D SELECT_HAVE_TMO; } pthread_mutex_unlock (&select_mutex); /* Inform fd_handler that select should be called. */ c =3D 'g'; emacs_write_sig (selfds[1], &c, 1); } else if (nr =3D=3D 0 && timeout) { /* No file descriptor, just a timeout, no need to wake fd_handler. */ double time =3D timespectod (*timeout); timed_entry =3D [[NSTimer scheduledTimerWithTimeInterval: time target: NSApp selector: @selector (timeout_handler:) userInfo: 0 repeats: NO] retain]; } else /* No timeout and no file descriptors, can this happen? */ { /* Send appdefined so we exit from the loop. */ ns_send_appdefined (-1); } block_input (); ns_init_events (&event); [NSApp run];