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

Segfault when compiling UI test issue-74564-if-expr-stack-overflow.rs with rustup distributed rustc #98458

Closed
antoyo opened this issue Jun 24, 2022 · 4 comments
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@antoyo
Copy link
Contributor

antoyo commented Jun 24, 2022

Even thought this test pass when ran with a locally-built rustc, it segfaults with the rustc distributed by rustup.

The code is the one from this test.

I expected to see this happen: compiles fine

Instead, this happened: segfault due to a stack overflow in visit_expr().

Meta

rustc --version --verbose:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0

Also happens on this nightly:

rustc 1.63.0-nightly (43347397f 2022-06-23)
binary: rustc
commit-hash: 43347397f7c5ca9a670a3bb3890c7187e24a52ab
commit-date: 2022-06-23
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5
Backtrace No Rust panic backtrace, but here's the gdb backtrace:

visit_expr repeated thousands of times…
[…]
#8114 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8115 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8116 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8117 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8118 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8119 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8120 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8121 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8122 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8123 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8124 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8125 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8126 0x00007ffff6067819 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8127 0x00007ffff604e263 in rustc_ast::mut_visit::noop_visit_expr::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8128 0x00007ffff60681ff in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::filter_map_expr () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8129 0x00007ffff6064529 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::flat_map_stmt () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8130 0x00007ffff6be320d in <alloc::vec::Vec<rustc_ast::ast::Stmt> as rustc_data_structures::map_in_place::MapInPlace<rustc_ast::ast::Stmt>>::flat_map_in_place::<rustc_ast::mut_visit::noop_visit_block<rustc_expand::expand::InvocationCollector>::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Stmt; 1]>> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8131 0x00007ffff6054c11 in rustc_ast::mut_visit::noop_visit_item_kind::<rustc_expand::expand::InvocationCollector> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8132 0x00007ffff607e807 in <rustc_ast::ptr::P<rustc_ast::ast::Item> as rustc_expand::expand::InvocationCollectorNode>::wrap_flat_map_node_noop_flat_map::<<rustc_expand::expand::InvocationCollector>::flat_map_node<rustc_ast::ptr::P<rustc_ast::ast::Item>>::{closure#0}> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8133 0x00007ffff60600a2 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::flat_map_item () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8134 0x00007ffff6be2778 in <alloc::vec::Vec<rustc_ast::ptr::P<rustc_ast::ast::Item>> as rustc_data_structures::map_in_place::MapInPlace<rustc_ast::ptr::P<rustc_ast::ast::Item>>>::flat_map_in_place::<rustc_ast::mut_visit::noop_visit_crate<rustc_expand::expand::InvocationCollector>::{closure#0}, smallvec::SmallVec<[rustc_ast::ptr::P<rustc_ast::ast::Item>; 1]>> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8135 0x00007ffff6bc4016 in <rustc_expand::expand::InvocationCollector as rustc_ast::mut_visit::MutVisitor>::visit_crate () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8136 0x00007ffff605ba16 in <rustc_expand::expand::MacroExpander>::fully_expand_fragment () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8137 0x00007ffff6bc0967 in <rustc_expand::expand::MacroExpander>::expand_crate () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8138 0x00007ffff6507092 in <rustc_session::session::Session>::time::<core::result::Result<rustc_ast::ast::Crate, rustc_errors::ErrorGuaranteed>, rustc_interface::passes::configure_and_expand::{closure#1}> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8139 0x00007ffff64ff273 in rustc_interface::passes::configure_and_expand () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8140 0x00007ffff6529863 in <rustc_interface::queries::Queries>::expansion () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8141 0x00007ffff64d128a in <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8142 0x00007ffff64f584f in rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8143 0x00007ffff64d2212 in <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8144 0x00007ffff64e772f in std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>> () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8145 0x00007ffff64e7909 in <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/bouanto/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-01adb97716082640.so
#8146 0x00007ffff3aab303 in alloc::boxed::{impl#44}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:1951
#8147 alloc::boxed::{impl#44}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:1951
#8148 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#8149 0x00007ffff368c54d in ?? () from /usr/lib/libc.so.6
#8150 0x00007ffff3711874 in clone () from /usr/lib/libc.so.6

@antoyo antoyo added the C-bug Category: This is a bug. label Jun 24, 2022
@GuillaumeGomez GuillaumeGomez added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 24, 2022
@gimbling-away
Copy link
Contributor

gimbling-away commented Jul 9, 2022

image

Can confirm, builds OK on locally built.

Meta

image

@gimbling-away
Copy link
Contributor

#97222 is also affected by this.

@gimbling-away
Copy link
Contributor

@antoyo Do you mind checking this again? #97222 is fixed

@antoyo
Copy link
Contributor Author

antoyo commented Jan 9, 2023

This works on latest nightly.

@antoyo antoyo closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants