Investigate why alignas(8) doesn't always work #36

Closed
opened 2026-01-29 22:24:07 +00:00 by claunia · 2 comments
Owner

Originally created by @dmik on GitHub (Aug 28, 2020).

As Chromium tests show (see https://github.com/bitwiseworks/qtwebengine-chromium-os2/issues/20#issue-686420732), alignas(8) is not always respected by GCC when allocating variables on the stack. Most of the time it works (i.e. variables get stack addresses ending with either 0x0 or 0x8) but occasionally something breaks and variables end up at "odd" addresses ending with 0x4 or 0xC. The Mojo component in Chromium is pretty strict about that and crashes the application on alignment mismatch.

Originally created by @dmik on GitHub (Aug 28, 2020). As Chromium tests show (see https://github.com/bitwiseworks/qtwebengine-chromium-os2/issues/20#issue-686420732), `alignas(8)` is not always respected by GCC when allocating variables on the stack. Most of the time it works (i.e. variables get stack addresses ending with either 0x0 or 0x8) but occasionally something breaks and variables end up at "odd" addresses ending with 0x4 or 0xC. The Mojo component in Chromium is pretty strict about that and crashes the application on alignment mismatch.
Author
Owner

@dmik commented on GitHub (Aug 28, 2020):

Note that I could not reproduce it in a simple test case. The problem can only be observed within the huge Chromium context so far.

@dmik commented on GitHub (Aug 28, 2020): Note that I could not reproduce it in a simple test case. The problem can only be observed within the huge Chromium context so far.
Author
Owner

@dmik commented on GitHub (Jun 30, 2023):

Actually, we already have another ticket for this task, #11. Closing this in favour of that.

@dmik commented on GitHub (Jun 30, 2023): Actually, we already have another ticket for this task, #11. Closing this in favour of that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bitwiseworks/gcc-os2#36