Skip to content

fix: -fno-sanitize-recover so sanitizer errors fail the build#24

Merged
RedFox20 merged 1 commit into
masterfrom
fix/ubsan-halt-on-error
Jun 4, 2026
Merged

fix: -fno-sanitize-recover so sanitizer errors fail the build#24
RedFox20 merged 1 commit into
masterfrom
fix/ubsan-halt-on-error

Conversation

@battlesnake
Copy link
Copy Markdown
Collaborator

What

UBSan recovers by default — it prints the error, continues, and exits 0. So a sanitize=undefined build passes green despite real UB. This adds -fno-sanitize-recover (matching the enabled sanitizer set) for gcc/clang, so the first sanitizer error aborts the build.

Verified

mama ubsan build test on a target with a misaligned read:

  • before: runtime error: load of misaligned address … printed, exit 0 (green)
  • after: same error, exit 1 (build fails)

Harmless for address/thread/leak — all accept the flag (tested). One line, mirrors the existing -fsanitize injection just above.

🤖 Generated with Claude Code

UBSan recovers by default (prints the error, continues, exits 0), so a sanitize=undefined build passes
green despite real UB. Add -fno-sanitize-recover (matching the enabled set) for gcc/clang so the first
sanitizer error aborts the build. Verified harmless for address/thread/leak.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RedFox20 RedFox20 merged commit 8e56784 into master Jun 4, 2026
1 check passed
@RedFox20 RedFox20 deleted the fix/ubsan-halt-on-error branch June 4, 2026 11:34
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.

2 participants