You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An .await inside a std body (std.time.timeout) made every program importing std.time race-checked: stage2 failed with E0921 on the compiler's own globals #2977
While adding pub async fn timeout(d: Duration): sleep(d).await to lib/std/time.w (D188, PR #2971), stage2 (stage1 compiling the compiler, which imports std.time through src/Uat.w) failed with dozens of E0921: read of global … may race on resolve_compiler_root_memo, g_vis_explain_* and others. Rewriting the body as with_fiber_sleep_until(…) (no .await) made them disappear. Concurrency evidence (record_global_concurrency_evidence) is recorded at async blocks/scopes, async function references, @[c_export] and C callback coercions, not at .await, so the path by which an uncalled std body's await turned on program-wide race checking is not yet located. A std body the program never calls must not change what the program is checked for; find the path (lldb on record_global_concurrency_evidence with the timeout body restored) and pin it with a fixture: a program that imports a module whose unused async fn awaits, and holds a plain global, compiles clean.
Fixed in #3064 (merged as 173ef04): concurrency evidence is kept with the function it was found in and counts only where the program reaches it (roots: top level, main, entry/test/bench/panic handlers, @[c_export], trait impl methods; edges: every resolved call and function value). Pinned by test/behavior/behav_2977_unused_async_import_keeps_single_thread_proof.w with lib/lazy_async_sleeper.w.
Activity
#2977, #3052 (D195), #2636, #2978: concurrency evidence by reach, @[s…
ehartford commentedon Nov 7, 2026
Fixed in #3064 (merged as 173ef04): concurrency evidence is kept with the function it was found in and counts only where the program reaches it (roots: top level, main, entry/test/bench/panic handlers, @[c_export], trait impl methods; edges: every resolved call and function value). Pinned by test/behavior/behav_2977_unused_async_import_keeps_single_thread_proof.w with lib/lazy_async_sleeper.w.