Skip to content

Sanitizer (ASan/TSan) coverage gaps in //flare/fiber/... beyond the switch fixes #199

Description

@chen3feng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions