Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.waitpid does not return (0,0) when child has not exited (FreeBSD) #71995

Open
CaseyLucas mannequin opened this issue Aug 19, 2016 · 2 comments
Open

os.waitpid does not return (0,0) when child has not exited (FreeBSD) #71995

CaseyLucas mannequin opened this issue Aug 19, 2016 · 2 comments
Labels
OS-freebsd stdlib Python modules in the Lib dir

Comments

@CaseyLucas
Copy link
Mannequin

CaseyLucas mannequin commented Aug 19, 2016

BPO 27808
Nosy @koobs, @iritkatriel
Files
  • waitpid_test.py: test to show invalid waitpid return value
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2016-08-19.23:59:55.148>
    labels = ['library']
    title = 'os.waitpid does not return (0,0) when child has not exited (FreeBSD)'
    updated_at = <Date 2021-06-24.23:46:36.491>
    user = 'https://bugs.python.org/CaseyLucas'

    bugs.python.org fields:

    activity = <Date 2021-06-24.23:46:36.491>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'FreeBSD']
    creation = <Date 2016-08-19.23:59:55.148>
    creator = 'Casey Lucas'
    dependencies = []
    files = ['44161']
    hgrepos = []
    issue_num = 27808
    keywords = []
    message_count = 2.0
    messages = ['273167', '396519']
    nosy_count = 3.0
    nosy_names = ['koobs', 'Casey Lucas', 'iritkatriel']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue27808'
    versions = ['Python 2.7', 'Python 3.4']

    @CaseyLucas
    Copy link
    Mannequin Author

    CaseyLucas mannequin commented Aug 19, 2016

    I'm not sure if this a Python issue or a FreeBSD issue but the return value from os.waitpid is not reliably (0,0) on FreeBSD when the WNOHANG is used and the child process has not yet exited. Python docs say that the return value will be (0,0) but this is not the case. I believe it is because the FreeBSD implementation of waitpid writes an uninitialized value to the status field when a child process is not available. See also: http://stackoverflow.com/questions/38984449/is-status-value-from-os-waitpid-unreliable-when-os-wnohang-is-used-under-freebsd

    Maybe this is just a documentation issue? Or does the C code in the Python library need to handle this case?

    @CaseyLucas CaseyLucas mannequin added the stdlib Python modules in the Lib dir label Aug 19, 2016
    @iritkatriel
    Copy link
    Member

    See also bpo-34278, bpo-38802, bpo-41825.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-freebsd stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants