Message340261
| Author |
fweimer |
| Recipients |
fweimer, gregory.p.smith, pablogsal, vstinner |
| Date |
2019年04月15日.11:02:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1555326164.29.0.148220134775.issue36618@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|