Florian Weimer <fwei...@redhat.com> added the comment:

The issue is related to the definition of PyCArgObject:

typedef struct tagPyCArgObject PyCArgObject;

struct tagPyCArgObject {
    PyObject_HEAD
    ffi_type *pffi_type;
    char tag;
    union {
        char c;
        char b;
        short h;
        int i;
        long l;
        long long q;
        long double D;
        double d;
        float f;
        void *p;
    } value;
    PyObject *obj;
    Py_ssize_t size; /* for the 'V' tag */
};

This object must be allocated with suitable alignment (which is 16 on many 
platforms), and the default Python allocator apparently provides 8-byte 
alignment only on 64-bit platforms.  In short, using PyObject_New with 
PyCArgObject results in undefined behavior.

This issue potentially affects all compilers, not just Clang.

----------

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

Reply via email to