Re: master: Ignore signal-handling thread in S-L-A-D

Stas Boukarev <[email protected]> Fri, 20 Feb 2026 03:49:28 +0300
Newsgroups gmane.lisp.steel-bank.cvs,gmane.lisp.steel-bank.devel
Message-ID <CAF63=11eJXJmcjUcvbo-p_MLeE612KiAWszthcObKnu57jFG_Q@mail.gmail.com>
// Running save6.test.sh in COMPILE evaluator mode
Unhandled TYPE-ERROR in thread #<SB-THREAD:THREAD tid=259 "main thread" RUNNING
{70051D0003}>:
The value
0
is not of type
SB-THREAD:THREAD
Backtrace for: #<SB-THREAD:THREAD tid=259 "main thread" RUNNING {70051D0003}>
0: (SB-THREAD:THREAD-EPHEMERAL-P 0)
1: (REMOVE-IF #<FUNCTION SB-THREAD:THREAD-EPHEMERAL-P> (0))

On Wed, Feb 18, 2026 at 10:16 PM snuglas via Sbcl-commits
<[email protected]> wrote:
>
> The branch "master" has been updated in SBCL:
>        via  51b9c075c2c2ca6a0d9da4cc859ca4ba29b4bf4d (commit)
>       from  0d9ac5eeaab6ffd8d19231aeb1bd41d3a1e991a1 (commit)
>
> - Log -----------------------------------------------------------------
> commit 51b9c075c2c2ca6a0d9da4cc859ca4ba29b4bf4d
> Author: Douglas Katzman <[email protected]>
> Date:   Wed Feb 18 14:15:35 2026 -0500
>
>     Ignore signal-handling thread in S-L-A-D
> ---
>  src/code/save.lisp | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/src/code/save.lisp b/src/code/save.lisp
> index 3e5e8b49d..7b34202ee 100644
> --- a/src/code/save.lisp
> +++ b/src/code/save.lisp
> @@ -325,16 +325,26 @@ sufficiently motivated to do lengthy fixes."
>    (let (error)
>      (with-system-mutex (sb-thread::*make-thread-lock*)
>        (sb-thread::%dispose-thread-structs)
> -      (let ((threads (sb-thread:list-all-threads))
> -            (starting
> -             (remove sb-impl::*finalizer-thread*
> -                     (setq sb-thread::*starting-threads* ; ordinarily pruned in START-THREAD
> -                           (delete 0 sb-thread::*starting-threads*))))
> -            (joinable sb-thread::*joinable-threads*))
> -        (if (or (cdr threads) starting joinable)
> +      ;; As a consequence of a discovery I made about a nasty but common pattern
> +      ;; among users of doing (mapc #'some-harmful-operation (list-all-threads),
> +      ;; the finalizer thread is not present in (LIST-ALL-THREADS). Better to pretend
> +      ;; it doesn't exist than let users affect it (backtrace/terminate/whatever).
> +      ;; The same is not true of the signal-waiter thread on #+(and unix sb-safepoint).
> +      ;; Maybe it should be. But that being the case, we need to remove the sigwait
> +      ;; thread from list-all-threads.
> +      (let* ((userthreads
> +              (remove-if #'sb-thread::thread-ephemeral-p
> +                         (sb-thread:list-all-threads)))
> +             (actually-starting
> +              (setq sb-thread::*starting-threads* ; ordinarily pruned in START-THREAD
> +                    (delete 0 sb-thread::*starting-threads*)))
> +             (starting-userthreads
> +              (remove-if #'sb-thread::thread-ephemeral-p actually-starting))
> +             (joinable sb-thread::*joinable-threads*))
> +        (if (or (cdr userthreads) starting-userthreads joinable)
>              (let* ((interactive (sb-thread::interactive-threads))
> -                   (other (union (set-difference threads interactive)
> -                                 (union starting joinable))))
> +                   (other (union (set-difference userthreads interactive)
> +                                 (union starting-userthreads joinable))))
>                (setf error (make-condition 'save-with-multiple-threads-error
>                                            :interactive-threads interactive
>                                            :other-threads other)))
>
> -----------------------------------------------------------------------
>
>
> hooks/post-receive
> --
> SBCL
>
>
> _______________________________________________
> Sbcl-commits mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-commits


_______________________________________________
Sbcl-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-commits