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

block operation on closed socket/pipe for multiprocessing #47561

Closed
vstinner opened this issue Jul 7, 2008 · 4 comments
Closed

block operation on closed socket/pipe for multiprocessing #47561

vstinner opened this issue Jul 7, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

vstinner commented Jul 7, 2008

BPO 3311
Nosy @vstinner
Files
  • multiprocessing_closed.patch: Proposition to fix the bugs
  • 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 = <Date 2010-01-10.00:41:41.395>
    created_at = <Date 2008-07-07.01:18:40.160>
    labels = ['library']
    title = 'block operation on closed socket/pipe for multiprocessing'
    updated_at = <Date 2010-01-10.00:41:51.265>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-01-10.00:41:51.265>
    actor = 'vstinner'
    assignee = 'jnoller'
    closed = True
    closed_date = <Date 2010-01-10.00:41:41.395>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2008-07-07.01:18:40.160>
    creator = 'vstinner'
    dependencies = []
    files = ['10838']
    hgrepos = []
    issue_num = 3311
    keywords = ['patch', 'needs review']
    message_count = 4.0
    messages = ['69365', '80786', '90768', '97482']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'roudkerk', 'jnoller']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3311'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 7, 2008

    _multiprocessing Connection methods don't check if handle is valid or
    not. If you close the socket/pipe, Python may crash on operations,
    especially in poll() on FD_SET(...handle, &rdfs).

    Example of crash:
    ----------------------

    import _multiprocessing
    obj = _multiprocessing.Connection(755)
    obj.close()
    obj.poll()

    Attached patch is a proposition of fix to check handle in all
    Connection methods using the handle.

    @vstinner vstinner added the stdlib Python modules in the Lib dir label Jul 7, 2008
    @jnoller jnoller mannequin self-assigned this Jul 19, 2008
    @vstinner
    Copy link
    Member Author

    This issue is not critical anymore because jesse.noller fixed the
    crash in r68768.

    Python 2.7a0 (trunk:68873M, Jan 23 2009, 08:46:25)
    [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import _multiprocessing
    >>> obj = _multiprocessing.Connection(755)
    >>> obj.close()
    >>> obj.poll()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    IOError: handle out of range in select()

    I would prefer a message "I/O operation on closed socket", but you can
    close this issue.

    Note: I proposed a similar patch to improve the error message ("I/O
    operation on closed socket") for the socket module in issue bpo-4853.

    @vstinner
    Copy link
    Member Author

    ping? The bug is still open and valid.

    @vstinner
    Copy link
    Member Author

    This issue was fixed by r68768 for issue bpo-3321.

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant