Skip to content

Enable the memory tools preload on aarch64 - #103

Merged
mjcarroll merged 1 commit into
rollingfrom
clalancette/enable-memory-tools-aarch64
Dec 2, 2026
Merged

mjcarroll merged 1 commit into
rollingfrom
clalancette/enable-memory-tools-aarch64

Conversation

@clalancette

Copy link
Copy Markdown
Contributor

The preload was disabled on aarch64 in 2018 because tests using it died with SIGBUS (#3). The cause was the static allocator handing out unaligned memory during static initialization: glibc performs atomic operations on that memory, and on aarch64 an atomic access to an unaligned address raises SIGBUS (BUS_ADRALN). That was fixed in #31, which aligned all static allocator allocations to max_align_t, but the aarch64 exclusion was never removed.

With the exclusion removed, the osrf_testing_tools_cpp, rcutils and rcl tests pass on a Raspberry Pi 4 with the preload active. Reverting the alignment from #31 brings the SIGBUS back.

Fixes #3

The preload was disabled on aarch64 in 2018 because tests using it died
with SIGBUS (#3). The cause was the static allocator handing out
unaligned memory during static initialization: glibc performs atomic
operations on that memory, and on aarch64 an atomic access to an
unaligned address raises SIGBUS (BUS_ADRALN). That was fixed in #31,
which aligned all static allocator allocations to max_align_t, but the
aarch64 exclusion was never removed.

With the exclusion removed, the osrf_testing_tools_cpp, rcutils and rcl
tests pass on a Raspberry Pi 4 with the preload active. Reverting the
alignment from #31 brings the SIGBUS back.

Fixes #3

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
@clalancette

Copy link
Copy Markdown
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@mjcarroll
mjcarroll merged commit d1db474 into rolling Dec 2, 2026
2 checks passed
@clalancette
clalancette deleted the clalancette/enable-memory-tools-aarch64 branch December 2, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory_tools preload crashes on exit on Linux using aarch64

3 participants