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

rustup for big refactor; kill most of validation #434

Merged
merged 25 commits into from
Aug 30, 2018
Merged

rustup for big refactor; kill most of validation #434

merged 25 commits into from
Aug 30, 2018

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 16, 2018

Do not force-push, rustc refers to this commit with rust-lang/rust#53424

Fixes #382
Fixes #439

@RalfJung
Copy link
Member Author

Argh, again new new nightly :(

@RalfJung
Copy link
Member Author

This now fixes the compile-fail tests for memory leaks and mutating statics. :) It also gets rid of some hacks that hook some arbitrary functions even though they have MIR... I will probably pay for this by breaking macOS and/or Windows. Let's see.

@RalfJung RalfJung closed this Aug 28, 2018
@RalfJung RalfJung reopened this Aug 28, 2018
@RalfJung
Copy link
Member Author

(Just experimenting with AppVeyor)

@RalfJung
Copy link
Member Author

We finally have a nightly with the refactorings this matches, so I am going to try and make CI pass. Otherwise I think this is ready for review.

@oli-obk do you want be to rebase and maybe squash a little? We ended up backing out the miri updates, so I think none of the commits here is actually ever referenced from rustc.

The only actually functional changes in this PR are:

  • Removing the unconditional hook of "std::sys::unix::thread::guard::init", "std::sys::unix::thread::guard::current" and "std::sys::unix::fast_thread_local::register_dtor". Instead, we can now emulate foreign statics so these functions can actually properly execute.
  • Hook some more pthread_ functions that initialization needs now, and avoid hooking all pthread:* to avoid papering over unimplemented foreign items.
  • Use new mechanism provided by miri engine for handling (mutable) statics.
  • Re-use intrinsics and lang item implementations from CTFE where possible.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 30, 2018

squashing/rebasing seems fine to me, but not necessary

@RalfJung
Copy link
Member Author

Well then I'd say let's get this merged. CI is green. Waiting for your r+ :)

@@ -293,15 +210,15 @@ pub struct Evaluator<'tcx> {
/// Miri does not expose env vars from the host to the emulated program
pub(crate) env_vars: HashMap<Vec<u8>, Pointer>,

/// Places that were suspended by the validation subsystem, and will be recovered later
pub(crate) suspended: HashMap<DynamicLifetime, Vec<ValidationQuery<'tcx>>>,
/// Use the lifetime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lolwat? Are you going to need it again in the future? Or why not just remove it? Too much churn?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean remove the lifetime? Hm, I didn't remember adding it so I just did not touch it.^^ But also indeed I am not sure yet which extra data I will add again for the Stacked Borrows stuff.

@oli-obk oli-obk merged commit 752accf into master Aug 30, 2018
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.

2 participants