Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve data race in std.Progress.maybeRefresh() #13085

Merged
merged 1 commit into from Oct 11, 2022

Conversation

r00ster91
Copy link
Sponsor Contributor

@r00ster91 r00ster91 commented Oct 6, 2022

It seems we can simply lock the update mutex a little earlier.

Before:

~/Desktop/zig$ zig build -p stage3 -Dsanitize-thread --zig-lib-dir lib
~/Desktop/zig$ stage3/bin/zig run x.zig
AST Lowering [21] zig/number_literal.zig... LLVMSymbolizer: error reading file: No such file or directory
==================
WARNING: ThreadSanitizer: data race (pid=6670)
  Read of size 8 at 0x7ffd5dd43000 by thread T2:
    #0 memcpy <null> (zig+0x1ce7896)

After:

~/Desktop/zig$ zig build -p stage3 -Dsanitize-thread --zig-lib-dir lib
~/Desktop/zig$ stage3/bin/zig run x.zig

Fixes #13072

It seems we can simply lock the update mutex a little earlier.
@Vexu Vexu merged commit 697e22c into ziglang:master Oct 11, 2022
4 checks passed
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.

data race in std.Progress when checking the timer
3 participants