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.

Author vstinner
Recipients Michael.Felt, davin, vstinner
Date 2019-05-21.12:22:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558441368.52.0.654854880211.issue35828@roundup.psfhosted.org>
In-reply-to
Content
"""
...

_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 :-(
History
Date User Action Args
2019-05-21 12:22:48vstinnersetrecipients: + vstinner, davin, Michael.Felt
2019-05-21 12:22:48vstinnersetmessageid: <1558441368.52.0.654854880211.issue35828@roundup.psfhosted.org>
2019-05-21 12:22:48vstinnerlinkissue35828 messages
2019-05-21 12:22:48vstinnercreate