-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve miri's error reporting in check_in_alloc #57128
Comments
Can i please take this up?I am a first timer contributor |
I just forked and cloned rust-lang project on my local but my local branch folder rust/src/librustc/mir/interpret/ is missing pointer.rs and allocation.rs files.The pointer.rs file does contain the check_in_alloc function.It seems i am missing something basic here....my understanding all the code in the current master are uptodate.I clone the current master branch |
@FrankSD sure, you can give it a try. Let's see if we can start by getting Rust to compile on your system :)
What does Also, did you maybe accidentally look into If you are on Linux/macOS, you can always do
|
git log last commit:
And find -name pointer.rs doesnt return anything rank@frank-desktop ~/new-rust/rust $ find -name pointer.rs |
Your compiler is 4 months outdated. Try getting the latest version, it will have the files you are missing. Maybe what happened is that you forked rustc 4 months ago, and then you cloned your fork. Forks don't get updated when the main rsutc repo moves along. You should always clone the main rustc repo, and only push to your fork for creating PRs. |
Thank you@RalfJung....that make sense |
It compiles fine and all the files i can see now....but it fails when trying to install. I have resolved most of the issues but trying to install bootstrap,did fails with :-
|
I have resolved the build issue.I am starting to check the Issue |
Notice also that there is no reason to install your locally built Rust (I never did that, didn't even know it is possible). Why did you even want to do that? |
I was following the official Rust Contribution guide where it mention do |
Could you send me the URL to that? At https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md it doesn't say anything about |
Sorry i think this was from the Readme.md https://github.com/rust-lang/rust/blob/master/README.md |
Oh I see. That's instructions for installing Rust, not for doing development on rustc itself. The CONTRIBUTING.md I linked above is a better place for you to start. |
@RalfJung.........Can you please guide on reproducing this Issue.? |
I am not sure what you are asking. This issue is about refactoring So there's nothing to reproduce. |
Got it.Sorry i am relatively new to rust so i am learning along the way. |
So, do you understand what this issue is about, and what it takes to fix it? |
I do understand what this issue is all about. Correct me if I am wrong, what I understand is: instead of using InboundsCheck type, use &'static str type to report errors. I think one thing I am still trying to understand is how "check_in_alloc function work" specifically when "PointerOutOfBounds" comes into a picture. So before I can touch any code I need to wrap my head around the big picture. As I said I am totally newbie to Rust... actually i am learning alot now. And I am excited to make my first Pull Request ever :). I will appreciate if you can enlighten me along the way. Thanks Sir. |
Yes. :) Here's a somewhat more detailed list of steps to follow for this PR:
I hope this will get you started. Never hesitate to ask! (I will be on a conference for the next 10 days, so I might not be able to reply before I come back. Feel free to ask anyone on Discord or Zulip or IRC as well.) |
Thank you so much@RalfJung |
Thank you for letting me know about Discord and Zulip.......... |
i have fixed most of the errors below is the only error i am still working on......Any idea why i am getting " expected identifier" Error |
Looks like a rebase or search-and-replace gone wrong to me, can you open a PR so we can have a look at the code? |
I dont think a rebase or search and replace gone wrong......... i am simply asking what is the correct rust syntax for ``` --> src/librustc/mir/interpret/pointer.rs:5:32 change? |
That's hard to say without any context. Could you push this somewhere and point us to the right branch?
|
@RalfJung Can I take a shot at this issue? Newbie to rust. |
@FrankSD what is your current status on this? |
Sorry I am working on this..i hv been busy with my current job but I
should submit a pull request shortly
…On Feb 14, 2019 2:17 AM, "Ralf Jung" ***@***.***> wrote:
@FrankSD <https://github.com/FrankSD> what is your current status on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57128 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFXIJCWPSVKIOZ3YyJ_oqhUJqTsXadRnks5vNRt_gaJpZM4ZhsUa>
.
|
Sorry guys i have been so busy with my current work.Can someone please take this on?I have given it a short several times but i keep getting lots of errors on my branch.I would like to see when someone fixes this issue.Thanks for your understanding |
@FrankSD np, don't worry about this, i take it |
|
(I'm traveling, will come back to you next weekend.) |
Ouch. @oli-obk any suggestions? I don't like the overhead of a new enum for this, that makes adding a new usage site very invoncenient.
Indeed the argument is meaningful for |
We can just use |
Hmm... actually we do need to be efficient, since we catch errors. Alternatively we can use a |
…error_reporting_in_check_in_alloc, r=RalfJung Improve miri error reporting in check_in_alloc Fixes rust-lang#57128 r? @RalfJung @oli-obk
The
check_in_alloc
function currently takes aInboundsCheck
for error reporting purposes. That's suboptimal for two reasons: (a) passingInboundsCheck::Live/MaybeDead
sounds like it would affect the check that is performed, but it does not; and (b) the error still doesn't actually say what we tried to do with this pointer (access memory, in-bounds arithmetic, pointer equality test, ...).The
InboundsCheck
argument should be replaced by something else, and that something else should also be put into thePointerOutOfBounds
variant ofEvalErrorKind
. That could either be an&'static str
or a more informative enum. I'd probably start with the string, since it seems unlikely we will want to use this for anything but displaying errors to the user, and it seems okay to not be able to useformat!
.Cc @oli-obk
The text was updated successfully, but these errors were encountered: