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

Fix for #876637 - Random stack corruption from socketmodule #40377

Closed
troels mannequin opened this issue Jun 10, 2004 · 5 comments
Closed

Fix for #876637 - Random stack corruption from socketmodule #40377

troels mannequin opened this issue Jun 10, 2004 · 5 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@troels
Copy link
Mannequin

troels mannequin commented Jun 10, 2004

BPO 970288
Nosy @loewis, @devdanzin
Dependencies
  • bpo-876637: Random stack corruption from socketmodule.c
  • Files
  • socketmodule_timeout_using_poll.patch
  • 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 2009-02-14.13:57:08.389>
    created_at = <Date 2004-06-10.11:13:59.000>
    labels = ['extension-modules', 'type-bug']
    title = 'Fix for python/cpython#39819 - Random stack corruption from socketmodule'
    updated_at = <Date 2009-02-14.13:57:08.377>
    user = 'https://bugs.python.org/troels'

    bugs.python.org fields:

    activity = <Date 2009-02-14.13:57:08.377>
    actor = 'ajaksu2'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-02-14.13:57:08.389>
    closer = 'ajaksu2'
    components = ['Extension Modules']
    creation = <Date 2004-06-10.11:13:59.000>
    creator = 'troels'
    dependencies = ['876637']
    files = ['6027']
    hgrepos = []
    issue_num = 970288
    keywords = ['patch']
    message_count = 5.0
    messages = ['46164', '46165', '46166', '46167', '82055']
    nosy_count = 5.0
    nosy_names = ['loewis', 'nnorwitz', 'troels', 'ajaksu2', 'vila']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue970288'
    versions = ['Python 2.4']

    @troels
    Copy link
    Mannequin Author

    troels mannequin commented Jun 10, 2004

    Here's a patch to convert socketmodule to use poll()
    for the timeout handling.

    ifdefs and includes have been copied from selectmodule,
    so I believe they should be correct for all platforms.

    Compiled and tested on Linux (RH73).

    @troels troels mannequin added extension-modules C modules in the Modules dir labels Jun 10, 2004
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 22, 2004

    Logged In: YES
    user_id=21627

    While the patch is good as it stands, it is also incomplete:
    If poll(2) is not available, it might still overrun the
    FD_SETSIZE. I think there should be another return value
    from internal_select (-1), indicating an internal error. A
    Python RuntimeError should be set in this case. Callers
    should check for -1, and return immediately.

    Are you willing to extend the patch in that direction?

    @troels
    Copy link
    Mannequin Author

    troels mannequin commented Aug 26, 2004

    Logged In: YES
    user_id=32863

    You're right, however I think that it is a very minor
    problem compared to the current situation. All major UNIX
    platforms support poll(2) in my experience. The only
    important Python platform without poll is Windows, and it
    doesn't have the FD_SETSIZE problem.

    Thus I think the patch should be applied as it stands, but
    the original bug ticket can be left open for another
    enterprising individual to make the changes you suggest.

    I'm afraid that work commitments prevent me from being that
    individual for the foreseeable future...

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Feb 7, 2006

    Logged In: YES
    user_id=33168

    A fix for the bug (sd over FD_SETSIZE) has been checked in.
    Note select is called in Modules/_ssl.c too.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Feb 14, 2009

    Fixed in revision 42253.

    @devdanzin devdanzin mannequin closed this as completed Feb 14, 2009
    @devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Feb 14, 2009
    @devdanzin devdanzin mannequin closed this as completed Feb 14, 2009
    @devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Feb 14, 2009
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants