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

A fatal error when running test_ctypes #82308

Closed
ZackerySpytz mannequin opened this issue Sep 12, 2019 · 4 comments
Closed

A fatal error when running test_ctypes #82308

ZackerySpytz mannequin opened this issue Sep 12, 2019 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir topic-ctypes type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@ZackerySpytz
Copy link
Mannequin

ZackerySpytz mannequin commented Sep 12, 2019

BPO 38127
Nosy @benjaminp, @ZackerySpytz, @miss-islington
PRs
  • bpo-38127: PyObject_IsSubclass() should be checked for failure #16011
  • [3.8] closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011) #16019
  • [3.7] closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011) #16020
  • 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 2019-09-12.10:09:35.534>
    created_at = <Date 2019-09-12.03:37:56.204>
    labels = ['3.8', '3.9', 'extension-modules', 'ctypes', '3.7', 'type-crash']
    title = 'A fatal error when running test_ctypes'
    updated_at = <Date 2019-09-12.10:30:57.798>
    user = 'https://github.com/ZackerySpytz'

    bugs.python.org fields:

    activity = <Date 2019-09-12.10:30:57.798>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-09-12.10:09:35.534>
    closer = 'benjamin.peterson'
    components = ['Extension Modules', 'ctypes']
    creation = <Date 2019-09-12.03:37:56.204>
    creator = 'ZackerySpytz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38127
    keywords = ['patch']
    message_count = 4.0
    messages = ['352045', '352087', '352092', '352094']
    nosy_count = 3.0
    nosy_names = ['benjamin.peterson', 'ZackerySpytz', 'miss-islington']
    pr_nums = ['16011', '16019', '16020']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue38127'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @ZackerySpytz
    Copy link
    Mannequin Author

    ZackerySpytz mannequin commented Sep 12, 2019

    When running test_ctypes, I encountered a fatal error.

    ./python -m test test_ctypes
    Run tests sequentially
    0:00:00 load avg: 0.13 [1/1] test_ctypes
    Fatal Python error: a function returned a result with an error set
    MemoryError

    The above exception was the direct cause of the following exception:

    SystemError: <built-in method from_param of _ctypes.PyCPointerType object at 0x55ff17de6e60> returned a result with an error set

    Current thread 0x00007f80d7417140 (most recent call first):
    File "/home/lubuntu2/cpython/Lib/ctypes/test/test_as_parameter.py", line 41 in test_pointers
    File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 616 in _callTestMethod
    File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 659 in run
    File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 719 in __call__
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
    File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
    File "/home/lubuntu2/cpython/Lib/test/support/testresult.py", line 162 in run
    File "/home/lubuntu2/cpython/Lib/test/support/init.py", line 1996 in _run_suite
    File "/home/lubuntu2/cpython/Lib/test/support/init.py", line 2092 in run_unittest
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 209 in _test_module
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 153 in _runtest
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 193 in runtest
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 409 in run_tests_sequential
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 507 in run_tests
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 674 in _main
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 628 in main
    File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 695 in main
    File "/home/lubuntu2/cpython/Lib/test/main.py", line 2 in <module>
    File "/home/lubuntu2/cpython/Lib/runpy.py", line 85 in _run_code
    File "/home/lubuntu2/cpython/Lib/runpy.py", line 192 in _run_module_as_main
    Aborted (core dumped)

    It seems that this is because the PyObject_IsSubclass() call in PyCPointerType_from_param() is not checked for failure.

    @ZackerySpytz ZackerySpytz mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir topic-ctypes type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 12, 2019
    @benjaminp
    Copy link
    Contributor

    New changeset ea683de by Benjamin Peterson (Zackery Spytz) in branch 'master':
    closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
    ea683de

    @miss-islington
    Copy link
    Contributor

    New changeset 79cbaf5 by Miss Islington (bot) in branch '3.8':
    closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
    79cbaf5

    @miss-islington
    Copy link
    Contributor

    New changeset 197ac1a by Miss Islington (bot) in branch '3.7':
    closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
    197ac1a

    @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
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir 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