This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: A fatal error when running test_ctypes
Type: crash Stage: resolved
Components: ctypes, Extension Modules Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, benjamin.peterson, miss-islington
Priority: normal Keywords: patch

Created on 2019-09-12 03:37 by ZackerySpytz, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16011 merged ZackerySpytz, 2019-09-12 03:40
PR 16019 merged miss-islington, 2019-09-12 10:09
PR 16020 merged miss-islington, 2019-09-12 10:09
Messages (4)
msg352045 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2019-09-12 03:37
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.
msg352087 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2019-09-12 10:09
New changeset ea683deccc505a78bbbb1eb8c6a88b0835ad5151 by Benjamin Peterson (Zackery Spytz) in branch 'master':
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
https://github.com/python/cpython/commit/ea683deccc505a78bbbb1eb8c6a88b0835ad5151
msg352092 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 10:28
New changeset 79cbaf50ac9530d507149402de5c84fa590d9cfb by Miss Islington (bot) in branch '3.8':
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
https://github.com/python/cpython/commit/79cbaf50ac9530d507149402de5c84fa590d9cfb
msg352094 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 10:30
New changeset 197ac1ad1c03243c647aa9100edbaa16bebbb7e9 by Miss Islington (bot) in branch '3.7':
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
https://github.com/python/cpython/commit/197ac1ad1c03243c647aa9100edbaa16bebbb7e9
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82308
2019-09-12 10:30:57miss-islingtonsetmessages: + msg352094
2019-09-12 10:28:08miss-islingtonsetnosy: + miss-islington
messages: + msg352092
2019-09-12 10:09:54miss-islingtonsetpull_requests: + pull_request15643
2019-09-12 10:09:47miss-islingtonsetpull_requests: + pull_request15642
2019-09-12 10:09:35benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg352087

resolution: fixed
stage: patch review -> resolved
2019-09-12 03:40:10ZackerySpytzsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15637
2019-09-12 03:37:56ZackerySpytzcreate