[DragonFlyBSD - Bug #3468] kernel: New threads inherit the pending signals of the thread that created them
tuxillo
bugtracker-admin at leaf.dragonflybsd.org
Tue Nov 10 12:00:24 PST 2026
Issue #3468 has been updated by tuxillo.
File lwpfork01.patch added
Stress test on mono produced :
<pre>
Thread 0x8009bf6c0 may have been prematurely finalized
Thread 0x8009bf6c0 may have been prematurely finalized
* Assertion at mono-threads.c:628, condition `info' not met
</pre>
With dillon's patch it doesn't, so it seems fixed.
----------------------------------------
Bug #3468: kernel: New threads inherit the pending signals of the thread that created them
http://bugs.dragonflybsd.org/issues/3468#change-14952
* Author: tuxillo
* Status: New
* Priority: Normal
* Target version: 6.6
* Start date: 2026-11-10
----------------------------------------
A new thread (LWP) starts with the signals that were pending on the
thread that created it, and so does the first thread of a fork() child.
POSIX says both should start with nothing pending.
lwp_fork1() builds the new lwp by bcopying lwp_startcopy..lwp_endcopy
from the creator, and lwp_siglist is inside that range. Nothing clears it
afterwards.
It shows up with pthread_create(), which blocks all signals around
lwp_create2(). A pthread_kill() to the creating thread in that window
stays pending on it, gets copied into the new thread and is delivered
twice. The attached sigpend.c shows it, the output is in its header.
This is what breaks lang/mono5.20 builds on 6.5. Mono's GC suspends
threads with pthread_kill, the copy runs the suspend handler on a thread
the runtime hasn't registered yet, and it aborts with "Assertion at
mono-threads.c:628, condition `info' not met".
The attached patch clears lwp_siglist right after the bcopy. It builds
(X86_64_GENERIC) but I haven't booted it yet. 6.4 has the same code, so
it should go there too.
---Files--------------------------------
sigpend.c (1.42 KB)
0001-kernel-start-a-new-LWP-with-no-pending-signals.patch (1.77 KB)
lwpfork01.patch (1.26 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list