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

Add support for SpanTrace capture in ICE reports #103993

Closed
wants to merge 1 commit into from

Conversation

yaahc
Copy link
Member

@yaahc yaahc commented Nov 4, 2022

This change results in output similar to this gist: https://gist.github.com/yaahc/db2dca7b34c499ab15d721a518b2f2b2

r? oli-obk

@yaahc yaahc requested a review from oli-obk November 4, 2022 23:55
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 4, 2022
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

We have a bunch of tests that show query backtraces on ICE (to find them, likely just grep for query in .stderr files). We could make one of them emit spantraces, too (and filter out any line/col info so it doesn't cause churn)

Ok(env) => EnvFilter::new(env),
_ => EnvFilter::default().add_directive(Directive::from(LevelFilter::WARN)),
};

let error_filter = match env::var(ice_env) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should just enable all levels by default for the spantrace. if people see it as a problem we can always offer ways to reduce it. My use case would always unconditionally enable trace spans for ICEs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was just worried about causing perf issues, but that seems easy enough to test

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, so I tried this a while back and ran into some errors and ended up putting it down. Picked it back up, rebased, dealt with merge conflicts and got it working again and looked at the error in some more detail with @jyn514 and we came to the conclusion that it seems like it's a pre-existing error that I'm triggering but not causing. Jyn felt like they recall encountering the same error in the past.

I want to do some more testing to verify this theory and see if I can repro the issue without having tracing_error installed by enabling TRACE capture on all spans with a custom registry layer. I recall testing this in november and it works at trace level when reporting errors during compilation of other crates, it's only when it's compiling itself with trace enabled on spans that it's running into a panic from a diagnostic not being emitted in time.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, then let's land it as is, so we can debug it on master.

Comment on lines 258 to 277
"windows-sys",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I don't understand where these deps came from. I'm pretty sure there's gotta be some pebkac going on rn but I don't get how these produced an error how, they appear to have already been part of the Cargo.toml

Gonna try removing...

Copy link
Member

Choose a reason for hiding this comment

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

parking_lot 0.12 now depends on windows-sys. Note that this list here is only for dependencies of the standard library and rustc, not for other tools despite the fact that those use the same lockfile.

@rust-log-analyzer

This comment has been minimized.


let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
let subscriber = tracing_subscriber::Registry::default()
.with(error_layer.with_filter(error_filter))
Copy link
Contributor

Choose a reason for hiding this comment

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

this layer seems to be affecting the log layer. Not sure what's going on.

Copy link
Member Author

@yaahc yaahc Nov 9, 2022

Choose a reason for hiding this comment

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

they interact with the same strings in the registry in the background, some of the code ended up being shared, so that may be causing it. I can try reversing their order so the log layer gets applied first and see how that affects things.

https://github.com/tokio-rs/tracing/blob/master/tracing-error/src/subscriber.rs#L52-L59

@bors
Copy link
Contributor

bors commented Nov 19, 2022

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

@oli-obk
Copy link
Contributor

oli-obk commented Dec 8, 2022

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2022
@rustbot rustbot removed the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 18, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 13, 2023

Some tests need blessing, but the actually failing ones look like a tracing-tree bug. I'll try to repro it standalone over there

@@ -1,6 +1,7 @@
// edition:2021
// known-bug: unknown
// unset-rustc-env:RUST_BACKTRACE
// rustc-env:RUSTC_ICE_LOG=trace
Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to see one that actually captured some SpanTrace output just to make sure it's working and i understood why the other ones are empty.

I'm going to add some logic to skip adding the "SpanTrace:\n" bit if the SpanTrace itself is empty. I'm also wondering if I should add some cfg directives to set the RUSTC_ICE_LOG level to trace when we're not building rustc itself but I need to investigate how that would work.

Copy link
Member Author

@yaahc yaahc Mar 16, 2023

Choose a reason for hiding this comment

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

This test suddenly started failing after rebasing on master and I do not yet know why

I tried building latest master to see if it was a bug that just happened to get through and it failed two entirely unrelated tests instead...

Ok(env) => tracing::Level::from_str(&env).unwrap(),
_ => tracing::Level::WARN,
};
#[cfg(not(bootstrap))]
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried doing some shortcuts to see if I could make it work the way I want prior to figuring our the right solution. This attempts to work around the issue with compiling the stage1 compiler with RUSTC_ICE_LOG=TRACE by only setting that default for the resulting stage1 binary, which would then compile the tests with that as the default level and produce nice SpanTraces in the tests below.

It didn't work. I'm investigating now.

@@ -638,6 +638,7 @@ impl Session {
|| self.opts.unstable_opts.unpretty.is_some()
|| self.opts.output_types.contains_key(&OutputType::Mir)
|| std::env::var_os("RUSTC_LOG").is_some()
|| std::env::var_os("RUSTC_ICE_LOG").is_some()
Copy link
Member Author

Choose a reason for hiding this comment

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

@jyn514 identified the issue with defaulting the log level to TRACE as likely related to (and worked around by) this bit of logic. I don't know if we will want the default output to start to include SpanTraces or not but I'm leaning towards defaulting them to off for now. We can always bump Span levels up to WARN if they're super relevant and we want them to show up all the time.

This way we can leave actually increasing the usage of this functionality to later PRs where it can be based on more practical usage experience.

@bors
Copy link
Contributor

bors commented Mar 14, 2023

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

let me push damnit!

we meet again rustfmt

enable trace by default

checkpoint while figuring out this damn rebase

reduce log level to avoid bugs in logging

remove accidentally readded fn

remove unused deps

bless these initially, deal with actual output next

add example with spantrace output

try to hack around the issue to get nice output

with proper spantrace output

add helper message for spantrace
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-14 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v3' (SHA:24cb9080177205b6e8c946b17badbe402adc938f)
Download action repository 'rust-lang/simpleinfra@master' (SHA:3fb2b44a4eaebb9ed8086446bde46c27199ef5ed)
Complete job name: PR (x86_64-gnu-llvm-14, false, ubuntu-20.04-xl)
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  CI_JOB_NAME: x86_64-gnu-llvm-14
---
---- [ui] tests/ui/attributes/log-backtrace.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: RUSTC_LOG="info" RUSTC_LOG_BACKTRACE="rustc_metadata::creader" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/attributes/log-backtrace.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/log-backtrace/a" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/log-backtrace/auxiliary"
stdout: none
--- stderr -------------------------------
thread 'rustc' panicked at 'Unable to get span scope; this is a bug', /cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-tree-0.2.0/src/lib.rs:311:18
stack backtrace:
   0:     0x7f4a76e9caf5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdd4aa28f337f523e
   1:     0x7f4a76f09cc8 - core::fmt::write::h85ffdb57a56da83e
   2:     0x7f4a76e911d1 - std::io::Write::write_fmt::h3a2ae64c65928adf
   3:     0x7f4a76e9c901 - std::sys_common::backtrace::print::h0ec953311f5061d8
   4:     0x7f4a76e9fad4 - std::panicking::default_hook::{{closure}}::h60a0ced62ab604c7
   5:     0x7f4a76e9f7ba - std::panicking::default_hook::h3ad9e1dde3e1e424
   6:     0x7f4a779a4c35 - rustc_driver_impl[6e6e6528accfd63]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:     0x7f4a76ea01f1 - std::panicking::rust_panic_with_hook::hba2254683d4f2350
   8:     0x7f4a76e9ff69 - std::panicking::begin_panic_handler::{{closure}}::h1bb73a52ba6d86bf
   9:     0x7f4a76e9cfc6 - std::sys_common::backtrace::__rust_end_short_backtrace::h457fa3a8fbf96bd7
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
  10:     0x7f4a76e9fc47 - rust_begin_unwind
  11:     0x7f4a76e562c3 - core::panicking::panic_fmt::h09f165c1cec36677
  12:     0x7f4a76f05c71 - core::panicking::panic_display::hb8a27bc80344dd4a
  13:     0x7f4a76f05c1b - core::panicking::panic_str::h0d683924b644cf7e
  14:     0x7f4a76e56286 - core::option::expect_failed::h7416cbc6859a82cf
  15:     0x7f4a77a46424 - <tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr> as tracing_subscriber[a5d0039778a0dacc]::layer::Layer<tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>>::on_event
  16:     0x7f4a77a3c59f - <tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::FilterState>::did_enable::<<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>> as tracing_subscriber[a5d0039778a0dacc]::layer::Layer<tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>>::on_event::{closure#0}>
  17:     0x7f4a77a52cd7 - <std[a5c91af2d15e892]::thread::local::LocalKey<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::FilterState>>::with::<<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>>::did_enable<<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>> as tracing_subscriber[a5d0039778a0dacc]::layer::Layer<tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>>::on_event::{closure#0}>::{closure#0}, ()>
  18:     0x7f4a77a3d4ec - <tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>> as tracing_subscriber[a5d0039778a0dacc]::layer::Layer<tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>>::on_event
  19:     0x7f4a77a3e796 - <tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::fmt::fmt_layer::Layer<tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>, tracing_subscriber[a5d0039778a0dacc]::fmt::format::DefaultFields, rustc_log[1113402437150d85]::BacktraceFormatter, std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_tree[174f855df6821241]::HierarchicalLayer<std[a5c91af2d15e892]::io::stdio::stderr>, tracing_subscriber[a5d0039778a0dacc]::filter::env::EnvFilter, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>, tracing_subscriber[a5d0039778a0dacc]::layer::layered::Layered<tracing_subscriber[a5d0039778a0dacc]::filter::layer_filters::Filtered<tracing_error[a6eb3201f9170c2e]::layer::ErrorLayer<tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::filter::filter_fn::FilterFn<rustc_log[1113402437150d85]::init_env_logger::{closure#0}>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>, tracing_subscriber[a5d0039778a0dacc]::registry::sharded::Registry>>> as tracing_core[56bc781f3098d5b1]::subscriber::Subscriber>::event
  20:     0x7f4a7acd065e - tracing_core[56bc781f3098d5b1]::dispatcher::get_default::<(), <tracing_core[56bc781f3098d5b1]::event::Event>::dispatch::{closure#0}>
  21:     0x7f4a7accdcb1 - <tracing_core[56bc781f3098d5b1]::event::Event>::dispatch
  22:     0x7f4a788fe495 - <rustc_resolve[53e067340479d2a0]::Resolver>::resolve_crate_root
  23:     0x7f4a789733bf - <core[feb76cca35898a1f]::iter::adapters::map::Map<core[feb76cca35898a1f]::ops::range::Range<usize>, rustc_span[1d330a307b171ff]::hygiene::update_dollar_crate_names<<rustc_resolve[53e067340479d2a0]::Resolver as rustc_expand[25d81198ceafc4c6]::base::ResolverExpand>::resolve_dollar_crates::{closure#0}>::{closure#1}> as core[feb76cca35898a1f]::iter::traits::iterator::Iterator>::fold::<(), core[feb76cca35898a1f]::iter::traits::iterator::Iterator::for_each::call<rustc_span[1d330a307b171ff]::symbol::Symbol, <alloc[e09c93b9546bc735]::vec::Vec<rustc_span[1d330a307b171ff]::symbol::Symbol>>::extend_trusted<core[feb76cca35898a1f]::iter::adapters::map::Map<core[feb76cca35898a1f]::ops::range::Range<usize>, rustc_span[1d330a307b171ff]::hygiene::update_dollar_crate_names<<rustc_resolve[53e067340479d2a0]::Resolver as rustc_expand[25d81198ceafc4c6]::base::ResolverExpand>::resolve_dollar_crates::{closure#0}>::{closure#1}>>::{closure#0}>::{closure#0}>
  24:     0x7f4a7892e1cf - <alloc[e09c93b9546bc735]::vec::Vec<rustc_span[1d330a307b171ff]::symbol::Symbol> as alloc[e09c93b9546bc735]::vec::spec_from_iter::SpecFromIter<rustc_span[1d330a307b171ff]::symbol::Symbol, core[feb76cca35898a1f]::iter::adapters::map::Map<core[feb76cca35898a1f]::ops::range::Range<usize>, rustc_span[1d330a307b171ff]::hygiene::update_dollar_crate_names<<rustc_resolve[53e067340479d2a0]::Resolver as rustc_expand[25d81198ceafc4c6]::base::ResolverExpand>::resolve_dollar_crates::{closure#0}>::{closure#1}>>>::from_iter
  25:     0x7f4a788620e3 - rustc_span[1d330a307b171ff]::hygiene::update_dollar_crate_names::<<rustc_resolve[53e067340479d2a0]::Resolver as rustc_expand[25d81198ceafc4c6]::base::ResolverExpand>::resolve_dollar_crates::{closure#0}>
  26:     0x7f4a79da44de - <rustc_expand[25d81198ceafc4c6]::expand::MacroExpander>::collect_invocations
  27:     0x7f4a79d9fe8d - <rustc_expand[25d81198ceafc4c6]::expand::MacroExpander>::fully_expand_fragment
  28:     0x7f4a79d9faff - <rustc_expand[25d81198ceafc4c6]::expand::MacroExpander>::expand_crate
  29:     0x7f4a77aa598f - <rustc_session[73226824cc72d182]::session::Session>::time::<rustc_ast[e7d7a5047d46c716]::ast::Crate, rustc_interface[6219fe1e1c8d4b8]::passes::configure_and_expand::{closure#1}>
  30:     0x7f4a77a7cf3c - rustc_interface[6219fe1e1c8d4b8]::passes::resolver_for_lowering
  31:     0x7f4a7979ff39 - rustc_query_system[ec0f893703c89270]::query::plumbing::try_execute_query::<rustc_query_impl[f22ae8d29d82c5ee]::queries::resolver_for_lowering, rustc_query_impl[f22ae8d29d82c5ee]::plumbing::QueryCtxt>
  32:     0x7f4a79494963 - <rustc_query_impl[f22ae8d29d82c5ee]::Queries as rustc_middle[cd8924ec0e73eabb]::ty::query::QueryEngine>::resolver_for_lowering
  33:     0x7f4a779a69c0 - <rustc_middle[cd8924ec0e73eabb]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures[bf7766984c15ead8]::steal::Steal<(rustc_middle[cd8924ec0e73eabb]::ty::ResolverAstLowering, alloc[e09c93b9546bc735]::rc::Rc<rustc_ast[e7d7a5047d46c716]::ast::Crate>)>>
  34:     0x7f4a779f38b6 - <rustc_interface[6219fe1e1c8d4b8]::interface::Compiler>::enter::<rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}::{closure#2}, core[feb76cca35898a1f]::result::Result<core[feb76cca35898a1f]::option::Option<rustc_interface[6219fe1e1c8d4b8]::queries::Linker>, rustc_span[1d330a307b171ff]::ErrorGuaranteed>>
  35:     0x7f4a779ad3d8 - rustc_span[1d330a307b171ff]::with_source_map::<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, rustc_interface[6219fe1e1c8d4b8]::interface::run_compiler<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  36:     0x7f4a779e4307 - std[a5c91af2d15e892]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6219fe1e1c8d4b8]::util::run_in_thread_pool_with_globals<rustc_interface[6219fe1e1c8d4b8]::interface::run_compiler<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}>::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>
  37:     0x7f4a779f4406 - std[a5c91af2d15e892]::panicking::try::<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, core[feb76cca35898a1f]::panic::unwind_safe::AssertUnwindSafe<<std[a5c91af2d15e892]::thread::Builder>::spawn_unchecked_<rustc_interface[6219fe1e1c8d4b8]::util::run_in_thread_pool_with_globals<rustc_interface[6219fe1e1c8d4b8]::interface::run_compiler<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}>::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
  38:     0x7f4a779b1945 - <<std[a5c91af2d15e892]::thread::Builder>::spawn_unchecked_<rustc_interface[6219fe1e1c8d4b8]::util::run_in_thread_pool_with_globals<rustc_interface[6219fe1e1c8d4b8]::interface::run_compiler<core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>, rustc_driver_impl[6e6e6528accfd63]::run_compiler::{closure#1}>::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[feb76cca35898a1f]::result::Result<(), rustc_span[1d330a307b171ff]::ErrorGuaranteed>>::{closure#1} as core[feb76cca35898a1f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7f4a76eac4de - std::sys::unix::thread::Thread::new::thread_start::h7a8fb31791c13ba9
  40:     0x7f4a76c46b43 - <unknown>
  41:     0x7f4a76cd8a00 - <unknown>
  42:                0x0 - <unknown>
error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md


note: rustc 1.70.0-nightly (474b3619f 2023-03-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -C codegen-units=1 -Z ui-testing -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z deduplicate-diagnostics=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
end of query stack
note: run with `RUSTC_ICE_LOG=trace` environment variable to display a SpanTrace


---- [ui] tests/ui/chalkify/bugs/async.rs stdout ----


error: Error: expected failure status (Some(101)) but received status Some(1).
status: exit status: 1
command: RUSTC_ICE_LOG="trace" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/chalkify/bugs/async.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/chalkify/bugs/async" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/chalkify/bugs/async/auxiliary" "--edition=2021" "-Z" "trait-solver=chalk"
stdout: none
--- stderr -------------------------------
error[E0391]: cycle detected when finding item bounds for `foo::{opaque#0}`
  --> fake-test-src-base/chalkify/bugs/async.rs:24:25
   |
LL | async fn foo(x: u32) -> u32 {
   |
   |
   = note: ...which immediately requires finding item bounds for `foo::{opaque#0}` again
note: cycle used when collecting item types in top-level module
  --> fake-test-src-base/chalkify/bugs/async.rs:22:1
LL | / fn main() -> () {}
LL | |
LL | |
LL | | async fn foo(x: u32) -> u32 {
LL | |     x
LL | | }

error: aborting due to previous error

For more information about this error, try `rustc --explain E0391`.

@bors
Copy link
Contributor

bors commented Mar 20, 2023

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

@Dylan-DPC
Copy link
Member

@yaahc any updates on this?

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants