[issue45941] help("modules") segfaults on 3.11

Irit Katriel report at bugs.python.org
Tue Nov 30 17:46:12 EST 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

On the debugger: 

>>> help("modules")

Please wait a moment while I gather a list of all available modules...

/Users/iritkatriel/src/cpython/Lib/pkgutil.py:92: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  __import__(info.name)
/Users/iritkatriel/src/cpython/Lib/pkgutil.py:92: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
  __import__(info.name)
test_sqlite3: testing with version '2.6.0', sqlite_version '3.32.3'
/Users/iritkatriel/src/cpython/Lib/distutils/command/build_ext.py:13: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  from distutils.sysconfig import customize_compiler, get_python_version
Process 88596 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100160046 python.exe`_PyObject_GenericGetAttrWithDict(obj=0x0000000106acfa50, name=0x0000000100fe91c0, dict=0x0000000000000000, suppress=0) at object.c:1305:17
   1302	        PyDictValues **values_ptr = _PyObject_ValuesPointer(obj);
   1303	        if (values_ptr && *values_ptr) {
   1304	            if (PyUnicode_CheckExact(name)) {
-> 1305	                assert(*_PyObject_DictPointer(obj) == NULL);
   1306	                res = _PyObject_GetInstanceAttribute(obj, *values_ptr, name);
   1307	                if (res != NULL) {
   1308	                    goto done;
Target 0: (python.exe) stopped.
(lldb) p _PyObject_Dump(name)
object address  : 0x100fe91c0
object refcount : 165
object type     : 0x10051aec0
object type name: str
object repr     : 'string'
(lldb) p _PyObject_Dump(*_PyObject_DictPointer(obj))
error: Execution was interrupted, reason: Attempted to dereference an invalid pointer..
The process has been returned to the state before expression evaluation.
(lldb) p _PyObject_Dump(obj)
object address  : 0x106acfa50
object refcount : 7
object type     : 0x105add590
object type name: _cffi_backend.FFI
object repr     : <_cffi_backend.FFI object at 0x106acfa50>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________


More information about the Python-bugs-list mailing list