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

_ctypes.COMError crash #48683

Closed
theller opened this issue Nov 26, 2008 · 3 comments
Closed

_ctypes.COMError crash #48683

theller opened this issue Nov 26, 2008 · 3 comments
Assignees
Labels
release-blocker topic-ctypes type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@theller
Copy link

theller commented Nov 26, 2008

BPO 4433
Nosy @theller, @benjaminp
Files
  • ctypes.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 = 'https://github.com/theller'
    closed_at = <Date 2008-11-26.18:55:16.446>
    created_at = <Date 2008-11-26.08:36:06.095>
    labels = ['ctypes', 'type-crash', 'release-blocker']
    title = '_ctypes.COMError crash'
    updated_at = <Date 2008-11-26.18:55:16.445>
    user = 'https://github.com/theller'

    bugs.python.org fields:

    activity = <Date 2008-11-26.18:55:16.445>
    actor = 'theller'
    assignee = 'theller'
    closed = True
    closed_date = <Date 2008-11-26.18:55:16.446>
    closer = 'theller'
    components = ['ctypes']
    creation = <Date 2008-11-26.08:36:06.095>
    creator = 'theller'
    dependencies = []
    files = ['12133']
    hgrepos = []
    issue_num = 4433
    keywords = ['patch']
    message_count = 3.0
    messages = ['76451', '76470', '76481']
    nosy_count = 2.0
    nosy_names = ['theller', 'benjamin.peterson']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue4433'
    versions = ['Python 3.0']

    @theller
    Copy link
    Author

    theller commented Nov 26, 2008

    The following code, which only works on Windows, crashes with an access
    violation somewhere in the garbage collector in a debug build:

    >>> import _ctypes
    [43470 refs]
    >>> _ctypes.COMError(1, 2, 3)

    The problem is that the PyComError_Type's tp_flags contains
    Py_TPFLAGS_HAVE_GC although the tp_traverse slot is NULL.

    The attached patch removes the Py_TPFLAGS_HAVE_GC which is not necessary
    at all because a PyComError_Type instance (normally) only contains
    simple objects (strings, numbers, None, and a tuple of strings, numbers,
    and None), so no reference cycles should be possible.

    @theller theller self-assigned this Nov 26, 2008
    @theller theller added topic-ctypes type-crash A hard crash of the interpreter, possibly with a core dump labels Nov 26, 2008
    @benjaminp
    Copy link
    Contributor

    Ok. Looks good.

    @theller
    Copy link
    Author

    theller commented Nov 26, 2008

    Thanks for the review; committed as svn rev. 67402.

    @theller theller closed this as completed Nov 26, 2008
    @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
    release-blocker topic-ctypes type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants