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: [email protected]
          Reporter: [email protected]

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.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to