[Bug 212048] waitpid returns uninitialized status when WNOHANG option is used

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 22 13:55:45 UTC 2016


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

            Bug ID: 212048
           Summary: waitpid returns uninitialized status when WNOHANG
                    option is used
           Product: Base System
           Version: 10.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: caseylucas at gmail.com

When the WNOHANG option is used with waitpid, uninitialized memory is returned
in the 'status' result if no child process is available.  This was first
noticed when the return value from Python os.waitpid was trashed / unreliable.

See 'status' variable in kern_exit.c::sys_wait4

Demonstration of problem:
https://gist.github.com/caseylucas/df2eea85741ea892328c3f8c558cfa75

Stackoverflow reference:
http://stackoverflow.com/questions/38984449/is-status-value-from-os-waitpid-unreliable-when-os-wnohang-is-used-under-freebsd

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


More information about the freebsd-bugs mailing list