-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Avoid calling queries during query stack printing #112708
Conversation
I posted a reproducer on Zulip:
This would be automatically tested, if we'd enable the |
For #112522, there's infinite stack recursion (collecting active queries -> running queries to get a query description -> triggers a cycle error -> collecting active queries -> ...). There's probably something similar happening with the Clippy ICE. I have a workaround in #112603. We should probably not OOM on infinite stack recursion though. The compiler uses stacker for unbounded segmented stacks. |
Smaller reproducer: fn main() {
#[deny(while_true)]
while true {}
} rustc foo.rs -Ztreat-err-as-bug |
Thanks I'll add this test to the PR. |
When I add this test, I now get
because of the issue of the double panic that #112333 tried to fix:
Can I add some test flags, that would prevent that from happening? |
Is it because rustc "crashes" inside the test? There are a couple of tests that crash intentionally, for example:
// compile-flags: -Ztreat-err-as-bug
// failure-status: 101
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
// error-pattern: [trigger_delay_span_bug] triggering a delay span bug
// normalize-stderr-test "note: .*\n\n" -> ""
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
// rustc-env:RUST_BACKTRACE=0
#![feature(rustc_attrs)]
#[rustc_error(delay_span_bug_from_inside_query)]
fn main() {} |
No, that's not the issue. I have the same header as this file. The issue is, that rustc crashes, while crashing. So the |
This comment has been minimized.
This comment has been minimized.
f486934
to
68ecff3
Compare
@rustbot review |
Thanks! |
…ce, r=cjgillot Revert "Don't hold the active queries lock while calling `make_query`" This reverts commit fd3d2d4. This has the side effect, that when Clippy should ICE (during an EarlyPass?) it will fill up the RAM with 2 GB/s and then freezes the PC. I don't know the correct solution, but this is blocking the Clippy sync and might give some people really bad experiences, so this should be reverted ASAP. Reverts rust-lang#112333 r? `@cjgillot` cc `@Zoxc` I only commented this on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60try_print_query_stack.60.20has.20.60ImplicitCtx.60.20during.20.60EarlyPass.60/near/363926180). I should've left a comment on the PR as well. My bad.
⌛ Testing commit 68ecff3 with merge 1cc7058e46560a6bb0718104a6f3caad0a5a5d77... |
💥 Test timed out |
4bc718a
to
b0142f6
Compare
Done. I kept it as 2 commits. One for adding the test and one for the fix. Something something TDD 😁 |
@bors r+ |
make_query
"
@bors p=10 |
⌛ Testing commit b0142f6 with merge 9c0609f82bb82d2d0cac50833c54f3788680a029... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (8882507): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 662.942s -> 662.642s (-0.05%) |
This has the side effect, that when Clippy should ICE (during an EarlyPass?) it will fill up the RAM with 2 GB/s and then freezes my Laptop. This is blocking the Clippy sync and might give some people really bad experiences, so this should be merged ASAP.
r? @cjgillot
cc @Zoxc
I only commented this on Zulip. I should've left a comment on the PR as well. My bad.