Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.10] bird2-babelpatch: fix unaligned access on ARMv7 targets #455

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

PolynomialDivision
Copy link
Contributor

An assembler instruction "vst1.8 {d16-d17}, [r0 :64]" requires r0 to be 64-bit (8-byte) aligned. However, in certain cases, r0 was not aligned, leading to a SIGBUS error on ARMv7 platforms:

kern.err kernel: [90636.175853] Alignment trap: not handling
instruction f4400a1f at [<00056fbc>]
kern.alert kernel: [90636.182044] Unhandled fault: alignment
exception (0x801) at 0xb6dec01c

A backtrace shows the crash occurring in bgp_get_prefix due to the misaligned memory address.

Fix this issue by passing the -mno-unaligned-access flag to GCC/Clang. This ensures unaligned accesses are avoided on platforms like ARMv7, preventing alignment-related exceptions and ensuring reliable execution.

(cherry picked from commit fcce390)

An assembler instruction "vst1.8 {d16-d17}, [r0 :64]" requires `r0` to
be 64-bit (8-byte) aligned. However, in certain cases, `r0` was not
aligned, leading to a SIGBUS error on ARMv7 platforms:

    kern.err kernel: [90636.175853] Alignment trap: not handling
    instruction f4400a1f at [<00056fbc>]
    kern.alert kernel: [90636.182044] Unhandled fault: alignment
    exception (0x801) at 0xb6dec01c

A backtrace shows the crash occurring in `bgp_get_prefix` due to the
misaligned memory address.

Fix this issue by passing the `-mno-unaligned-access` flag to GCC/Clang.
This ensures unaligned accesses are avoided on platforms like ARMv7,
preventing alignment-related exceptions and ensuring reliable execution.

(cherry picked from commit fcce390)
@PolynomialDivision PolynomialDivision merged commit c1a0f4c into openwrt-24.10 Dec 5, 2024
7 checks passed
@PolynomialDivision PolynomialDivision deleted the fix-bird-openwrt-24-10 branch December 5, 2024 20:24
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.

1 participant