From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#75275: 30.0.92; `make-thread` bug on macOS 15.2 Date: Thu, 2 Jan 2025 15:55:37 +0000 Message-ID: References: <86bjwplmc1.fsf@gnu.org> <865xmxlivo.fsf@gnu.org> <86y0ztk323.fsf@gnu.org> <86msg9jkqs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36102"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75275@debbugs.gnu.org, Eli Zaretskii , stefankangas@gmail.com To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 16:56:18 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 1tTNYY-0009Au-6f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 16:56:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTNYJ-0008E7-Lt; Thu, 02 Jan 2025 10:56:03 -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 1tTNYI-0008Dz-DV for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 10:56:02 -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 1tTNYI-0006AC-3y for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 10:56:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=06bEcltuTMmKAXvqIMs697ZFoScT3Lnza8F36tNhuXQ=; b=IYLs5ctO3eZy/qKB797blbImT1EFWW9COxRVukZniZOR82FOowlwSe5nG+7a/7PaDZzCrJnxWeOIb0zDtxOxqGxYqzCsxghthraV5TmeTg7xQinSVvUA816oeJ7qLO92PznJ3QsFXIfRwSmDp6oQr3rVoRJK7wq0EV3ZmjIkWUuCqL0B2nm0bG0uRaIMGgnRdBeolYFNPKARecoSokPqEVK2Mz7n+cV8yIyPGrebRbPqkJ35bOvHD/8OIxqPokLLvnc8OCiuiasgq5nLzZBrLr0g5xvoTv+HJLy8enIvWc78sgD1bwfW8v/M1s+ZU+gHgRmR5dIxNQF/EiB2BuH0MA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTNYH-0008Lo-Nj for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 10:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jan 2025 15:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 75275-submit@debbugs.gnu.org id=B75275.173583335032082 (code B ref 75275); Thu, 02 Jan 2025 15:56:01 +0000 Original-Received: (at 75275) by debbugs.gnu.org; 2 Jan 2025 15:55:50 +0000 Original-Received: from localhost ([127.0.0.1]:46228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTNY5-0008LN-Tq for submit@debbugs.gnu.org; Thu, 02 Jan 2025 10:55:50 -0500 Original-Received: from dane.soverin.net ([2a10:de80:1:4091:b9e9:221f:0:1]:49237) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTNY2-0008L2-Pr for 75275@debbugs.gnu.org; Thu, 02 Jan 2025 10:55:47 -0500 Original-Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4YPBBN3HzVz2xkF; Thu, 2 Jan 2025 15:55:40 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4YPBBM3pDyzC8; Thu, 2 Jan 2025 15:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1735833340; bh=cPmrdISazpmVckZ00Wp/TAmCziJj+16NxUvRwTS/gZc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hD8AXSv1zzMjLxA+LSStF1kPpWcGs+nGdfp9kQIHThsnJ6wyybAbIOXSbbtUGMtdC Sw0D+E6nrA4SX1YroMh+c1tgKfMrHAe04ijXecOcwO4WLbHg3toBoD/GT6OB25Gt3s LELeQS1tNlPRd5CIv3EICN8jf7NH6dtXUucOxWbyQBZEHgm+9SNwD1RxkQij2XzrlM zAVG8FfDYt/F8IBk+cdU4+dP39lHHyKeB8f7LYgULIK1WfhjpPrxWivCr/5wPMGofY KxXXZgevCROnTAM99jgr8GhMUeoUNsgTAjok9irhOWlkEYM4lMFLEdgF84sMU9ByVh 98S921EGhAMnA== X-CM-Analysis: v=2.4 cv=e8f8Sbp/ c=1 sm=1 tr=0 ts=6776b6fb a=UbsBXRcqaZ6D9kgPt/Dvnw==:617 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=VdSt8ZQiCzkA:10 a=mDV3o1hIAAAA:8 a=hIj89exaAAAA:8 a=pGLkceISAAAA:8 a=4nSHAfT06UWI38Xl6nwA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10 a=lS9wXHQM5UdnNJ4u63Ry:22 a=9MSFP0l5Dcwi9NrB_JPx:22 X-CM-Envelope: MS4xfHqaCgfYiGdqMxfTi5M56kmOISzpZpQ4HUL+ld+XMAvkItaVQgwcW1oM1AfXTiBEX3LLO0TpijcI1ygf8x0xiK968z3hWXqIbk2Eg7ieWnGCkVkc5/bG rOez+aFllmTi1mDJAYRR4Zy8P9RspC4vFFXJBa4qZ1F/LUlbit+8XqIWOa8RaTzESWJBb0937IWot18q4c0SrTB0eQen7zjcudj/lCleHJNo7JKseMZKgOb4 uSRImX88LK4JOIVyB6ziO5bQDoCahw58wPRESMwlrF2dIV9hIUfgXXSg7JSDnVyp Original-Received: from localhost (faroe.holly.idiocy.org [local]) by faroe.holly.idiocy.org (OpenSMTPD) with ESMTPA id a078eaa1; Thu, 2 Jan 2025 15:55:37 +0000 (UTC) Mail-Followup-To: Alan Third , Gerd =?UTF-8?Q?M=C3=B6llmann?= , Eli Zaretskii , 75275@debbugs.gnu.org, stefankangas@gmail.com Content-Disposition: inline In-Reply-To: X-Spampanel-Class: ham 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:298185 Archived-At: On Thu, Jan 02, 2025 at 04:37:19PM +0100, Gerd Möllmann wrote: > Eli Zaretskii writes: > > >> Date: Thu, 2 Jan 2025 11:03:50 +0000 > >> From: Alan Third > >> Cc: Eli Zaretskii , stefankangas@gmail.com, > >> 75275@debbugs.gnu.org > >> > >> > > I don't know. Is there anything in the following code that can be > >> > > relevant to a non-main thread? Note that non-main threads can > >> > > legitimately call wait_reading_process_output, which calls ns_select. > >> > > For example, what happens if a non-main Lisp thread starts a > >> > > sub-process? we do expect to be able to read the output from that > >> > > sub-process. > >> > >> My take on how this works was that in a non-main thread ns_select > >> should just act like pselect, hence it used to literally just call > >> pselect and return. > > > > In general, this is not right: calls to ns_select are expected to call > > thread_select, in all threads, so that other threads could get a > > chance on grabbing the global lock while this (non-main) thread waits > > for sub-process output. > > I think Alan meant thread_select(pselect, ...) because that's what is > already done in ns_select_1. Yes, sorry. What Gerd said. > But... when I look at fd_handler, that function calls pselect directly. > > result = pselect (nfds, &readfds, wfds, NULL, tmo, NULL); > > > Can that be right? I think that's OK as we've already called thread_select further up. I've a vague memory of putting this in as a work-around. We call thread_select with a zero timeout to give other threads a chance to grab the lock, then carry on as normal, running the run loop and fd_handler which calls pselect. To be fair, though, I think when we set this up I didn't understand the code as well as I do now, so perhaps it was the wrong thing to do. -- Alan Third