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

reproducing ICE while compiling experimental RSLint on 1.51.0-nightly #81614

Open
namibj opened this issue Feb 1, 2021 · 17 comments
Open

reproducing ICE while compiling experimental RSLint on 1.51.0-nightly #81614

namibj opened this issue Feb 1, 2021 · 17 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@namibj
Copy link

namibj commented Feb 1, 2021

Code

Trying to compile Kixiron/RSLint@9388cdd, having changed the Cargo.toml a the repository root slightly to the following, in preparation for trying some experimental changes to new code that runs a few seconds even with fat LTO:

[workspace]
members = ["crates/*", "xtask"]
default-members = ["crates/rslint_cli"]

[profile]
release = { lto = "thin", codegen-units = 128, debug = 2, incremental = true }
bench = { lto = "fat", codegen-units = 1 }

[profile.dev]
# Disabling debug info speeds up builds a lot, and we do not really
# rely on debug info for debugging
debug = 0
incremental = true
codegen-units = 16

The command line was nice nice cargo run --locked --release ../../engine262/engine262/src.

Meta

It reproduced after a cargo clean. If there are procedures to appropriately handle an rr trace (it might contain personal/private data by accident, so I'd need some sort of formal agreement to be comfortable sharing it), I'd offer to try to reproduce it under rr.

rustc --version --verbose:

rustc 1.51.0-nightly (04caa632d 2021-01-30)
binary: rustc
commit-hash: 04caa632dd10c2bf64b69524c7f9c4c30a436877
commit-date: 2021-01-30
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

Error output

thread 'rustc' panicked at 'assertion failed: self.text.iter().all(|r| !r.contains(&\'\\t\'))', compiler/rustc_errors/src/styled_buffer.rs:18:9
Backtrace

thread 'rustc' panicked at 'assertion failed: self.text.iter().all(|r| !r.contains(&\'\\t\'))', compiler/rustc_errors/src/styled_buffer.rs:18:9                                                        
stack backtrace:                                                                                                                                                                                       
   0:     0x7fda5500ade7 - std::backtrace_rs::backtrace::libunwind::trace::h8bc78f7bc1f75bdb                                                                                                           
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5                                                      
   1:     0x7fda5500ade7 - std::backtrace_rs::backtrace::trace_unsynchronized::ha4c961c9576f95ba                                                                                                       
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5                                                            
   2:     0x7fda5500ade7 - std::sys_common::backtrace::_print_fmt::hc20cfdc233d6eb02               
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys_common/backtrace.rs:67:5                                                                         
   3:     0x7fda5500ade7 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h04bea14549780a0f                                                                        
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys_common/backtrace.rs:46:22                                                                        
   4:     0x7fda5507bebc - core::fmt::write::h3868db8542c90941                                     
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/core/src/fmt/mod.rs:1096:17                                                                                  
   5:     0x7fda54ffd612 - std::io::Write::write_fmt::h55dd75636eef6a5c                            
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/io/mod.rs:1568:15                                                                                    
   6:     0x7fda5500ed45 - std::sys_common::backtrace::_print::h6439e8525077c7da
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fda5500ed45 - std::sys_common::backtrace::print::h02b685f728ce3931
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fda5500ed45 - std::panicking::default_hook::{{closure}}::h7c29625065fafae1
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:208:50
   9:     0x7fda5500e8a3 - std::panicking::default_hook::hba441710bb71f4d5
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:225:9
  10:     0x7fda55867f6b - rustc_driver::report_ice::h6029ac9bafd12823
  11:     0x7fda343e10da - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::he99c6b079846fdb4
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/alloc/src/boxed.rs:1502:9
  12:     0x7fda343e10da - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h6419eb83c727cc8d
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fda5500f646 - std::panicking::rust_panic_with_hook::ha936eb00e51bc4d9
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:595:17
  14:     0x7fda5500f137 - std::panicking::begin_panic_handler::{{closure}}::hcd15140e0238536e
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:495:13
  15:     0x7fda5500b2ac - std::sys_common::backtrace::__rust_end_short_backtrace::hb13a021bb64823a1
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7fda5500f0c9 - rust_begin_unwind
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:493:5
  17:     0x7fda55078301 - core::panicking::panic_fmt::h20225113c4a2f8fd
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/core/src/panicking.rs:92:14
  18:     0x7fda5507824d - core::panicking::panic::h35b77276aa4b0c12
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/core/src/panicking.rs:50:5
  19:     0x7fda5884a956 - rustc_errors::styled_buffer::StyledBuffer::render::hf197269b1385afc5
  20:     0x7fda588565af - rustc_errors::emitter::EmitterWriter::emit_message_default::h30e67badffef966e
  21:     0x7fda58850a20 - <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit_diagnostic::h73ba5da66cba0737
  22:     0x7fda57075ded - rustc_errors::json::Diagnostic::from_errors_diagnostic::h532f5d6f5adb4036
  23:     0x7fda570758ea - <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic::h0fcfeff719ad096f
  24:     0x7fda588639a8 - rustc_errors::HandlerInner::emit_diagnostic::he36ed20f4ba26d16
  25:     0x7fda58861ae1 - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit::h4eae571a83ebb272
  26:     0x7fda57d51dfc - rustc_codegen_ssa::back::link::link_natively::hdcdbeb8d48df28bc
  27:     0x7fda57d4f9ef - rustc_codegen_ssa::back::link::link_binary::h0ed9bbc4697317f5
  28:     0x7fda57d431f2 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::link::h0c5383f466d78197
  29:     0x7fda57c98470 - rustc_interface::queries::Linker::link::h1a500de353d01a7e
    30:     0x7fda57c41ea2 - rustc_span::with_source_map::h0b3994d7a2f67198
  31:     0x7fda57c0b477 - rustc_interface::interface::create_compiler_and_run::h4d7ef2129059135c
  32:     0x7fda57c42abf - std::sys_common::backtrace::__rust_begin_short_backtrace::hcb0be55fe1a86377
  33:     0x7fda57c283ca - core::ops::function::FnOnce::call_once{{vtable.shim}}::h0363f9b03bb4d9ca 
  34:     0x7fda5501fb5a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8ffdf8dc1f37e360
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/alloc/src/boxed.rs:1488:9
  35:     0x7fda5501fb5a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h74f6ec149ce6acc8
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/alloc/src/boxed.rs:1488:9
  36:     0x7fda5501fb5a - std::sys::unix::thread::Thread::new::thread_start::h565bef3956c58d58
                               at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/sys/unix/thread.rs:71:17
  37:     0x7fda54efa3e9 - start_thread
  38:     0x7fda54e17293 - __GI___clone
  39:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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.51.0-nightly (04caa632d 2021-01-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=2 -C lto=thin -C codegen-units=128 -C debuginfo=2 -C incremental -C linker-plugin-lto -C linker=clang -C link-arg=-fuse-ld=lld -C target-cpu=native --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `rslint_cli`

Caused by:
  process didn't exit successfully: `rustc --crate-name rslint --edition=2018 crates/rslint_cli/src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -
C opt-level=2 -C lto=thin -C codegen-units=128 -C debuginfo=2 -C metadata=dcfc483af5b58fa2 -C extra-filename=-dcfc483af5b58fa2 --out-dir /home/namibj/git/com.github/Kixiron/RSLint/target/release/deps
 -C incremental=/home/namibj/git/com.github/Kixiron/RSLint/target/release/incremental -L dependency=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps --extern colored=/home/namibj/git/co
m.github/Kixiron/RSLint/target/release/deps/libcolored-7727c7e1b68c14fb.rlib --extern glob=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libglob-7ea9db01674e63ab.rlib --extern hashbr
own=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libhashbrown-64261e3b4ef68a8e.rlib --extern heck=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libheck-613679886784
88a6.rlib --extern inferno=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libinferno-bbf230b2bce37f47.rlib --extern notify=/home/namibj/git/com.github/Kixiron/RSLint/target/release/de
ps/libnotify-10e4119a7ba6ac4a.rlib --extern num_cpus=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libnum_cpus-be72278e2849f75d.rlib --extern rayon=/home/namibj/git/com.github/Kixiro
n/RSLint/target/release/deps/librayon-116b86cdca50eaef.rlib --extern regex=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libregex-24e065abec23db26.rlib --extern rslint_cli=/home/nami
bj/git/com.github/Kixiron/RSLint/target/release/deps/librslint_cli-ccb05ea486f9436d.rlib --extern rslint_config=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/librslint_config-99b2cff
405429ff9.rlib --extern rslint_core=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/librslint_core-dea84447ce975c85.rlib --extern rslint_errors=/home/namibj/git/com.github/Kixiron/RSLi
nt/target/release/deps/librslint_errors-e60fb80c864a7276.rlib --extern rslint_lexer=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/librslint_lexer-0410773ec6f5f963.rlib --extern rslin
t_parser=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/librslint_parser-a72024f6739abcc4.rlib --extern rslint_scope=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/lib
rslint_scope-b76071063f2d9698.rlib --extern serde=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libserde-dee461c6720cf3d6.rlib --extern structopt=/home/namibj/git/com.github/Kixiron/
RSLint/target/release/deps/libstructopt-1977d2ca169ad09c.rlib --extern superluminal_perf=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libsuperluminal_perf-2c9299ef870c98ab.rlib --ex
tern termcolor=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libtermcolor-ac236553c1b6a182.rlib --extern toml=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libtoml-6
e273cc90a8a6a85.rlib --extern tracing=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libtracing-74ef76726037215c.rlib --extern tracing_flame=/home/namibj/git/com.github/Kixiron/RSLint
/target/release/deps/libtracing_flame-e76192304d77edc6.rlib --extern tracing_subscriber=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libtracing_subscriber-daae4d1a5e78637d.rlib --ex
tern walkdir=/home/namibj/git/com.github/Kixiron/RSLint/target/release/deps/libwalkdir-8d990d6e0e4f6efd.rlib -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld -Ctarget-cpu=native` (exit code
: 101)

@namibj namibj added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 1, 2021
@Dylan-DPC-zz Dylan-DPC-zz added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 2, 2021
@apiraino
Copy link
Contributor

apiraino commented Feb 3, 2021

Hi @namibj it would be also great to have a smaller reproducible sample for this compiler error. So we can try to isolate and find the regression. Can you give it a try?

Also can maybe help:

@rustbot ping icebreakers-cleanup-crew

@apiraino apiraino added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 3, 2021
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2021

Error: Parsing ping command in comment failed: ...'eanup-crew' | error: expected end of command at >| ' can maybe'...

Please let @rust-lang/release know if you're having trouble with this bot.

@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2021

@rustbot rustbot added the ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections label Feb 3, 2021
@apiraino
Copy link
Contributor

apiraino commented Feb 3, 2021

@rustbot ping icebreakers-cleanup-crew

@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2021

@camelid
Copy link
Member

camelid commented Feb 3, 2021

Error output

thread 'rustc' panicked at 'assertion failed: self.text.iter().all(|r| !r.contains(&\'\\t\'))', compiler/rustc_errors/src/styled_buffer.rs:18:9

This was likely caused by #79757. Specifically, this part is where the ICEing code was added. It seems there's a bug in the implementation where it is not always replacing the tabs ahead of time. However, that seems like it should be a debug_assert! so it's only caught when testing and not released to end-users. It's a bug in the compiler, but fairly minor (just cosmetic).

cc @jryans @estebank

@namibj
Copy link
Author

namibj commented Feb 3, 2021

@camelid Are you saying I can clean up locally and just work around it for now? Or do you potentially still need an rr recording of it?

@jryans
Copy link
Contributor

jryans commented Feb 3, 2021

@camelid Right, perhaps best to change to debug_assert. I'll prep a PR for this.

@camelid
Copy link
Member

camelid commented Feb 3, 2021

@camelid Are you saying I can clean up locally and just work around it for now? Or do you potentially still need an rr recording of it?

Potentially. Try searching for tabs (literal tabs, not \t) in the project and replacing them with spaces.

What is an rr recording?

@jryans
Copy link
Contributor

jryans commented Feb 3, 2021

@camelid Should I mark the PR as fixing this issue and a new one for working out the root cause, or should this be kept open and reused for the root cause as well? (Unsure if there's a typical workflow for such things here.)

@camelid
Copy link
Member

camelid commented Feb 3, 2021

@camelid Should I mark the PR as fixing this issue and a new one for working out the root cause, or should this be kept open and reused for the root cause as well? (Unsure if there's a typical workflow for such things here.)

I'm not sure if there's a usual workflow, but personally I think I would mark it as closing this and then open a new one for working out the underlying cause. Once it no longer panics, this is no longer a severe issue.

@estebank
Copy link
Contributor

estebank commented Feb 3, 2021

Let's leave the ticket open but remove the ICE tag once that PR is merged.

@Stupremee

This comment has been minimized.

m-ou-se added a commit to m-ou-se/rust that referenced this issue Feb 3, 2021
…tebank

Reduce tab formatting assertions to debug only

The tab replacement for diagnostics added in rust-lang#79757 included a few assertions to ensure all tab characters are handled appropriately. We've started getting reports of these assertions firing (rust-lang#81614). Since it's only a cosmetic issue, this downgrades the assertions to debug only, so we at least continue compiling even if the diagnostics might be a tad wonky.

Minimizes the impact of rust-lang#81614
@bors bors closed this as completed in 18f6cc6 Feb 3, 2021
@estebank estebank reopened this Feb 3, 2021
@jryans
Copy link
Contributor

jryans commented Feb 4, 2021

As discussed, we can remove some of the labels now that the ICE is resolved (but the root cause remains).

@rustbot label -I-ICE -I-prioritize +A-diagnostics

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 4, 2021
@dwrensha
Copy link
Contributor

fuzz-rustc found a small example that hits the debug assertion:

fn n(){let _:C+d	<>
}

@estebank
Copy link
Contributor

Triage: I don't believe the assertion is being triggered anymore on master (changing the debug_assert with assert and the snippet in the previous comment didn't trigger an ICE).

@Badel2
Copy link
Contributor

Badel2 commented Nov 13, 2021

I can confirm that the previous comment does no longer trigger an ICE, but I found this case which does trigger it (only with debug assertions enabled):

const	const

@jackh726 jackh726 added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Dec 25, 2023
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 C-bug Category: This is a bug. ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. 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