From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 17:56:51 2025 Received: (at submit) by debbugs.gnu.org; 12 Aug 2025 21:56:52 +0000 Received: from localhost ([127.0.0.1]:55188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulwzD-0006yR-GG for submit@debbugs.gnu.org; Tue, 12 Aug 2025 17:56:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:54782) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulwz8-0006xr-S5 for submit@debbugs.gnu.org; Tue, 12 Aug 2025 17:56:48 -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 1ulwz1-0004hY-JK for bug-gnu-emacs@gnu.org; Tue, 12 Aug 2025 17:56:39 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ulwyv-0004BZ-2t for bug-gnu-emacs@gnu.org; Tue, 12 Aug 2025 17:56:39 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 30.1.90; native--compile-async sentinel can error if threads are running X-Debbugs-Cc: John Wiegley Date: Tue, 12 Aug 2025 17:56:29 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1755035789; bh=xU9DHh5dQOvmK+OMGipm45wo+kqWjy80R6Y9IPEXRl8=; h=From:To:Subject:Date; b=uh1TVpvXMr2AAgqFAJW5fUH7SEHUXVFWHlsgr4iIdOhXyTQtvlDNHK7FN9wy16hdn 6XgcoNHfQtBC3c3r12zwmETcQly7mT9cEh5MNdVkn73KVujJTXcM9ID7eNm9p3HZlk mORK73lk67rP1FCuiJ+mYrs3OtUSXJIYQsWlqaD6KTaMYKMmh92sm928msu50fgayM 8lY8QgGiXZBtj3g9NlEm7Wa299xq2Qyoy2oT8fivoK+s+rt4vVDOOSRiMpm3hiROh5 qDUCwKMgHmlezKqRF4J9/8P/1LeEWpAXq9d0oMmfVprn+cbr6MuXy1Cp1/rLRuNrkU WcCtJqRyRF+0g== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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: -0.1 (/) Other threads can run pending_funcalls if they call accept-process-output. This should probably not be allowed. A specific bug is that the C core calls native--compile-async using pending_funcalls. If that runs on another thread, then the processes created in native--compile-async are locked to that other thread. Then the sentinels for those processes error when they call accept-process-output on the processes while on yet another thrad. Or something like that; the sentinels were definitely erroring with the "Attempt to accept output from process %s locked to thread %s" error. This can be reproduced somewhat reliably by causing the C code to start async native compilation while there are other threads running. Sorry for not making a full reproduction, but I think it's fairly self-explanatory, and having pending_funcalls run on other threads is clearly wrong. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 07:42:02 2025 Received: (at 79228) by debbugs.gnu.org; 13 Aug 2025 11:42:02 +0000 Received: from localhost ([127.0.0.1]:56586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1um9rm-00031K-68 for submit@debbugs.gnu.org; Wed, 13 Aug 2025 07:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57478) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1um9rj-00030q-6I for 79228@debbugs.gnu.org; Wed, 13 Aug 2025 07:41:59 -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 1um9rb-0001HN-EB; Wed, 13 Aug 2025 07:41:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FZck08LdE9Q+8kw/BNO8bzHSdwk4xSf7aE3Lyb4b+HI=; b=CKxiAnm242jT ptb09TRL1bpE7qrpYxyhqx6rVzSq8wiLV9abopbQa4gREpUHpeeoSdIdTm5R2oTHqwO0y8t/0r1uj Oukry5nTM/pUpiItnovOkp5NJY4JMV4W1ySGDemw73fl6Lm6Y7/8fMnEXUVtyadbP1Z2JkbVkdsRu G+awsuvOpt/HejXGSzk7UF9WVbv0jBdwa88MXMRTUgzBH4XrfdM5TzRc/VyMa87g+PiV3K0YRfQme PwgWcfhRrfJNTSDV9Av/NDk6hqXmwVVRNBPqJinP8O4ZqB7+eyeV4AAf6y8jeViHAn84yp+9KT4A9 6KNCtmdtkFNG6sYFwaTr9A==; Date: Wed, 13 Aug 2025 14:41:46 +0300 Message-Id: <86a543o3d1.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , Andrea Corallo In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: johnw@gnu.org, 79228@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 (---) > Cc: John Wiegley > Date: Tue, 12 Aug 2025 17:56:29 -0400 > From: Spencer Baugh via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Other threads can run pending_funcalls if they call > accept-process-output. This should probably not be allowed. > > A specific bug is that the C core calls native--compile-async using > pending_funcalls. If that runs on another thread, then the processes > created in native--compile-async are locked to that other thread. Then > the sentinels for those processes error when they call > accept-process-output on the processes while on yet another thrad. Or > something like that; the sentinels were definitely erroring with the > "Attempt to accept output from process %s locked to thread %s" error. > > This can be reproduced somewhat reliably by causing the C code to start > async native compilation while there are other threads running. Sorry > for not making a full reproduction, but I think it's fairly > self-explanatory, and having pending_funcalls run on other threads is > clearly wrong. Can't say I understood the scenario, but then I'm not an expert on native-compilation's low-level details. Adding Andrea, in the hope that he understands better. (How can native--compile-async run "on another thread"?) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 03:31:42 2025 Received: (at 79228) by debbugs.gnu.org; 30 Aug 2025 07:31:42 +0000 Received: from localhost ([127.0.0.1]:44471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usG3q-0001r5-1n for submit@debbugs.gnu.org; Sat, 30 Aug 2025 03:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38722) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usG3n-0001qp-5e for 79228@debbugs.gnu.org; Sat, 30 Aug 2025 03:31:39 -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 1usG3h-0003Lv-7D; Sat, 30 Aug 2025 03:31:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S7KtQc8UP9x4+1WWx3eDt8UJTNZnFS6xoRh/tdPkvOs=; b=k7sxM5DLXCDU MdHoC5ctviPHDiEhr3jUEc1nJ2QmXIfqI0w6//qciTFox3rPGVEH6p/Bi21G00CLBDNpX4X2VVcCQ GaLe4034sIoidzOl1q94CPRGVGnY9a/ycMN2fCovKBibriPBp1fM3mp3M333lDDBl/e8s7MMylGhZ yn/dsPTmxOXUt6gdp8frpSlRtOKs7xMEKbJeMOCRybhZLdsaiVIqt03ZlTcpJlS2NJTR+CLD+MPf1 d6CoZBmFAkeXO9u2IQ6qLX0Qos0STUvx6TPZK6vHkc2cdoXAx3SxLoxI6HEnAjRX/fprXZEklg1jQ 2JRqWCbbi1F4ajeFiLHm4Q==; Date: Sat, 30 Aug 2025 10:31:30 +0300 Message-Id: <86seh9qn8t.fsf@gnu.org> From: Eli Zaretskii To: Andrea Corallo In-Reply-To: <86a543o3d1.fsf@gnu.org> (message from Eli Zaretskii on Wed, 13 Aug 2025 14:41:46 +0300) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: sbaugh@janestreet.com, johnw@gnu.org, 79228@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 (---) Ping! Andrea, could you please look into this? > Cc: johnw@gnu.org, 79228@debbugs.gnu.org > Date: Wed, 13 Aug 2025 14:41:46 +0300 > From: Eli Zaretskii > > > Cc: John Wiegley > > Date: Tue, 12 Aug 2025 17:56:29 -0400 > > From: Spencer Baugh via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > > > Other threads can run pending_funcalls if they call > > accept-process-output. This should probably not be allowed. > > > > A specific bug is that the C core calls native--compile-async using > > pending_funcalls. If that runs on another thread, then the processes > > created in native--compile-async are locked to that other thread. Then > > the sentinels for those processes error when they call > > accept-process-output on the processes while on yet another thrad. Or > > something like that; the sentinels were definitely erroring with the > > "Attempt to accept output from process %s locked to thread %s" error. > > > > This can be reproduced somewhat reliably by causing the C code to start > > async native compilation while there are other threads running. Sorry > > for not making a full reproduction, but I think it's fairly > > self-explanatory, and having pending_funcalls run on other threads is > > clearly wrong. > > Can't say I understood the scenario, but then I'm not an expert on > native-compilation's low-level details. Adding Andrea, in the hope > that he understands better. > > (How can native--compile-async run "on another thread"?) > > > > From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 03:52:38 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 07:52:38 +0000 Received: from localhost ([127.0.0.1]:56495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uszLC-00012j-Bk for submit@debbugs.gnu.org; Mon, 01 Sep 2025 03:52:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41692) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uszL6-00012S-HX for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 03:52:34 -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 1uszKz-0005TJ-AZ; Mon, 01 Sep 2025 03:52:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=tQzCZJOq4ONxGW+m+tulf26mf+z5cU1N3B8Sj4yug4s=; b=geTuvOByHiEYRpdqd1yH ILvHR0lokdX/uUp3K6qW4FHS3lbg14sst178U2d+UxXlvPJVhtee6YX4tysd6wt4Pfollgk20rp0o PFY8IUatG/Zf4kQv6XKD6RBYl9cMKN8PRI1/l6qvDxUudu3RKmQCUJ0pyIlzOlgwEpo6pgH9lixg5 hMyh479m/P4MFJyDGImV4s7thMwgHqYtSZ1LTQ3dLoNgUMLzn2RxiSbR9YTyP+9k5ZdbK34SM8MpO chdwMR3YiDu3XlKbJMcAPAjK4Dl0fNsfYweqzQUn+GgCVNs89gLJL1RUtUmeaBGPEyHg8zRaFVHn/ EfsJy1r7LxhRfQ==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1uszKO-0008V5-MP; Mon, 01 Sep 2025 03:52:23 -0400 From: Andrea Corallo To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86seh9qn8t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Aug 2025 10:31:30 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> Date: Mon, 01 Sep 2025 03:51:43 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: sbaugh@janestreet.com, johnw@gnu.org, 79228@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 (---) Eli Zaretskii writes: Hi Eli, must say I, like you, still don't understand the issue here. Spencer which threads are we talking about? Native async compilation spawn processes not threads. Thanks! Andrea From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 08:55:24 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 12:55:24 +0000 Received: from localhost ([127.0.0.1]:57013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut448-0004QY-L8 for submit@debbugs.gnu.org; Mon, 01 Sep 2025 08:55:24 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58075) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut445-0004QB-0x for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 08:55:17 -0400 Received: from mail-lf1-f72.google.com ([209.85.167.72]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.98.2) id 1ut43z-00000005Rhm-2r6d for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 08:55:11 -0400 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-55f6f7ed0caso1588667e87.2 for <79228@debbugs.gnu.org>; Mon, 01 Sep 2025 05:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1756731310; x=1757336110; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hjbrSaXpRtiY5uFyfl0r7f3wMaJhcS7WIAmZCWifQ/4=; b=fOqeUB6CPvVM7sl4ZE8wlsVyLlKEA/23JdVcIvbPN5r4Fy0L2NQFts50KyycO8Pgk+ j9X0xRICA1y/UIg5qWD5hb/zkeBYd3ivUgCoEhk5ngSPG2GtdbsX9FbLFE3OX4gBiwp+ gca+c9w3R36Vs+iFMPZustESbVhSUm6rtk7vA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756731311; bh=hjbrSaXpRtiY5uFyfl0r7f3wMaJhcS7WIAmZCWifQ/4=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=pxSD1ab2PqohcQeSi9aebodFgD6+Q2jInRwViMoK2cszhY4O9K0fLrfncUYk68yLb QaIC1Jpoif1VgStyvoLERvQN51jt+UH/PqOe2jm1zSS9qGljvOeWtbSrs4eq7KfI1H czJiknm5sNbnXkMdEwVK9IbnFWwsptwgPDutGUNh/RRL4mt7Y2A2Mhiszb6ogJSQJT 87COxxKucF8A614WOycQYyNO3eo6eyoXTxtAvdKJ8MQ4H6/OgwHAJy+Bre1kff/1JP kMVbsf+jOSg4TCN4mCYkfPH7gAICMWIcbEAsuX8wZUVxuHrtxp8RYJaoTk1SbyfpQF khn8SzxbScgAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756731310; x=1757336110; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hjbrSaXpRtiY5uFyfl0r7f3wMaJhcS7WIAmZCWifQ/4=; b=XMjAN2ca2y1HuoEpXRKTwSHzeQPRAFLnOzre1HVJHUH2U0xKNVPOGQOdO0PfwQPPNk guwnXXkYIfyaP66Zz8tgaJRfxRJEd97VNuftNenQjPmXhEvPqgxiplPjiIS8oFrEQk5W XotiU+6SeXBv3V1139wnPoEGeel0tmu0pMGvoosIjynJeCVZsoPLJfBi59feJKBLIrFa y0JTz8IBQwNDF6YFa0pC4P3Bpqav+XbLYftUHi7IGSHKmHcf2wWhnfX4SUE1mcF8U8pT NMVFUJZ1ngoxqxEEeXcNJeROQg2PwBGfCKz9WWYc0hpbL8WkTZNNaifcGDMHxgrBTZJi HKGQ== X-Forwarded-Encrypted: i=1; AJvYcCUOkZrV9B/9cJw9bnrmXB2SVQIIZW7O7kBolCTIx+++G+cZME97ArPXnd8qiyz8gK3OXC7yeA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxeNzq+eZPX2IhpTEn3ruaUjsHlmaoDFIYjDNsdULiM50VtRhB7 AxrBVyrvyKvupGPpG2gRQC0GdlGEG4P3DXhXaSnQ2CDqOJM0Yyx37JJ2tKN2iPVPXXtHRs2rC/p tX0AD67t/lcDqYSstkC+GCQxGuxhl5NLv+8ZU3UTD1UdlSey6SkHiIhsA69HwgrrHzWWjOdtrn8 M0HsQP5M7VntTKq7cXaIBHt/uXo4oHTQ== X-Gm-Gg: ASbGncsDqHUCqZQhYz6ZlKMz7fFrCiLE/wVhrSnUeg0+VDlKKg3i38nsVteyso5Ne93 ZF5+CEzr/r2QsCjFNkzTqLIpGIS9xaWvgwODCTMAJY9bmVnNkdWdlX4SeribPlqxhmUoQN4nwd9 BxzuUpO/3ZaEMpdNS5+cUT X-Received: by 2002:a05:6512:3d05:b0:55f:4ac2:a595 with SMTP id 2adb3069b0e04-55f708bd57emr2782244e87.16.1756731310007; Mon, 01 Sep 2025 05:55:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGus12SWFw3dP7oJJykkaLxFkkvAb8ra+6Lh1zTUQBjdqjKVCXFzLZkMYqfk+0XK9NLVFS6VQMAx+8JOGib7Ws= X-Received: by 2002:a05:6512:3d05:b0:55f:4ac2:a595 with SMTP id 2adb3069b0e04-55f708bd57emr2782228e87.16.1756731309276; Mon, 01 Sep 2025 05:55:09 -0700 (PDT) MIME-Version: 1.0 References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> In-Reply-To: From: Spencer Baugh Date: Mon, 1 Sep 2025 08:54:58 -0400 X-Gm-Features: Ac12FXzsgAUO-KeqFi_82yVaNBYEiIMlNOeUuqm2AtvBrgm3hc54PFoB7EJw2NU Message-ID: Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running To: Andrea Corallo Content-Type: multipart/alternative; boundary="000000000000a7d429063dbce186" X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 79228 Cc: Eli Zaretskii , johnw@gnu.org, 79228@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: -4.3 (----) --000000000000a7d429063dbce186 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 1, 2025, 3:52=E2=80=AFAM Andrea Corallo wrot= e: > Eli Zaretskii writes: > > Hi Eli, > > must say I, like you, still don't understand the issue here. > > Spencer which threads are we talking about? Native async compilation > spawn processes not threads. > Lisp threads - the thread API in Emacs Lisp. > --000000000000a7d429063dbce186 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Sep 1, 2025, 3:52=E2=80= =AFAM Andrea Corallo <acorallo@gnu.o= rg> wrote:
Eli Zaretskii <= ;eliz@= gnu.org> writes:

Hi Eli,

must say I, like you, still don't understand the issue here.

Spencer which threads are we talking about?=C2=A0 Native async compilation<= br> spawn processes not threads.
=
Lisp threads - the thread API in Emacs Lisp.
--000000000000a7d429063dbce186-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 11:12:02 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 15:12:02 +0000 Received: from localhost ([127.0.0.1]:58155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut6CP-0002Z9-Or for submit@debbugs.gnu.org; Mon, 01 Sep 2025 11:12:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49718) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut6CN-0002Yq-3S for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 11:11:59 -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 1ut6CG-0004I2-Un; Mon, 01 Sep 2025 11:11:52 -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=LPNjI0hh+InXm3IdtDlzf8dzrnNAhyi9zZ02U1J8yJc=; b=gjUoOhuBhbN57VbWBvjS srXkGU9EGQ98VsA9ASTbnAOyhRq4jp2nEMnM9VSn8dufTvVu+hhSE4y54gLxVwOgjUnByrRvoBHbs a8aCgaLGiSMt9tpJi0qFkcRFZk+UhudyqwHsPJQsN0Cz9Z0VTPQCp/J77tiN3NbNR1odN+ZdVi16D iL4amPCn2frBkax4xAiQLL6jvjecpsPppHEZ2ofsDY10LgcVaX+oqTauRLrr5LxGsyWWp1t5CtuAA M8EfEjWQhZrxefk8U+kYhvIKotSdKgqDnJHa34l4tOBhz3sMhBqW3/c8ANMyZUuhKnWL9kjxeuMYk /9ula/fAFZorrQ==; Date: Mon, 01 Sep 2025 18:11:49 +0300 Message-Id: <86v7m2mclm.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Mon, 1 Sep 2025 08:54:58 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.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: 79228 Cc: acorallo@gnu.org, johnw@gnu.org, 79228@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: Spencer Baugh > Date: Mon, 1 Sep 2025 08:54:58 -0400 > Cc: Eli Zaretskii , johnw@gnu.org, 79228@debbugs.gnu.org > > On Mon, Sep 1, 2025, 3:52 AM Andrea Corallo wrote: > > Eli Zaretskii writes: > > Hi Eli, > > must say I, like you, still don't understand the issue here. > > Spencer which threads are we talking about? Native async compilation > spawn processes not threads. > > Lisp threads - the thread API in Emacs Lisp. Are you talking about some 3rd-party package? If not, how come threads come into the picture when native-compilation is involved? IOW, would you please describe the situation from its very beginning, assuming someone runs something from "emacs -Q"? Otherwise, it is very hard to understand what kind of situations could cause async processes running native compilation to be locked to the wrong threads. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 11:21:07 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 15:21:07 +0000 Received: from localhost ([127.0.0.1]:58171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut6LC-0002ya-UI for submit@debbugs.gnu.org; Mon, 01 Sep 2025 11:21:07 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55081) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut6L9-0002xi-Vi for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 11:21:04 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86v7m2mclm.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Sep 2025 18:11:49 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> Date: Mon, 01 Sep 2025 11:20:58 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756740058; bh=gY6oDrcbj0mzssMtwmUxRw3f4ELXxih4/VVNo9VQUdo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=S+spJsgkuqWTxyPY+0qDVsHtDCBJ6goY9TL/mdikXC+nBun8iiMFqJPtGSzkloqfS qjDqLVju5S8wLI0NXSVr0Q39qssvwYsK5wmxoh9icuuCgBQYJdBUrtxeBUXd03ssiV Y8tcedC2Pl6tFI2UjShiB9wb1XKuFVX3yLfRo4UozCPiLI3CjwPvxcjgy1kzgmhvWm y0eCHwN5SfNbfYW7gTHJJmaJhUK9qiLkp44hrnXsSNMQyaBZ7iV5Oipa6LKZY+80nK 4VHPusHk4mPL1k09/A5hWpHXdcibvVUkAm6/wOSKkKKTVRqXK3SKl2WLtOg4UDHpzV O/7etr2PIqI9Q== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: acorallo@gnu.org, johnw@gnu.org, 79228@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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Mon, 1 Sep 2025 08:54:58 -0400 >> Cc: Eli Zaretskii , johnw@gnu.org, 79228@debbugs.gnu.org >>=20 >> On Mon, Sep 1, 2025, 3:52=E2=80=AFAM Andrea Corallo w= rote: >>=20 >> Eli Zaretskii writes: >>=20 >> Hi Eli, >>=20 >> must say I, like you, still don't understand the issue here. >>=20 >> Spencer which threads are we talking about? Native async compilation >> spawn processes not threads. >>=20 >> Lisp threads - the thread API in Emacs Lisp. > > Are you talking about some 3rd-party package? If not, how come > threads come into the picture when native-compilation is involved? > > IOW, would you please describe the situation from its very beginning, > assuming someone runs something from "emacs -Q"? Otherwise, it is > very hard to understand what kind of situations could cause async > processes running native compilation to be locked to the wrong > threads. 1. emacs -Q 2. Run some command which starts a thread 3. Run some command which starts native compilation Native compilation is done via pending_funcalls. pending_funcalls can be run in the non-main thread started by 2. Thus the native compilation can happen in a non-main thread. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 11:59:51 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 15:59:51 +0000 Received: from localhost ([127.0.0.1]:58286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut6wh-0007SX-8g for submit@debbugs.gnu.org; Mon, 01 Sep 2025 11:59:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42270) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut6wf-0007SK-2M for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 11:59:49 -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 1ut6wZ-0003Gk-D0; Mon, 01 Sep 2025 11:59:43 -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=QkMRTuXJQ4BDS7fexjHv1kyJAs9VxFzbBqwvJkYVxro=; b=GZ9fkhOXkyhhyEKf5lhq z8Eztw0V7MjZiPxTRHDPtrrj2UwWEDwTQ5wausdW3cCViyRqslRWQ8cnvaFpsDgOvdYh/A3NO2TNG fW96wu4eiR/Qkhj252uw1qPDBmPckVdxy/ztZd/oEP/6KAhp7vj/ALdyEFFX1bP5FTln7LVnSDsOs Z/69jn53jQDXToLPRNNQ5mCkVn31uzrWGu1kYaLm50Xw6pUac9jz/HVccrBuISuWxHREm9v+WZ7QQ u92eYUjbHSAATabxNjUx6NBF0qXerESfIHqxAezsM8xskFxHJOJXDt3hcLPQsV8xu3tDV8s1Oq06C ByGoXIXKf9CHmQ==; Date: Mon, 01 Sep 2025 18:59:39 +0300 Message-Id: <86qzwqmadw.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Mon, 01 Sep 2025 11:20:58 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.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: 79228 Cc: acorallo@gnu.org, johnw@gnu.org, 79228@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: Spencer Baugh > Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > Date: Mon, 01 Sep 2025 11:20:58 -0400 > > Eli Zaretskii writes: > > >> From: Spencer Baugh > >> Date: Mon, 1 Sep 2025 08:54:58 -0400 > >> Cc: Eli Zaretskii , johnw@gnu.org, 79228@debbugs.gnu.org > >> > >> On Mon, Sep 1, 2025, 3:52 AM Andrea Corallo wrote: > >> > >> Eli Zaretskii writes: > >> > >> Hi Eli, > >> > >> must say I, like you, still don't understand the issue here. > >> > >> Spencer which threads are we talking about? Native async compilation > >> spawn processes not threads. > >> > >> Lisp threads - the thread API in Emacs Lisp. > > > > Are you talking about some 3rd-party package? If not, how come > > threads come into the picture when native-compilation is involved? > > > > IOW, would you please describe the situation from its very beginning, > > assuming someone runs something from "emacs -Q"? Otherwise, it is > > very hard to understand what kind of situations could cause async > > processes running native compilation to be locked to the wrong > > threads. > > 1. emacs -Q > 2. Run some command which starts a thread > 3. Run some command which starts native compilation > > Native compilation is done via pending_funcalls. pending_funcalls can > be run in the non-main thread started by 2. How? > Thus the native compilation can happen in a non-main thread. So step 3 is not necessary? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 12:03:28 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 16:03:28 +0000 Received: from localhost ([127.0.0.1]:58294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut70C-0007hA-9M for submit@debbugs.gnu.org; Mon, 01 Sep 2025 12:03:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:38183) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut70B-0007gt-5o for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 12:03:27 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86qzwqmadw.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Sep 2025 18:59:39 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> Date: Mon, 01 Sep 2025 12:03:21 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756742601; bh=6KrYwHWYAe8csylCPCBgfnpAwSiFAu3m57iNTlK6lHE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=byD4mI08qi8L2TpjfYrX0GAkdqzt01v8TLtLwuKW5EataehRXDhm1C+r0dgjWRGBd dKKSifX+2XXeBzMoJ0qyTMmrEvT37IoEbcTIr6kBvancA/NGB4faAC313QnBBAS95I QA5u20HbeLwxhR3iKAy1lmVn3YWk0gQ0XFwLE6b24Cl7LuaazZikF9dydAdW5MqACg hUv8xVyUM6X1dGJXEeR7FLk3yyiTlRqR4EUwqkVt3GLdjpDzpqaNCX5LiyzjrMuZAO tIvGhY4YelOUwaQjEZq9DCZOc/HcHEDPapSEdRmaxydFA6Zoxj+N0gZI1yz9pT8NR/ yWv/wJKziI6ng== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: acorallo@gnu.org, johnw@gnu.org, 79228@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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org >> Date: Mon, 01 Sep 2025 11:20:58 -0400 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Spencer Baugh >> >> Date: Mon, 1 Sep 2025 08:54:58 -0400 >> >> Cc: Eli Zaretskii , johnw@gnu.org, 79228@debbugs.gnu.org >> >>=20 >> >> On Mon, Sep 1, 2025, 3:52=E2=80=AFAM Andrea Corallo wrote: >> >>=20 >> >> Eli Zaretskii writes: >> >>=20 >> >> Hi Eli, >> >>=20 >> >> must say I, like you, still don't understand the issue here. >> >>=20 >> >> Spencer which threads are we talking about? Native async compilation >> >> spawn processes not threads. >> >>=20 >> >> Lisp threads - the thread API in Emacs Lisp. >> > >> > Are you talking about some 3rd-party package? If not, how come >> > threads come into the picture when native-compilation is involved? >> > >> > IOW, would you please describe the situation from its very beginning, >> > assuming someone runs something from "emacs -Q"? Otherwise, it is >> > very hard to understand what kind of situations could cause async >> > processes running native compilation to be locked to the wrong >> > threads. >>=20 >> 1. emacs -Q >> 2. Run some command which starts a thread >> 3. Run some command which starts native compilation >>=20 >> Native compilation is done via pending_funcalls. pending_funcalls can >> be run in the non-main thread started by 2. > > How? Because pending_funcalls is run by timer_check_2, which is run by timer_check, which is run by wait_reading_process_output, which can be run by non-main threads. >> Thus the native compilation can happen in a non-main thread. > > So step 3 is not necessary? It's necesary because, of course, if nothing causes native compilation to happen, native compilation won't happen. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 15:07:27 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 19:07:27 +0000 Received: from localhost ([127.0.0.1]:58499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut9sF-0001je-1W for submit@debbugs.gnu.org; Mon, 01 Sep 2025 15:07:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58770) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut9sD-0001jQ-BW for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 15:07:26 -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 1ut9s7-0007au-Gd; Mon, 01 Sep 2025 15:07:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QLi/hNYXHBl3K+uvKStf74A61DbzmxcRfKNw3ebwrts=; b=M1kHOkmbtTNJ WuPWwulrhuTlbsPuDrwVKEmA2IsELsqzW9qhPAVyC6VwkRSFd+MPdFGjr55+3XxB/H1Ym9SwbYFcD idIUzwhhuAG2uD3npWvsMYVq6M+NDxsfTLhT1nBVrPzK0IVnruFNKuNM3mHoIiaNuh4g6ZTVkAeOz 08mBwH9gzqUjJ3ywka8JlZlgx6sSjlNdTIaUBthsP9zYxOp+woR72rIwxvSIcULHycAZkf79FyRWx szd5gUgfufKIlhs1BEG1taY4QTuUl+hxyJdeEDgwfSm4P7qEEntinAmWuE1ybFVq7JSW7YB1CJgcx vo+aoQYKdaV49l/XKhimKg==; Date: Mon, 01 Sep 2025 22:07:16 +0300 Message-Id: <86plcam1p7.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Mon, 01 Sep 2025 12:03:21 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: acorallo@gnu.org, johnw@gnu.org, 79228@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: Spencer Baugh > Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > Date: Mon, 01 Sep 2025 12:03:21 -0400 > > Eli Zaretskii writes: > > >> 1. emacs -Q > >> 2. Run some command which starts a thread > >> 3. Run some command which starts native compilation > >> > >> Native compilation is done via pending_funcalls. pending_funcalls can > >> be run in the non-main thread started by 2. > > > > How? > > Because pending_funcalls is run by timer_check_2, which is run by > timer_check, which is run by wait_reading_process_output, which can be > run by non-main threads. So maybe we should run timers only in the main thread? > >> Thus the native compilation can happen in a non-main thread. > > > > So step 3 is not necessary? > > It's necesary because, of course, if nothing causes native compilation > to happen, native compilation won't happen. Native compilation can be triggered by loading a Lisp package which doesn't yet have a .eln file. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 15:11:07 2025 Received: (at 79228) by debbugs.gnu.org; 1 Sep 2025 19:11:07 +0000 Received: from localhost ([127.0.0.1]:58516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut9vn-0001vp-Fv for submit@debbugs.gnu.org; Mon, 01 Sep 2025 15:11:07 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58531) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut9vl-0001v8-9A for 79228@debbugs.gnu.org; Mon, 01 Sep 2025 15:11:05 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86plcam1p7.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Sep 2025 22:07:16 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> Date: Mon, 01 Sep 2025 15:10:59 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756753859; bh=7H9z85qq0vR6TdGBypVJ8Y7u/ojGlcs2prRhLCWfOf0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Q63T4+p4VsJw4ryg6lsLxQ4cUaeVBsYf5Gm1X0gjeGihe9y3yur/G6X4ieQrr/JVV uc4T8nUdh00TTi1TqIA7XxSRSojU8RYEDx+DBgSzhWyx0XsZD5HDrMk2tiu63JnTFE qSA3vPYsxJQ6lw4H+P4rAWqgaJbG36/zAb1G7iikdsN1AcgFZljz5O8wynYhoAxebH 8uuFK9S/XNlKc2l7zma8cNsV95jWVzsdl1drvUM0ydZCMFEVtalbW/w1J59Vx4I4Xl Ni0WQFfQwlrZkQnfysR8iARPyafOqnS4Gb7JaiJ0tyZjAIL8QFIQcy9zn7kWQpmQx+ f1Q/YpDrEUcjg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: Dmitry Gutov , acorallo@gnu.org, johnw@gnu.org, 79228@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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org >> Date: Mon, 01 Sep 2025 12:03:21 -0400 >> >> Eli Zaretskii writes: >> >> >> 1. emacs -Q >> >> 2. Run some command which starts a thread >> >> 3. Run some command which starts native compilation >> >> >> >> Native compilation is done via pending_funcalls. pending_funcalls can >> >> be run in the non-main thread started by 2. >> > >> > How? >> >> Because pending_funcalls is run by timer_check_2, which is run by >> timer_check, which is run by wait_reading_process_output, which can be >> run by non-main threads. > > So maybe we should run timers only in the main thread? That would break, for example, with-timeout. Alternatively, if we stopped locking processes to threads, this problem would also be fixed. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 07:14:30 2025 Received: (at 79228) by debbugs.gnu.org; 2 Sep 2025 11:14:30 +0000 Received: from localhost ([127.0.0.1]:60479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utOy5-0005UV-Q2 for submit@debbugs.gnu.org; Tue, 02 Sep 2025 07:14:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53622) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utOy3-0005UD-40 for 79228@debbugs.gnu.org; Tue, 02 Sep 2025 07:14:27 -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 1utOxw-0006tB-MK; Tue, 02 Sep 2025 07:14:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7i6+qEZXXJjSWJje6QJtKCserJ0ByhotigH1wjj9POA=; b=qRaf/ViYTv4W sW4rvkNu7ze6viFysfyP1njvRjSKjN9Dc+bxHXtm+y/aTd7AxTqG92kRwO47W3JteXfIwkwK6B81m tKlVJnhczGU8Ftd4Qt8G74AeR8IVumCObi0CFLr8+uTj63UFM32ReCaBhjP5SR0lhBnCfKRoIyBCw WTqpP86o1FdJe+shoeW5DDAF3QMvDCPN3TDq6m+isucERNVmKi/Y9iAA6AkeGSfZyBmGvASMb+uJZ dx+nYZFQVFr8xR+0rraMl6yTPhd0rwmjSCc4SUQVF9pWR3BWZFsKe0s2es7/Lf+AZJIyZeeP6PYeQ PgvfRi6G58efbbCplTDs9A==; Date: Tue, 02 Sep 2025 14:14:15 +0300 Message-Id: <86cy89m7i0.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Mon, 01 Sep 2025 15:10:59 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@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: Spencer Baugh > Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org, Dmitry Gutov > > Date: Mon, 01 Sep 2025 15:10:59 -0400 > > Eli Zaretskii writes: > > >> From: Spencer Baugh > >> Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > >> Date: Mon, 01 Sep 2025 12:03:21 -0400 > >> > >> Eli Zaretskii writes: > >> > >> >> 1. emacs -Q > >> >> 2. Run some command which starts a thread > >> >> 3. Run some command which starts native compilation > >> >> > >> >> Native compilation is done via pending_funcalls. pending_funcalls can > >> >> be run in the non-main thread started by 2. > >> > > >> > How? > >> > >> Because pending_funcalls is run by timer_check_2, which is run by > >> timer_check, which is run by wait_reading_process_output, which can be > >> run by non-main threads. > > > > So maybe we should run timers only in the main thread? > > That would break, for example, with-timeout. So? I'm not at all surprised that timers and threads, two very different ways of having the same pseudo-parallel execution in Emacs, do not live together in peace. > Alternatively, if we stopped locking processes to threads, this problem > would also be fixed. That's too radical, and has too many downsides, as already discussed. And it's unjustified, since if worse comes to worst, we can simply unlock the process that performs async compilation. No need to reach far-fetched conclusions about processes in general because of this specific case. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 09:18:26 2025 Received: (at 79228) by debbugs.gnu.org; 2 Sep 2025 13:18:26 +0000 Received: from localhost ([127.0.0.1]:33585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utQu1-0002qF-Fl for submit@debbugs.gnu.org; Tue, 02 Sep 2025 09:18:25 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49567) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utQtv-0002pr-FZ for 79228@debbugs.gnu.org; Tue, 02 Sep 2025 09:18:20 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86cy89m7i0.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 Sep 2025 14:14:15 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> <86cy89m7i0.fsf@gnu.org> Date: Tue, 02 Sep 2025 09:18:12 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756819092; bh=TNGO9FVhldmrZrA22JSPQUSCWtNw6MqPgcbI9Xz7gA8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Fk2CNEW8jZBdU05/28Jzv9wcxZkGlpA26A6RsYikPXlguSykqq8zYEfkT/5usme0n RDtjfhAXUcqeQMK6+/jR3KwgUt5ZK6RSUn22YLGIxPOFkSshU7m2mPyYAs22B+gSHt 7p5DSb0VdQ3MKDW64FLZY0ubhQtgI9+0O37varP68NoqyJUc1kXs6ELzmbMP/ObjNw 8jEbCKp5jkY2thBkE4lvfHm5b+jyL2ZzTKHJ2bz75gEJBe+seFCD78/v6TbCTidIZD weQNOK7gN7WHip5yhbaViG21mCQAPxg3uwxMt/v/orufV7zldGyyJTB3MfJ0LFUBw4 svcwZv0T5PxsQ== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@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 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org, Dmitry Gutov >> >> Date: Mon, 01 Sep 2025 15:10:59 -0400 >> >> Eli Zaretskii writes: >> >> >> From: Spencer Baugh >> >> Cc: acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org >> >> Date: Mon, 01 Sep 2025 12:03:21 -0400 >> >> >> >> Eli Zaretskii writes: >> >> >> >> >> 1. emacs -Q >> >> >> 2. Run some command which starts a thread >> >> >> 3. Run some command which starts native compilation >> >> >> >> >> >> Native compilation is done via pending_funcalls. pending_funcalls can >> >> >> be run in the non-main thread started by 2. >> >> > >> >> > How? >> >> >> >> Because pending_funcalls is run by timer_check_2, which is run by >> >> timer_check, which is run by wait_reading_process_output, which can be >> >> run by non-main threads. >> > >> > So maybe we should run timers only in the main thread? >> >> That would break, for example, with-timeout. > > So? I'm not at all surprised that timers and threads, two very > different ways of having the same pseudo-parallel execution in Emacs, > do not live together in peace. > >> Alternatively, if we stopped locking processes to threads, this problem >> would also be fixed. > > That's too radical, and has too many downsides, as already discussed. > And it's unjustified, since if worse comes to worst, we can simply > unlock the process that performs async compilation. No need to reach > far-fetched conclusions about processes in general because of this > specific case. Okay, then this patch should fix the bug. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-any-thread-to-run-native-compilation.patch >From d0f0e4b5471d188b483c35eb69086f2de60b5405 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Tue, 2 Sep 2025 09:17:06 -0400 Subject: [PATCH] Allow any thread to run native compilation * lisp/emacs-lisp/comp-run.el (comp--run-async-workers): Don't lock the native compilation process to a thread (bug#79228) --- lisp/emacs-lisp/comp-run.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index 1761190ea17..5e33b1bc318 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -366,6 +366,7 @@ comp--run-async-workers (eq load1 'late)))) (comp--run-async-workers)) :noquery (not native-comp-async-query-on-exit)))) + (set-process-thread process nil) (puthash source-file process comp-async-compilations)) when (>= (comp--async-runnings) (comp--effective-async-max-jobs)) do (cl-return))) -- 2.43.7 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 10:22:01 2025 Received: (at 79228) by debbugs.gnu.org; 2 Sep 2025 14:22:01 +0000 Received: from localhost ([127.0.0.1]:35165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utRtY-0008RY-Rw for submit@debbugs.gnu.org; Tue, 02 Sep 2025 10:22:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48234) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utRtV-0008RF-7p for 79228@debbugs.gnu.org; Tue, 02 Sep 2025 10:21: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 1utRtM-0007FW-Lm; Tue, 02 Sep 2025 10:21:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Lfio+d0bdd7fi4jLcZqkwBTSL3GFvyrlPTcVbHuTMsM=; b=JDzDbXrnb/yz ZPJKokRCx1BOTnsocPjoj8i++Yf5GaX52AvkySK/RgMNO8OhMFv/800Tj90MMzxjCGpEbh7QsHy33 r9YcCIkiwKQRT5IBvXrAxaamwdV+8XoUQXW5X4h64Byp/3GY0MtZLtk0l4K13fqLp2NssnIIrngqs Jf0e12lhyDa28CQt+6MCMtcdw8KrOV4U4N6eGD6jr754t/u7BLBVjxA3nnRQvOjidCIyLPAKiD6KU vnz+ft/cbbG6CIUiAyYmcWVnEB5CwGQF74hoQ8mVWVg0ppD/Bq4O5V2BVVlqa0FoZss2P2gJVXr2y 5MG9ImzwSheGpNs6IAvklg==; Date: Tue, 02 Sep 2025 17:21:16 +0300 Message-Id: <86zfbdkk9v.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Tue, 02 Sep 2025 09:18:12 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> <86cy89m7i0.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@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: Spencer Baugh > Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > Date: Tue, 02 Sep 2025 09:18:12 -0400 > > > And it's unjustified, since if worse comes to worst, we can simply > > unlock the process that performs async compilation. No need to reach > > far-fetched conclusions about processes in general because of this > > specific case. > > Okay, then this patch should fix the bug. But does it? You've brought up the issue, so presumably you have a way of recreating the problem. Then please try this patch and tell whether it indeed solves the problem. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 10:41:07 2025 Received: (at 79228) by debbugs.gnu.org; 2 Sep 2025 14:41:07 +0000 Received: from localhost ([127.0.0.1]:35384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utSC3-0001yw-5E for submit@debbugs.gnu.org; Tue, 02 Sep 2025 10:41:07 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:39021) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utSBv-0001xN-9Z for 79228@debbugs.gnu.org; Tue, 02 Sep 2025 10:40:59 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running In-Reply-To: <86zfbdkk9v.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 Sep 2025 17:21:16 +0300") References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> <86cy89m7i0.fsf@gnu.org> <86zfbdkk9v.fsf@gnu.org> Date: Tue, 02 Sep 2025 10:40:53 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756824053; bh=/vRUzXDwypmkshmbWKswV592onZuD49/zTi8ZObs4S4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=uzqmJi1KSb/mEzF/r4zcsaIe1HhqQNyPnsLsR5grJUTRGKimjws0a2m2msKb6yt8h P0MB32cHhxAkuf0CbSBDXv7y502vHCFNhFxnGALg+TRXq4DOANcAWKt++Gleq/PFqo UNZzkY4KoruV3nX02RwKwbR/atCuJIfbT9Ts/i/uzA+a7BBg/lPYfnlEHcDttp6s9G tztaMlm8fEZ654i4IXYX2S6OMxkO6ioy5hE9wdVPdljfVEJD6/BwhTZ+Qi6AX8F4/z itEfwf2zWbqIG1M6vuJHdCbawSrpw7UJC3gNtq4klhnyZ1Hy58goVPPdc/BHLyFGah FbVfgzc31YIaw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228 Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org >> Date: Tue, 02 Sep 2025 09:18:12 -0400 >> >> > And it's unjustified, since if worse comes to worst, we can simply >> > unlock the process that performs async compilation. No need to reach >> > far-fetched conclusions about processes in general because of this >> > specific case. >> >> Okay, then this patch should fix the bug. > > But does it? You've brought up the issue, so presumably you have a > way of recreating the problem. Not easily, but fine, I did some more work to figure out a reliable reproduction: 1. Delete eln-cache 2. emacs -Q --eval '(dotimes (_ 5) (make-thread (lambda () (while t (sit-for 1)))))' 3. Observe errors in *Messages* from native compilation > Then please try this patch and tell whether it indeed solves the > problem. Yes, it does. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 11:08:14 2025 Received: (at 79228-done) by debbugs.gnu.org; 2 Sep 2025 15:08:14 +0000 Received: from localhost ([127.0.0.1]:35709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utScI-0004FT-Am for submit@debbugs.gnu.org; Tue, 02 Sep 2025 11:08:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55216) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utScF-0004F8-4F for 79228-done@debbugs.gnu.org; Tue, 02 Sep 2025 11:08:11 -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 1utSc5-0008KF-6J; Tue, 02 Sep 2025 11:08:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hBzS0Y4VnFmkqrkjz4rOLkC4vGT8itz9NnqA8rpierY=; b=rR3qzxJCQc8M 3EXzTVtsQr7G/ZLJuW/NCDwePKM7rEJXmQ8X4gEIsHbyPH9/YtPR6esJg1yMIFqgQkXZfAdgNCHKv nDtpECapX1qM92ilVCtZMY2pyt47BdltQS/5jvNEEoYTeVA++m6uAWPvTduDcWLPyH8DnTGOGPBLN JQwoWLR4SebFI+9Iwl+nQlNdqWTQkfAulwETEdKJmidzjtKHPEJjfeLOBgve0vogbUF8e7DzbhnER LlyT8WvuvDiGNcHdc5ROSQxN4NoTNPbRHl87fo3NT0Wq5v3XcOPtMSEMXc0ih6WK2xI5jduHSY2yA NGZW0EUMx3i/E1iqcxSREA==; Date: Tue, 02 Sep 2025 18:07:33 +0300 Message-Id: <86plc8lwp6.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Tue, 02 Sep 2025 10:40:53 -0400) Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running References: <86a543o3d1.fsf@gnu.org> <86seh9qn8t.fsf@gnu.org> <86v7m2mclm.fsf@gnu.org> <86qzwqmadw.fsf@gnu.org> <86plcam1p7.fsf@gnu.org> <86cy89m7i0.fsf@gnu.org> <86zfbdkk9v.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79228-done Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228-done@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: Spencer Baugh > Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > Date: Tue, 02 Sep 2025 10:40:53 -0400 > > Eli Zaretskii writes: > > >> From: Spencer Baugh > >> Cc: dmitry@gutov.dev, acorallo@gnu.org, johnw@gnu.org, 79228@debbugs.gnu.org > >> Date: Tue, 02 Sep 2025 09:18:12 -0400 > >> > >> > And it's unjustified, since if worse comes to worst, we can simply > >> > unlock the process that performs async compilation. No need to reach > >> > far-fetched conclusions about processes in general because of this > >> > specific case. > >> > >> Okay, then this patch should fix the bug. > > > > But does it? You've brought up the issue, so presumably you have a > > way of recreating the problem. > > Not easily, but fine, I did some more work to figure out a reliable > reproduction: > > 1. Delete eln-cache > 2. emacs -Q --eval '(dotimes (_ 5) (make-thread (lambda () (while t (sit-for 1)))))' > 3. Observe errors in *Messages* from native compilation > > > Then please try this patch and tell whether it indeed solves the > > problem. > > Yes, it does. Thanks, installed on master, and closing the bug.