Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2017 16:23:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 218598] pwait deadlocks on its own pid
Message-ID:  <bug-218598-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218598

            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@FreeBSD.org
          Reporter: dan.mcgregor@usask.ca

Created attachment 181726
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D181726&action=
=3Dedit
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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-218598-8>