Add witness warnings to panic if a thread tries to exit while holding any
locks. Requested by: jeff MFC after: 3 days
This commit is contained in:
parent
6064e568ec
commit
83de502d59
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149736
@ -487,6 +487,9 @@ exit1(struct thread *td, int rv)
|
||||
*/
|
||||
cpu_exit(td);
|
||||
|
||||
WITNESS_WARN(WARN_PANIC, &proctree_lock.sx_object,
|
||||
"process (pid %d) exiting", p->p_pid);
|
||||
|
||||
PROC_LOCK(p);
|
||||
PROC_LOCK(p->p_pptr);
|
||||
sx_xunlock(&proctree_lock);
|
||||
|
@ -1313,6 +1313,8 @@ thread_userret(struct thread *td, struct trapframe *frame)
|
||||
PROC_LOCK(p);
|
||||
if (kg->kg_upsleeps)
|
||||
wakeup(&kg->kg_completed);
|
||||
WITNESS_WARN(WARN_PANIC, &p->p_mtx.mtx_object,
|
||||
"thread exiting in userret");
|
||||
mtx_lock_spin(&sched_lock);
|
||||
thread_stopped(p);
|
||||
thread_exit();
|
||||
|
Loading…
Reference in New Issue
Block a user