Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Closed
Description
Bug report
Bug description:
importctypes# The specific bug is triggered by creating a POINTER type using a string# (which issues a DeprecationWarning) and then using it for argument conversion.BadType=ctypes.POINTER("BugTrigger")# Load standard library (Linux/POSIX specific, matches the crash environment)libc=ctypes.CDLL(None)# Use any standard function (e.g., getpid) to attach argtypesfunc=libc.getpidfunc.argtypes= (BadType,)try:# Calling the function forces ctypes to run PyCPointerType_from_param_impl# on the argument, triggering the "Assertion `typeinfo->proto' failed".func(ctypes.byref(ctypes.c_int(0)))exceptException:pass
python: ../Modules/_ctypes/_ctypes.c:1422: PyObject *PyCPointerType_from_param_impl(PyObject *, PyTypeObject *, PyObject *): Assertion `typeinfo->proto' failed.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done