-
Notifications
You must be signed in to change notification settings - Fork 13k
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
miri
no longer builds after rust-lang/rust#66547
#66862
Comments
This test is failing: https://github.com/rust-lang/miri/blob/3bf51f591f7ffdd45f51cd1d42a4002482af2bd5/tests/run-pass/args.rs normalized stdout:
expected stdout:
args
diff of stdout:
-args
- |
rust-lang/miri#624 might give a hint what needs to be updated. I haven't gotten a chance to look closely yet. |
Yeah, we'll need to emulate that new static thing added by #66547. Unfortunately I don't entirely understand the static magic that goes on there... there's just a fn ptr stored in a particular section and somehow that is enough?!? |
Yes, all platforms have sections that they treat as an array of So I guess there's two levels to this:
|
Okay. This is basically rust-lang/miri#450. I hoped we'd never have to do this... For dtors, we already run TLS dtors, but those are entirely separate (we hook the pthread calls where dtors are set, and then run those functions later). There's no way those can be unified to one mechanism, is there? Also, this begs the question in which order stuff is called before/after main. |
C++ asks itself the same question and I personally haven't heard of there being an answer. The safe thing to do is to make sure any order is safe (in Rust you have to initialize global state before any runtime initialization, so it's safer than C++ where before the constructor runs, the fields are uninitialized). The implementations just go through the sections in order, so the unknown quantity is what order the linker concatenates all of these sections. |
Wait, why can't libstd initialize the args from the start lang item as well? Surely there's an inexpensive way to do so? |
@eddyb That's what I did originally, but @joshtriplett said not to. |
Reverting d448ab0 should fix this. |
We could either adjust the
What would be the best way to do that? |
@RalfJung In the short term, excluding
That depends on two factors: what order functions get placed into the sections, and what order they get called.
Does that help? |
It is a great reference, thanks! So far I have no idea how to wire up all these sections in Miri, but I guess we'll see about that. ;) On a separate note, #66697 also broke Miri by removing the |
I don't see any way to actually do that. |
@eddyb I would prefer to avoid duplicate initialization of arguments. I'd like to make Rust executables smaller, not larger. |
I agree, I would accept this change. |
I opened a PR for that: #66873 |
Done. I set it to close this issue since we already have rust-lang/miri#450 to track the more elaborate approach. |
Well, actually closing the issue will require also bumping the submodule to include rust-lang/miri#1085. |
I don't understand, this would only be a few bytes with
To unbreak miri it's probably fine but I'm increasingly worried about |
@RalfJung I was talking about a user of these facilities, not miri implementation. |
Ack. |
Aand now we also need to wait for #66896 to land. That's the third independent Miri-breaking PR in 24h, impressive. ;) |
Hello, this is your friendly neighborhood mergebot.
After merging PR #66547, I observed that the tool miri has failing tests.
A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout.
cc @leo60228, do you think you would have time to do the follow-up work?
If so, that would be great!
cc @dtolnay, the PR reviewer, and nominating for compiler team prioritization.
The text was updated successfully, but these errors were encountered: