New submission from Thomas Heller <[EMAIL PROTECTED]>:

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.

----------
assignee: theller
components: ctypes
files: ctypes.patch
keywords: needs review, patch, patch
messages: 76451
nosy: theller
priority: release blocker
severity: normal
status: open
title: _ctypes.COMError crash
type: crash
versions: Python 3.0
Added file: http://bugs.python.org/file12133/ctypes.patch

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4433>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to