STINNER Victor <vstin...@redhat.com> added the comment:

"""
...

_PyObject_FastCallDict(callable = (nil), args = 0x2008bf70, nargs = 540036208, 
kwargs = 0x0000014d), line 100 in "call.c"

object_vacall(callable = 0x100de658, vargs = warning: Unable to access address 
0xdbdbdbdb from core
(invalid char ptr (0xdbdbdbdb))), line 1200 in "call.c"

_PyObject_CallMethodIdObjArgs(obj = 0x30061db0, name = 0x20039710, ... = 
0x304e9fa8, 0x3003a7a0, 0x0, 0x4deb7, 0xcb, 0x306aee88), line 1250 in "call.c"

import_find_and_load(abs_name = 0x3097abf8), line 1652 in "import.c"

...
"""

Extract of _PyObject_CallMethodIdObjArgs:

PyObject *
_PyObject_CallMethodIdObjArgs(PyObject *obj,
                              struct _Py_Identifier *name, ...)
{
    va_list vargs;
    PyObject *callable, *result;

    if (obj == NULL || name == NULL) {
        return null_error();
    }

    callable = _PyObject_GetAttrId(obj, name);
    if (callable == NULL) {
        return NULL;
    }

    va_start(vargs, name);
    result = object_vacall(callable, vargs);
    va_end(vargs);

    Py_DECREF(callable);
    return result;
}

I don't know how va_list and va_start are implemented in XLC, but 0xDBDBDBDB 
looks like the byte pattern for released memory in Python: you can now use 
_PyMem_IsPtrFreed() function from pycore_pymem.h to check if a pointer looks 
like "freed":

static inline int _PyMem_IsPtrFreed(void *ptr)
{
    uintptr_t value = (uintptr_t)ptr;
#if SIZEOF_VOID_P == 8
    return (value == (uintptr_t)0xCDCDCDCDCDCDCDCD
            || value == (uintptr_t)0xDDDDDDDDDDDDDDDD
            || value == (uintptr_t)0xFDFDFDFDFDFDFDFD);
#elif SIZEOF_VOID_P == 4
    return (value == (uintptr_t)0xCDCDCDCD
            || value == (uintptr_t)0xDDDDDDDD
            || value == (uintptr_t)0xFDFDFDFD);
#else
#  error "unknown pointer size"
#endif
}

Maybe modify object_vacall() to add "assert(!_PyMem_IsPtrFreed(vargs));". You 
may need #include "pycore_pymem.h".

Good luck with debug :-(

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35828>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to