mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-27 11:55:06 +00:00
Check for an exiting process when enabling PID provider probes.
MFC after: 1 week
This commit is contained in:
parent
92b87cdb24
commit
2fce30fa8f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313755
@ -1248,6 +1248,13 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg)
|
||||
#else
|
||||
if ((p = pfind(probe->ftp_pid)) == NULL)
|
||||
return;
|
||||
if ((p->p_flag & P_WEXIT) != 0) {
|
||||
PROC_UNLOCK(p);
|
||||
return;
|
||||
}
|
||||
|
||||
_PHOLD(p);
|
||||
PROC_UNLOCK(p);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1255,13 +1262,6 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg)
|
||||
* the chance to execute the trap instruction we're about to place
|
||||
* in their process's text.
|
||||
*/
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* pfind() returns a locked process.
|
||||
*/
|
||||
_PHOLD(p);
|
||||
PROC_UNLOCK(p);
|
||||
#endif
|
||||
fasttrap_enable_callbacks();
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user