[Bug 227041] Kernel cannot fork new process after calling pmc_deatch with pid 0

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Mar 28 23:21:49 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227041

--- Comment #2 from Conrad Meyer <cem at freebsd.org> ---
The situation described sounds like a deadlock or livelock.  If you reproduce
it with an INVARIANTS+WITNESS kernel, do you get a LOR warning?  Does the
pmc-crash program return/complete?

Basic investigation:

The userspace libpmc functions pmc_detach/pmc_release() translate pretty
directly into the (gigantic) kernel syscall pmc_syscall_handler(),
PMC_OP_PMCDETACH and PMC_OP_PMCRELEASE.

If 0 is passed as pid, the current thread's pid is substituted.  pfind()
acquires proc lock after pmc sx xlock.  The proc lock is dropped and then the
process is detached via pmc_detach_process().

Are you sure if pmc_release() is required?  It doesn't look like it does
anything special with locking.  I have not investigated deeply.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list