Message274688
| Author |
benjamin.peterson |
| Recipients |
benjamin.peterson |
| Date |
2016年09月07日.00:17:00 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1473207430.19.0.578630759123.issue27987@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
ubsan complains about unaligned access when structs include "long double". An example error:
runtime error: member access within misaligned address 0x7f77dbba9798 for type 'struct CDataObject', which requires 16 byte alignment
This is because (on x86 anyway), long double is 16-bytes long and requires that alignment, but obmalloc only gives a 8-byte alignment. (glibc malloc() gives 16-byte alignment.)
I'm attaching a POC patch. I don't know what the impact of increasing the alignment is on obmalloc's performance or memory usage. It's also unfortunate that this patch increases the size of PyGC_Head to 32 bytes from 24 bytes. One can imagine a more middle-ground solution to this by allowing types to specify their required alignment. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年09月07日 00:17:10 | benjamin.peterson | set | recipients:
+ benjamin.peterson |
| 2016年09月07日 00:17:10 | benjamin.peterson | set | messageid: <1473207430.19.0.578630759123.issue27987@psf.upfronthosting.co.za> |
| 2016年09月07日 00:17:09 | benjamin.peterson | link | issue27987 messages |
| 2016年09月07日 00:17:06 | benjamin.peterson | create |
|