[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor
STINNER Victor added the comment: Python 3.8 now respects the x86-64 ABI: https://bugs.python.org/issue27987 I reverted my workaround. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset d97adfb409290a1e4ad549e4af58cacea86d3358 by Victor Stinner in branch 'master': bpo-36618: Don't add -fmax-type-align=8 flag for clang (GH-13320) https://github.com/python/cpython/commit/d97adfb409290a1e4ad549e4af58cacea86d3358 --

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13231 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-16 Thread serge-sans-paille
serge-sans-paille added the comment: @vstinner: once you have a portable version of alignof, you can deciding to *not* use the pool allocator if the required alignment is greater than 8B, or you could modify the pool allocator to take alignment information as an extra parameter? --

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: More info on alignof(): http://www.wambold.com/Martin/writings/alignof.html -- ___ Python tracker ___

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: I also found this macro: #define ALIGNOF(type) offsetof (struct { char c; type member; }, member) -- ___ Python tracker ___

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: C++ has a __alignof__ function/macro/operator (not sure what is its kind) to get the alignment of a type. C11 has header which provides an alignof() function. GCC has __alignof__(). I also found "_Alignof()" name. ... no sure which one is the most

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread Florian Weimer
Florian Weimer 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;

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread Florian Weimer
Change by Florian Weimer : -- nosy: +fweimer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: > It should not block us from going forward with a workaround like your PRs for > now. I pushed a fix quickly to unblock my PR 12796, but also because I was very scared by what I saw :-D I see my change as a "quick fix", but we really have to sit down to

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: New changeset a304b136adda3575898d8b5debedcd48d5072272 by Victor Stinner in branch 'master': bpo-36618: Don't add -fmax-type-align flag to old clang (GH-12811) https://github.com/python/cpython/commit/a304b136adda3575898d8b5debedcd48d5072272 --

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread Gregory P. Smith
Gregory P. Smith added the comment: I believe -fno-max-type-align is also an option. -- ___ Python tracker ___ ___

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread Gregory P. Smith
Gregory P. Smith added the comment: Even if you check for -fmax-type-align compiler support at configure time, there is a potential problem: Nothing guarantees that extension modules are built by the same compiler that CPython is. If CPython used an old clang without support for that flag

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: See also: * bpo-27987: obmalloc's 8-byte alignment causes undefined behavior * bpo-18835: Add PyMem_AlignedAlloc() * bpo-31912: PyMem_Malloc() should guarantee alignof(max_align_t) -- ___ Python tracker

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12736 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: Oh, it seems like the change broke the FreeBSD 10 buildbot :-( https://buildbot.python.org/all/#/builders/167/builds/769 ... checking for makedev... no checking for le64toh... no checking for mode_t... no checking for off_t... no checking for pid_t... no

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: Note to myself: "Sadly, the flag must be expected to CFLAGS and not just CFLAGS_NODIST, ..." It should be "Sadly, the flag must be *set* to CFLAGS and not just CFLAGS_NODIST, ..." :-( I should fix the NEWS entry. --

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: I merged a "workaround" in the master branch. Python 2.7 and 3.7 are also affected, but I prefer to wait to see if the change goes through buildbots. The real fix would be to modify pymalloc to use 16-byte alignement, but that's a more complex issue :-)

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
STINNER Victor added the comment: New changeset 23a683adf803eef405d248cc9c2a7eb08a7300e2 by Victor Stinner in branch 'master': bpo-36618: Add -fmax-type-align=8 flag for clang (GH-12809) https://github.com/python/cpython/commit/23a683adf803eef405d248cc9c2a7eb08a7300e2 --

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +12735 stage: -> patch review ___ Python tracker ___ ___

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor
New submission from STINNER Victor : On x86-64, clang -O3 compiles the following function: PyCArgObject * PyCArgObject_new(void) { PyCArgObject *p; p = PyObject_New(PyCArgObject, _Type); if (p == NULL) return NULL; p->pffi_type = NULL; p->tag = '\0'; p->obj =