This test program: #include <stdlib.h> #include <stdio.h> #include <stddef.h> int main(void) { printf("max_align_t alignment: %zu\n", _Alignof(max_align_t)); for (int i = 0; i < 10; ++i) { printf("malloc: %p\n", malloc(1)); } } prints: max_align_t alignment: 16 malloc: 0x23b6010 malloc: 0x23b6018 malloc: 0x23b6020 malloc: 0x23b6028 malloc: 0x23b6030 malloc: 0x23b6038 malloc: 0x23b6040 malloc: 0x23b6048 malloc: 0x23b6050 malloc: 0x23b6058 This means that not all allocations are aligned to 16 bytes, as required by the x86_64 ABI.
Filed upstream: https://github.com/gperftools/gperftools/issues/724
Thanks for passing this upstream. I believe it's totally ok for small allocations (less than 8 bytes) to be aligned to 8 bytes and not 16. Larger allocations are aligned on 16 bytes and this is verified in our unit tests. See my replies on upstream ticket for all details. I have just closed upstream ticket as "working as intended".
I commented upstream: The alignment of the type max_align_t is the alignment supported in all contexts, see 6.2.8(2). This includes memory allocated by malloc. The standard does not have a loophole which says that smaller objects do not need to support larger alignment. On x86_64, _Alignof(max_align_t) is 16. (This is the implementation consensus, max_align_t is younger than the ABI.) Therefore, malloc must return pointers aligned to 16 bytes, even for small allocations.
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle. Changing version to '25'.
This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '25'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 25 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.