git: 8321d0da2ce2 - main - kern/kern_thread.c: improve assert in thread_single_end()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Aug 2025 15:07:39 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=8321d0da2ce294d83acc564f2c71fc3a023eb621
commit 8321d0da2ce294d83acc564f2c71fc3a023eb621
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-08-29 20:14:58 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-08-30 15:07:21 +0000
kern/kern_thread.c: improve assert in thread_single_end()
The process might be stopped, which is handled by the loop that
unsuspends threads. But the condition is not tolerated in the assert,
which insists that all threads must be unsuspended always.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52293
---
sys/kern/kern_thread.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 50b040132396..3180c66cb42b 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -1694,8 +1694,10 @@ thread_single_end(struct proc *p, int mode)
thread_unlock(td);
}
}
- KASSERT(mode != SINGLE_BOUNDARY || p->p_boundary_count == 0,
- ("inconsistent boundary count %d", p->p_boundary_count));
+ KASSERT(mode != SINGLE_BOUNDARY || P_SHOULDSTOP(p) ||
+ p->p_boundary_count == 0,
+ ("pid %d proc %p flags %#x inconsistent boundary count %d",
+ p->p_pid, p, p->p_flag, p->p_boundary_count));
PROC_SUNLOCK(p);
wakeup(&p->p_flag);
}