On Sat, Mar 7, 2026 at 9:02 PM Samuel Thibault <[email protected]>
wrote:

>
> The relation between a thread existing and ss has always been sketchy,
> at least because htl used to be completely separate from the upstream
> glibc.
>
> One of the main blockers I see is that the liveness of ss is not
> tied to the liveness of a pthread_t. We should migrate to making
> the ss getting allocated by __pthread_thread_alloc and freed by
> __pthread_thread_terminate, to keep coherency between the two, and
> making sure that we don't leak resources. Notably, if one calls
> _hurd_thread_sigstate on a thread that is terminating and has already
> unregistered itself from the list of threads, _hurd_thread_sigstate will
> allocate a new ss which will never be freed.
>
> Along the path, we should use the thread->nr_refs reference counter in
> functions that manipulate a pthread_t. For instance, in __pthread_kill,
> we want __pthread_getid to take a reference so the thread structure
> stays there, as well as the ss, until we are finished with it.
>
> I have added that as todo on the contributing page.


We can always have Claude take a crack at that, or anything else on the
todo list.

Especially if people don't mind if I post Claude's musings without
reviewing them myself; that's easy!

Just let me know if there's anything you want me to feed to the machine and
we'll see what it comes up with.

    agape
    brent

Reply via email to