When GC'ing a thread, assert that it has no active audit record.

This should not happen, but with this assert, brueffer and I would
not have spent 45 minutes trying to figure out why he wasn't
seeing audit records with the audit version in CVS.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2006-02-05 21:06:09 +00:00
parent 2ca173bc23
commit 6e8525ce84
3 changed files with 14 additions and 1 deletions

View File

@ -172,7 +172,9 @@ thread_dtor(void *mem, int size, void *arg)
/* NOTREACHED */
}
#endif
#ifdef AUDIT
audit_thread_free(td);
#endif
free_unr(tid_unrhdr, td->td_tid);
sched_newthread(td);
}

View File

@ -1025,6 +1025,16 @@ audit_thread_alloc(struct thread *td)
td->td_ar = NULL;
}
/*
* Thread destruction.
*/
void
audit_thread_free(struct thread *td)
{
KASSERT(td->td_ar == NULL, ("audit_thread_free: td_ar != NULL"));
}
/*
* Initialize the audit information for the a process, presumably the first
* process in the system.

View File

@ -180,6 +180,7 @@ void audit_proc_fork(struct proc *parent,
struct proc *child);
void audit_proc_free(struct proc *p);
void audit_thread_alloc(struct thread *td);
void audit_thread_free(struct thread *td);
/*
* Define a macro to wrap the audit_arg_* calls by checking the global