[3.7] bpo-27987: align PyGC_Head to alignof(long double)#13335
Conversation
|
C code: With long double: Without long double: I'm not sure that 12 bytes is great for alignment. 32-bit CPU may be more efficient on SIMD instructions with 8 bytes alignment, no? |
Sorry, something went wrong.
Sorry, something went wrong.
|
PyGC_Head in master branch is two uintptr_t. It is 8 bytes (not 12 bytes) on x86. |
Sorry, something went wrong.
This pull request changes from 12 bytes to 12 or 16 bytes, no? |
Sorry, something went wrong.
|
Sorry @methane, I don't understand this change :-( What is the effect of PyListObject for example? Is the address of ob_item aligned to 16 bytes on x86 (32-bit)? Is it on x86-64 (64 bit)? |
Sorry, something went wrong.
|
@vstinner You wrote: struct {
void *next;
void *prev;
} _gc;But it is actually: struct {
void *next;
void *prev;
ssize_t gc_refs; /* only in Python < 3.8 */
} _gc;This is very big difference between Python 3.7 and 3.8. That's why I closed PR for 3.8 but don't close this. sizeof(PyGC_Head) is 12 byte on x86, regardless alignment is double or long double. (I can now "gcc -m32" on Ubuntu, thank you)
This pull request affects only where |
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I think that I understood the issue and that the fix is correct :-)
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Debian PGO 3.7 has failed when building commit ea2b76b. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/128/builds/1189 Click to see traceback logsFrom https://github.com/python/cpython
* branch 3.7 -> FETCH_HEAD
Reset branch '3.7'
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [clean] Error 1 (ignored)
Segmentation fault
make[3]: *** [pybuilddir.txt] Error 1
make[2]: *** [build_all_generate_profile] Error 2
make[1]: *** [profile-gen-stamp] Error 2
make: *** [profile-run-stamp] Error 2
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make: [clean] Error 1 (ignored) |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Debian PGO 3.7 has failed when building commit ea2b76b. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/128/builds/1190 Click to see traceback logsReset branch '3.7'
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [clean] Error 1 (ignored)
Segmentation fault
make[3]: *** [pybuilddir.txt] Error 1
make[2]: *** [build_all_generate_profile] Error 2
make[1]: *** [profile-gen-stamp] Error 2
make: *** [profile-run-stamp] Error 2
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make: [clean] Error 1 (ignored) |
Sorry, something went wrong.
|
this change needs to be undone. followup on the bug. |
Sorry, something went wrong.
…-13569) This reverts commit ea2b76b. See the bug for discussion. https://bugs.python.org/issue27987
|
Do you think missing "build" directory is happened by this change? I thought it just a trouble on the build bot environment. |
Sorry, something went wrong.
|
The resulting python interpreter was crashing on the the PGO bot and a pile of new undefined behavior was happening on the undefined behavior sanitizer (ubsan) bot. PGO bot: undefined behavior sanitizer millions of times: |
Sorry, something went wrong.
https://bugs.python.org/issue27987