[Bug 218598] pwait deadlocks on its own pid

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 12 16:23:34 UTC 2017


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

            Bug ID: 218598
           Summary: pwait deadlocks on its own pid
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: dan.mcgregor at usask.ca

Created attachment 181726
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=181726&action=edit
Patch to not wait on our own pid.

pwait will deadlock when passed its own PID. I experienced this when
kern.randompid was set with poudriere. The code was more or less this:

#!/bin/sh
do_the_thing&
pwait $!
do_the_other_thing

if do_the_thing ends before pwait starts, and do_the_thing and pwait get the
same pid, pwait waits indefinitely.

I've attached a patch to warn and exit immediately if pwait is told to wait on
its own pid.

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


More information about the freebsd-bugs mailing list