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

Chaos ensues when cargo miri is run concurrently #2340

Closed
RalfJung opened this issue Jul 6, 2022 · 5 comments
Closed

Chaos ensues when cargo miri is run concurrently #2340

RalfJung opened this issue Jul 6, 2022 · 5 comments
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

RalfJung commented Jul 6, 2022

Two instances of cargo miri running concurrently can lead to the following fun situation:

  • A creates and fills the Xargo.toml.
  • B empties the Xargo toml.
  • A runs xargo.
  • (B fills the Xargo.toml but now it's too late.)

Then we end up building a no-std systroot. oops
We need to either do the Xargo.toml writing atomically via rename or so and hope that xargo itself is fine with the concurrency, or (probably better) have some kind of file system locking.

Thanks to @matthiaskrgr for reporting this.

@RalfJung RalfJung added C-bug Category: This is a bug. A-cargo Area: affects the cargo wrapper (cargo miri) labels Jul 6, 2022
matthiaskrgr added a commit to matthiaskrgr/icemaker that referenced this issue Jul 9, 2022
@RalfJung
Copy link
Member Author

  • Cargo has its own file locking in this file.
  • xargo seems to have a copy of it here.

So I guess we could just have another copy in Miri to resolve this? 😂

Maybe going with an atomic rename is the better strategy after all...

@RalfJung
Copy link
Member Author

Uh, no, I have specifically edited the comment to not indicate that this should be closed...

@RalfJung RalfJung reopened this Jul 19, 2022
@RalfJung
Copy link
Member Author

@matthiaskrgr the latest nightly has a Miri with this fix. Could you give that a try?

@matthiaskrgr
Copy link
Member

running miri in parallel since two hours now and i did not run into problems yet :)

@RalfJung
Copy link
Member Author

Awesome. :) Going to close this as fixed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants