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: _ctypes.COMError crash
Type: crash Stage:
Components: ctypes Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: theller Nosy List: benjamin.peterson, theller
Priority: release blocker Keywords: patch

Created on 2008-11-26 08:36 by theller, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ctypes.patch theller, 2008-11-26 08:36
Messages (3)
msg76451 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-11-26 08:36
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.
msg76470 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-11-26 15:47
Ok. Looks good.
msg76481 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-11-26 18:55
Thanks for the review; committed as svn rev. 67402.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48683
2008-11-26 18:55:16thellersetstatus: open -> closed
resolution: fixed
messages: + msg76481
keywords: patch, patch
2008-11-26 15:47:30benjamin.petersonsetkeywords: - needs review
nosy: + benjamin.peterson
messages: + msg76470
2008-11-26 08:36:06thellercreate