Message340261
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. |
|
Date |
User |
Action |
Args |
2019-04-15 11:02:44 | fweimer | set | recipients:
+ fweimer, gregory.p.smith, vstinner, pablogsal |
2019-04-15 11:02:44 | fweimer | set | messageid: <1555326164.29.0.148220134775.issue36618@roundup.psfhosted.org> |
2019-04-15 11:02:44 | fweimer | link | issue36618 messages |
2019-04-15 11:02:44 | fweimer | create | |
|