Skip to content

Commit 8321d0d

Browse files
committed
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
1 parent a7aac8c commit 8321d0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sys/kern/kern_thread.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,8 +1694,10 @@ thread_single_end(struct proc *p, int mode)
16941694
thread_unlock(td);
16951695
}
16961696
}
1697-
KASSERT(mode != SINGLE_BOUNDARY || p->p_boundary_count == 0,
1698-
("inconsistent boundary count %d", p->p_boundary_count));
1697+
KASSERT(mode != SINGLE_BOUNDARY || P_SHOULDSTOP(p) ||
1698+
p->p_boundary_count == 0,
1699+
("pid %d proc %p flags %#x inconsistent boundary count %d",
1700+
p->p_pid, p, p->p_flag, p->p_boundary_count));
16991701
PROC_SUNLOCK(p);
17001702
wakeup(&p->p_flag);
17011703
}

0 commit comments

Comments
 (0)