[all-commits] [llvm/llvm-project] b05fbd: [compiler-rt][ubsan] Fix ubsan_loop_detect sigacti...
Vy Nguyen via All-commits
all-commits at lists.llvm.org
Wed Sep 23 04:32:59 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b05fbd416a24dd85d7aff18016d47526b27c605f
https://github.com/llvm/llvm-project/commit/b05fbd416a24dd85d7aff18016d47526b27c605f
Author: Vy Nguyen <1762963+oontvoo at users.noreply.github.com>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M compiler-rt/lib/ubsan/CMakeLists.txt
M compiler-rt/lib/ubsan/ubsan_loop_detect.cpp
A compiler-rt/test/ubsan/TestCases/Misc/Posix/trap_loop_detect.cpp
Log Message:
-----------
[compiler-rt][ubsan] Fix ubsan_loop_detect sigaction setup and dynamic symbol list (#225495)
`__ubsan_install_trap_loop_detection` passed an un-initted ` sigaction`
to `sigaction(SIGPROF, ...)`, with garbage in `sa_flags` and `sa_mask`
(such as setting `SA_RESETHAND`, blocking `SIGILL`, and omitting
`SA_SIGINFO`).
This PR fixes it by zero-initialising sigaction
Two other drive-by cleanups:
- set `SA_SIGINFO | SA_RESTART` because ITIMER_PROF fires SIGPROF
periodically. Without SA_RESTART, any blocking syscall (read, write,
waitpid, etc.) interrupted by a periodic SIGPROF tick would spuriously
fail with EINTR instead of transparently resuming after SigprofHandler
returns.
- pass `EXTRA ubsan.syms.extra` to
`add_sanitizer_rt_symbols(clang_rt.ubsan_loop_detect ...)` in
`CMakeLists.txt` so `libclang_rt.ubsan_loop_detect.a.syms` is not
generated as an empty `{ };` dynamic list (which causes a syntax error
with GNU `ld.bfd`).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list