GNU bug report logs - #79228
30.1.90; native--compile-async sentinel can error if threads are running

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 12 Aug 2025 21:57:01 UTC

Severity: normal

Found in version 30.1.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> janestreet.com>, Andrea Corallo <acorallo <at> gnu.org>
Cc: johnw <at> gnu.org, 79228 <at> debbugs.gnu.org
Subject: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running
Date: Wed, 13 Aug 2025 14:41:46 +0300
> Cc: John Wiegley <johnw <at> gnu.org>
> 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" <bug-gnu-emacs <at> gnu.org>
> 
> 
> 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"?)




This bug report was last modified 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.