Sanitizer (ASan/TSan) coverage gaps in //flare/fiber/... beyond the switch fixes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Description
Surfaced while adding the ASan/TSan fiber CI lane (#198). The fiber-switch SEGVs are fixed (#196 ASan, #197 TSan) and a curated set of fiber tests now runs green under both sanitizers. Running the full //flare/fiber/... under sanitizers, however, reveals separate pre-existing issues that #198 intentionally left out of scope (so the lane stays green). Tracking them here.
Environment: Bazel + clang, --config=asan / --config=tsan (see .bazelrc). Observed on clang-17; the annotation.h TSan-header build break is already fixed in #198.
1. curl fails to build under -fsanitize
curl (foreign_cc / autotools subbuild) fails when the sanitizer flags are propagated into its build:
ERROR: .../external/com_github_curl_curl/BUILD.bazel: Foreign Cc - Configure: Building curl failed
==NNN==ERROR: AddressSanitizer: use-after-poison ...
Consequence: every fiber target that transitively depends on curl fails to build under ASan/TSan, e.g. execution_context_test, execution_context_benchmark, fiber_local_benchmark, logging_test. Likely needs the sanitizer copts excluded from foreign_cc external builds (curl isn't what we're testing).
2. Test failures under sanitizers
These build fine but fail when run under sanitizers (need investigation — could be real data races / UB, or test-harness issues):
| test | ASan | TSan |
|---|---|---|
//flare/fiber:latch_test |
FAILED | (pass) |
//flare/fiber/detail:scheduling_group_test |
FAILED | FAILED |
//flare/fiber/detail:waitable_test |
FAILED | TIMEOUT |
3. Tests too slow / timing out under TSan
Under TSan's slowdown on shared runners, some tests exceed even a raised timeout: //flare/fiber:fiber_test, //flare/fiber/detail:run_queue_test (and fiber_worker_test is ~5 min). These are excluded from the CI lane for now; they'd need a larger timeout and/or to be made lighter.
Why not in the CI lane
The #198 sanitizer_fiber job runs a curated subset that passes cleanly under both sanitizers — enough to guard the switch fixes (a regressed switch crashes every fiber test on first resume). Expanding it to the full suite requires resolving the above first.
🤖 Generated with Claude Code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sanitizer configurations in .bazelrc and reproduce the full //flare/fiber/... run under --config=asan and --config=tsan. Inspect the curl foreign_cc build failure and the named latch_test, scheduling_group_test, waitable_test, fiber_test, run_queue_test, and fiber_worker_test targets. Done means the sanitizer failures and timeouts are understood and resolved or appropriately handled so the full suite can be considered for the CI lane.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, performance, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100