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

ICEs should print the top of the query stack #76920

Conversation

hosseind75
Copy link
Contributor

@hosseind75 hosseind75 commented Sep 19, 2020

see #76920

r? @oli-obk

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 19, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Sep 19, 2020

This should affect a ui test, did you --bless?

Also I only now understand your question... Yea we should keep printing the full stack if RUST_BACKTRACE is set

@hosseind75
Copy link
Contributor Author

hosseind75 commented Sep 19, 2020

This should affect a ui test, did you --bless?

Also I only now understand your question... Yea we should keep printing the full stack if RUST_BACKTRACE is set

ahh no sorry I forgot, I will add git hook to run it automatically before every commit

ok I will fix the change about RUST_BACKTRACE

@jyn514
Copy link
Member

jyn514 commented Sep 19, 2020

I think you meant to link to #70953

@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 19, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 19, 2020

ahh no sorry I forgot, I will add git hook to run it automatically before every commit

cc #76356

@hosseind75
Copy link
Contributor Author

ahh no sorry I forgot, I will add git hook to run it automatically before every commit

cc #76356

thanks

@oli-obk
Copy link
Contributor

oli-obk commented Sep 19, 2020

Note that for ui tests you do need a full build, so ./x.py test --bless src/test/ui. You can speed it up with --test-args=the_test_name if you know the test's name that you want to change. Search for const_eval_raw in .stderr files to find the test that your changes will touch

@hosseind75
Copy link
Contributor Author

sorry anyone knows that why the test of gnu-llvm-8 fails?

@@ -1,3 +1,5 @@
query stack during panic:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please filter this out with more filter instructions in the corresponding .rs file, the same with all the other proc macros.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry I did not understand that what should I do
can you please explain more?

Copy link
Contributor

Choose a reason for hiding this comment

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

Did it not disappear after switching the condition?

Copy link
Contributor

Choose a reason for hiding this comment

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

In case it's still there after the change, what I meant was to add more of the regexes like

// normalize-stderr-test "thread.*panicked.*proc_macro_server.rs.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
in order to filter out these two new lines.
Basically I think you can add

// normalize-stderr-test "query stack during panic:\n" -> "" 
// normalize-stderr-test "end of query stack:\n" -> "" 

and these lines should disappear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok got it, thanks, I will fix now

@jyn514
Copy link
Member

jyn514 commented Sep 19, 2020

@hosseind75 it prints what the failures were:

failures:

---- [ui] ui/proc-macro/invalid-punct-ident-2.rs stdout ----
diff of stderr:

-	query stack during panic:
-	we're just showing a limited slice of the query stack
-	end of query stack
4	error: proc macro panicked
5	  --> $DIR/invalid-punct-ident-2.rs:16:1
6	   |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/invalid-punct-ident-2/invalid-punct-ident-2.stderr
 ---- [ui] ui/proc-macro/invalid-punct-ident-3.rs stdout ----
diff of stderr:

-	query stack during panic:
-	we're just showing a limited slice of the query stack
-	end of query stack
4	error: proc macro panicked
5	  --> $DIR/invalid-punct-ident-3.rs:16:1
6	   |


The actual stderr differed from the expected stderr.
 ---- [ui] ui/proc-macro/load-panic-backtrace.rs stdout ----
diff of stderr:

1	at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5
+	query stack during panic:
+	we're just showing a limited slice of the query stack
+	end of query stack
2	error: proc-macro derive panicked
3	  --> $DIR/load-panic-backtrace.rs:17:10
4	   |

@hosseind75
Copy link
Contributor Author

@hosseind75 it prints what the failures were:

failures:

---- [ui] ui/proc-macro/invalid-punct-ident-2.rs stdout ----
diff of stderr:

-	query stack during panic:
-	we're just showing a limited slice of the query stack
-	end of query stack
4	error: proc macro panicked
5	  --> $DIR/invalid-punct-ident-2.rs:16:1
6	   |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/invalid-punct-ident-2/invalid-punct-ident-2.stderr
 ---- [ui] ui/proc-macro/invalid-punct-ident-3.rs stdout ----
diff of stderr:

-	query stack during panic:
-	we're just showing a limited slice of the query stack
-	end of query stack
4	error: proc macro panicked
5	  --> $DIR/invalid-punct-ident-3.rs:16:1
6	   |


The actual stderr differed from the expected stderr.
 ---- [ui] ui/proc-macro/load-panic-backtrace.rs stdout ----
diff of stderr:

1	at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5
+	query stack during panic:
+	we're just showing a limited slice of the query stack
+	end of query stack
2	error: proc-macro derive panicked
3	  --> $DIR/load-panic-backtrace.rs:17:10
4	   |

yeah, I got that what It means now, thanks

@hosseind75
Copy link
Contributor Author

@jyn514 about load-panic-backtrace test, should I add those three lines by comments like other tests?

@hosseind75
Copy link
Contributor Author

guys maybe the problem is because of this issue #59998 right?
I mean about load-panic-backtrace test, I can fix two other failed tests, but about this I see FIXME comment in this file
do you think that it is related to that issue?
@oli-obk @jyn514

@oli-obk
Copy link
Contributor

oli-obk commented Sep 20, 2020

You can also patch https://github.com/rust-lang/rust/blob/master/src/test/ui/proc-macro/load-panic-backtrace.rs to filter out the new messages. Is it not showing up when you run locally?

@hosseind75
Copy link
Contributor Author

hosseind75 commented Sep 20, 2020

no, I ran this test locally but the ICEs messages did not show up In load-panic-backtrace.stderr

@oli-obk
Copy link
Contributor

oli-obk commented Sep 20, 2020

Is the test run at all, or do you get a "skipped" message? Maybe it's skipped on your platform?

@hosseind75
Copy link
Contributor Author

aah yeah, I ran it now and it is ignoring

@jyn514
Copy link
Member

jyn514 commented Sep 26, 2020

I think you can test this with x.py test src/tools/clippy.

@bors
Copy link
Contributor

bors commented Sep 26, 2020

☔ The latest upstream changes (presumably #70743) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@hosseind75
Copy link
Contributor Author

hosseind75 commented Sep 28, 2020

@jyn514 the test failure messages is like the messages that I got when I had automatic x.py check running
is it because of removing that?
I guess I screwed up a little about merging master into this branch right?😞

@oli-obk
Copy link
Contributor

oli-obk commented Sep 29, 2020

@hosseind75 try git rebase -i upstream/master (where upstream is your remote name for github.com/rust-lang/rust) and remove all commits that are not yours. You can also use this to squash all of your commits into a single commit.

@jyn514
Copy link
Member

jyn514 commented Sep 29, 2020

See also rust-lang/rustc-dev-guide#890 which is pretty detailed.

>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
=======
if num_frames == Some(i) {
>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
Copy link
Member

Choose a reason for hiding this comment

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

This is a messed up rebase.

@@ -14,4 +14,4 @@ note: compiler flags: FLAGS
query stack during panic:
#0 [check_match] match-checking `main`
#1 [analysis] running analysis passes on this crate
we're just showing a limited slice of the query stack
we're just showing a limited slice of the query stack
Copy link
Member

Choose a reason for hiding this comment

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

I think this will cause bors to fail again, is there a reason you removed it?

Copy link
Contributor Author

@hosseind75 hosseind75 Oct 3, 2020

Choose a reason for hiding this comment

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

you mean about new line? @jyn514

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, you removed the newline.

@hosseind88
Copy link
Contributor

guys a problem happened for my acount and I forced to create new acount, sorry, I opened a new PR for this issue , it is the link #77493

@oli-obk oli-obk closed this Oct 5, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 15, 2020
…_the_top_of_the_query_stack, r=oli-obk

ICEs should always print the top of the query stack

see rust-lang#76920
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Oct 15, 2020
…_the_top_of_the_query_stack, r=oli-obk

ICEs should always print the top of the query stack

see rust-lang#76920
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Oct 16, 2020
…_the_top_of_the_query_stack, r=oli-obk

ICEs should always print the top of the query stack

see rust-lang#76920
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2020
…_the_top_of_the_query_stack, r=oli-obk

ICEs should always print the top of the query stack

see rust-lang#76920
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants