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

UI test failures with parallel-compiler=true #75760

Open
Tracked by #113349
pnkfelix opened this issue Aug 21, 2020 · 12 comments
Open
Tracked by #113349

UI test failures with parallel-compiler=true #75760

pnkfelix opened this issue Aug 21, 2020 · 12 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-compiler-parallel Working group: Parallelizing the compiler

Comments

@pnkfelix
Copy link
Member

I changed the config.toml to say

parallel-compiler = true

and ran x.py test.

I got this result:

failures:
    [ui] ui/associated-types/defaults-cyclic-fail-1.rs
    [ui] ui/associated-types/defaults-cyclic-fail-2.rs
    [ui] ui/privacy/privacy2.rs
    [ui] ui/privacy/privacy3.rs
    [ui] ui/traits/cycle-cache-err-60010.rs

test result: FAILED. 10601 passed; 5 failed; 63 ignored; 0 measured; 0 filtered out

More specifically:

failures:

---- [ui] ui/associated-types/defaults-cyclic-fail-1.rs stdout ----
diff of stderr:

22	LL |     type A = Box<Self::B>;
23	   |     ^^^^^^^^^^^^^^^^^^^^^^
24	
-	error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
-	  --> $DIR/defaults-cyclic-fail-1.rs:37:5
-	   |
-	LL |     type B = &'static Self::A;
-	   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-	
-	error: aborting due to 5 previous errors
+	error: aborting due to 4 previous errors
32	
33	For more information about this error, try `rustc --explain E0275`.
34	


The actual stderr differed from the expected stderr.
Actual stderr saved to /home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-1/defaults-cyclic-fail-1.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args associated-types/defaults-cyclic-fail-1.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-1" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-1/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0275]: overflow evaluating the requirement `<() as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-1.rs:10:6
   |
LL | impl Tr for () {}
   |      ^^

error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-1.rs:28:6
   |
LL | impl Tr for bool {
   |      ^^

error[E0275]: overflow evaluating the requirement `<usize as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-1.rs:35:6
   |
LL | impl Tr for usize {
   |      ^^

error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-1.rs:30:5
   |
LL |     type A = Box<Self::B>;
   |     ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

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

------------------------------------------


---- [ui] ui/associated-types/defaults-cyclic-fail-2.rs stdout ----
diff of stderr:

22	LL |     type A = Box<Self::B>;
23	   |     ^^^^^^^^^^^^^^^^^^^^^^
24	
-	error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
-	  --> $DIR/defaults-cyclic-fail-2.rs:39:5
-	   |
-	LL |     type B = &'static Self::A;
-	   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-	
-	error: aborting due to 5 previous errors
+	error: aborting due to 4 previous errors
32	
33	For more information about this error, try `rustc --explain E0275`.
34	


The actual stderr differed from the expected stderr.
Actual stderr saved to /home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-2/defaults-cyclic-fail-2.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args associated-types/defaults-cyclic-fail-2.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-2" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/associated-types/defaults-cyclic-fail-2/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0275]: overflow evaluating the requirement `<() as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-2.rs:12:6
   |
LL | impl Tr for () {}
   |      ^^

error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-2.rs:30:6
   |
LL | impl Tr for bool {
   |      ^^

error[E0275]: overflow evaluating the requirement `<usize as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-2.rs:37:6
   |
LL | impl Tr for usize {
   |      ^^

error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/associated-types/defaults-cyclic-fail-2.rs:32:5
   |
LL |     type A = Box<Self::B>;
   |     ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

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

------------------------------------------


---- [ui] ui/privacy/privacy2.rs stdout ----
diff of stderr:

23	
24	error: requires `sized` lang_item
25	
-	error: aborting due to 3 previous errors
+	error: requires `sized` lang_item
+	
+	error: requires `sized` lang_item
+	
+	error: aborting due to 5 previous errors
27	
28	Some errors have detailed explanations: E0432, E0603.
29	For more information about an error, try `rustc --explain E0432`.


The actual stderr differed from the expected stderr.
Actual stderr saved to /home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy2/privacy2.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args privacy/privacy2.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy2" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy2/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0432]: unresolved import `bar::foo`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy2.rs:17:9
   |
LL |     use bar::foo;
   |         ^^^^^^^^ no `foo` in `bar`

error[E0603]: function import `foo` is private
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy2.rs:23:20
   |
LL |     use bar::glob::foo;
   |                    ^^^ private function import
   |
note: the function import `foo` is defined here...
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy2.rs:10:13
   |
LL |         use foo;
   |             ^^^
note: ...and refers to the function `foo` which is defined here
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy2.rs:14:1
   |
LL | pub fn foo() {}
   | ^^^^^^^^^^^^ consider importing it directly

error: requires `sized` lang_item

error: requires `sized` lang_item

error: requires `sized` lang_item

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0432, E0603.
For more information about an error, try `rustc --explain E0432`.

------------------------------------------


---- [ui] ui/privacy/privacy3.rs stdout ----
diff of stderr:

6	
7	error: requires `sized` lang_item
8	
-	error: aborting due to 2 previous errors
+	error: requires `sized` lang_item
+	
+	error: requires `sized` lang_item
+	
+	error: aborting due to 4 previous errors
10	
11	For more information about this error, try `rustc --explain E0432`.
12	


The actual stderr differed from the expected stderr.
Actual stderr saved to /home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy3/privacy3.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args privacy/privacy3.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy3.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy3" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/privacy/privacy3/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0432]: unresolved import `bar::gpriv`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/privacy/privacy3.rs:18:9
   |
LL |     use bar::gpriv;
   |         ^^^^^^^^^^ no `gpriv` in `bar`

error: requires `sized` lang_item

error: requires `sized` lang_item

error: requires `sized` lang_item

error: aborting due to 4 previous errors

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

------------------------------------------


---- [ui] ui/traits/cycle-cache-err-60010.rs stdout ----
diff of stderr:

6	   |
7	   = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
8	
-	error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: std::panic::RefUnwindSafe`
-	  --> $DIR/cycle-cache-err-60010.rs:31:20
-	   |
-	LL | trait Database {
-	   |       -------- required by a bound in this
-	LL |     type Storage;
-	   |     ------------- required by this bound in `Database`
-	...
-	LL |     type Storage = SalsaStorage;
-	   |                    ^^^^^^^^^^^^
-	   |
-	   = note: required because it appears within the type `RootDatabase`
-	   = note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
-	   = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
-	   = note: required because it appears within the type `SalsaStorage`
-	
-	error: aborting due to 2 previous errors
+	error: aborting due to previous error
26	
27	For more information about this error, try `rustc --explain E0275`.
28	


The actual stderr differed from the expected stderr.
Actual stderr saved to /home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/traits/cycle-cache-err-60010/cycle-cache-err-60010.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/cycle-cache-err-60010.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/traits/cycle-cache-err-60010.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/traits/cycle-cache-err-60010" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui/traits/cycle-cache-err-60010/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0275]: overflow evaluating the requirement `RootDatabase: SourceDatabase`
  --> /home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui/traits/cycle-cache-err-60010.rs:27:13
   |
LL |     _parse: <ParseQuery as Query<RootDatabase>>::Data, //~ ERROR overflow
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`

error: aborting due to previous error

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

------------------------------------------



failures:
    [ui] ui/associated-types/defaults-cyclic-fail-1.rs
    [ui] ui/associated-types/defaults-cyclic-fail-2.rs
    [ui] ui/privacy/privacy2.rs
    [ui] ui/privacy/privacy3.rs
    [ui] ui/traits/cycle-cache-err-60010.rs

test result: FAILED. 10601 passed; 5 failed; 63 ignored; 0 measured; 0 filtered out

thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:353:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


command did not execute successfully: "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/lib" "--run-lib-path" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--src-base" "/home/pnkfelix/Dev/Mozilla/rust.git/src/test/ui" "--build-base" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage1-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/pnkfelix/Dev/Mozilla/rust.git/objdir-opt/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python" "--lldb-python" "/usr/bin/python" "--gdb" "/usr/bin/gdb" "--lldb-version" "lldb version 10.0.0\n" "--lldb-python-dir" "/usr/lib/lib/python3/dist-packages" "--quiet" "--llvm-version" "10.0.1-rust-dev" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target testingsupport textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" ""

I know that the parallel-compiler setting is still experimental/unsupported.

But it would be nice if it didn't inject test failures like this, if we can fix it.

@pnkfelix pnkfelix added the C-bug Category: This is a bug. label Aug 21, 2020
@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc WG-compiler-parallel Working group: Parallelizing the compiler labels Aug 21, 2020
@workingjubilee
Copy link
Member

workingjubilee commented Sep 5, 2020

Ran into this, the defaults-cyclic-fail tests seem to pass now, but this remains for the others.

Speculatively, it seems to be, since the issue in one case is that the errors duplicate, and the issue in the other case is that the error never gets found, is that diagnostics do not get absorbed back into a single thread and deduplicated properly.

---- [ui] ui/privacy/privacy2.rs stdout ----
diff of stderr:

23	
24	error: requires `sized` lang_item
25	
-	error: aborting due to 3 previous errors
+	error: requires `sized` lang_item
+	
+	error: requires `sized` lang_item
+	
+	error: aborting due to 5 previous errors
27	
28	Some errors have detailed explanations: E0432, E0603.
29	For more information about an error, try `rustc --explain E0432`.
---- [ui] ui/privacy/privacy3.rs stdout ----
diff of stderr:

6	
7	error: requires `sized` lang_item
8	
-	error: aborting due to 2 previous errors
+	error: requires `sized` lang_item
+	
+	error: requires `sized` lang_item
+	
+	error: aborting due to 4 previous errors
10	
11	For more information about this error, try `rustc --explain E0432`.
12	
---- [ui] ui/traits/cycle-cache-err-60010.rs stdout ----
diff of stderr:

6	   |
7	   = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
8	
-	error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: RefUnwindSafe`
-	  --> $DIR/cycle-cache-err-60010.rs:31:20
-	   |
-	LL | trait Database {
-	   |       -------- required by a bound in this
-	LL |     type Storage;
-	   |     ------------- required by this bound in `Database`
-	...
-	LL |     type Storage = SalsaStorage;
-	   |                    ^^^^^^^^^^^^
-	   |
-	   = note: required because it appears within the type `RootDatabase`
-	   = note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
-	   = note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
-	   = note: required because it appears within the type `SalsaStorage`
-	
-	error: aborting due to 2 previous errors
+	error: aborting due to previous error
26	
27	For more information about this error, try `rustc --explain E0275`.
28	

@emanuellima1
Copy link

Hello everyone. My name is Emanuel and I would like to start contributing on the parallelization effort of rustc. I am new to open source contributions and to Rust, so I also asked for the help of Josh Triplett on Zulip.

Using rustc 1.52.0-dev (x86_64-unknown-linux-gnu) 15 tests fail:

failures:
    [ui] ui/associated-types/defaults-cyclic-fail-1.rs
    [ui] ui/associated-types/defaults-cyclic-fail-2.rs
    [ui] ui/impl-trait/auto-trait-leak.rs
    [ui] ui/infinite/infinite-struct.rs
    [ui] ui/infinite/infinite-tag-type-recursion.rs
    [ui] ui/issues/issue-3008-1.rs
    [ui] ui/issues/issue-3008-2.rs
    [ui] ui/issues/issue-32326.rs
    [ui] ui/issues/issue-57271.rs
    [ui] ui/issues/issue-72554.rs
    [ui] ui/privacy/privacy2.rs
    [ui] ui/privacy/privacy3.rs
    [ui] ui/recursion/issue-26548-recursion-via-normalize.rs
    [ui] ui/type_length_limit.rs
    [ui] ui/union/union-nonrepresentable.rs

So I would like some opinions on how to tackle those issues. Any help is appreciated.

@jyn514
Copy link
Member

jyn514 commented Apr 4, 2021

@emanuellima1 I'm not sure how to fix the underlying issue that diagnostics aren't deduplicated, but another short-term fix is to not send the duplicates to rustc_error in the first place somehow.

@SparrowLii
Copy link
Member

Just dived into it and tried to make some fixes: #97307 .

@SparrowLii
Copy link
Member

Submitted a new PR to fix another set of ui test failures

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 27, 2022
catch unwind in parallel mode during wfcheck

Update rust-lang#75760
When performing wfcheck, from the test results, the parallel mode will stop all checks when an `item`'s check failed, (e.g. the first ui test failure raised from [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs#L249))while the serial mode will output each `item`'s check result via `catch_unwind`. This leads to inconsistencies in the final output of the two mode.
In my local environment, this modification prevents the following ui tests from failing when set `parallel-compiler = true` in `config.toml`:

```
    [ui] src/test\ui\associated-types\defaults-cyclic-fail-1.rs
    [ui] src/test\ui\associated-types\defaults-cyclic-fail-2.rs
    [ui] src/test\ui\associated-types\hr-associated-type-bound-2.rs
    [ui] src/test\ui\associated-types\impl-wf-cycle-1.rs
    [ui] src/test\ui\associated-types\impl-wf-cycle-2.rs
    [ui] src/test\ui\issues\issue-20413.rs
    [ui] src/test\ui\parallel_test\defaults-cyclic-fail-para.rs
```
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 3, 2022
get rid of `tcx` in deadlock handler when parallel compilation

This is a very obscure and hard-to-trace problem that affects thread scheduling. If we copy `tcx` to the deadlock handler thread, it will perform unpredictable behavior and cause very weird problems when executing `try_collect_active_jobs`(For example, the deadlock handler thread suddenly preempts the content of the blocked worker thread and executes the unknown judgment branch, like rust-lang#94654).
Fortunately we can avoid this behavior by precomputing `query_map`. This change fixes the following ui tests failure on my environment when set `parallel-compiler = true`:
```
    [ui] src/test\ui\async-await\no-const-async.rs
    [ui] src/test\ui\infinite\infinite-struct.rs
    [ui] src/test\ui\infinite\infinite-tag-type-recursion.rs
    [ui] src/test\ui\issues\issue-3008-1.rs
    [ui] src/test\ui\issues\issue-3008-2.rs
    [ui] src/test\ui\issues\issue-32326.rs
    [ui] src/test\ui\issues\issue-57271.rs
    [ui] src/test\ui\issues\issue-72554.rs
    [ui] src/test\ui\parser\fn-header-semantic-fail.rs
    [ui] src/test\ui\union\union-nonrepresentable.rs
```

Updates rust-lang#75760
Fixes rust-lang#94654
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 19, 2022
use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`

Using `par_iter` in non-parallel mode will cause the entire process to abort when any iteration panics.  So we can use `par_for_each_in` instead to make the error message consistent with parallel mode. This means that the compiler will output more error messages in some cases. This fixes the following ui tests when set `parallel-compiler = true`:
```
    [ui] src/test\ui\privacy\privacy2.rs
    [ui] src/test\ui\privacy\privacy3.rs
    [ui] src/test\ui\type_length_limit.rs
```

This refers to rust-lang#68171

Updates rust-lang#75760
@SparrowLii
Copy link
Member

SparrowLii commented Jul 19, 2022

Just submitted a new PR to fix 3 of the 4 remaining failing tests.

The remaining one is about the extra output of warn from the external crate tracing v0.1.9. I just leave it for now. ([ui] src\test\ui\consts\const_in_pattern\issue-73431.rs)

#[Edit] The remain one is because of the #[cfg(parallel_compiler)] attribute in rustc_log

@jyn514 jyn514 changed the title bootstrap test failure with parallel-compiler=true UI test failures with parallel-compiler=true Feb 19, 2023
@jyn514 jyn514 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 19, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this issue Apr 5, 2023
write threads info into log only when debugging

The current tracing log will unconditionally write thread information during parallel compilation, which sometimes confuses some normal output log information

This fixes the UI test failure of:
```
[ui] tests/ui/consts/const_in_pattern/issue-73431.rs
```
Updates rust-lang#75760
@SparrowLii
Copy link
Member

SparrowLii commented Apr 6, 2023

This issue currently only involves the scenario of -Zthreads=1, but I think -Zthreads>1 should also use this issue.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 6, 2023
add `dont_check_failure_status` option in the compiler test

Sometimes the compiler triggers one ice while processing another ice. This will cause a recursive panic and go to [`sys::abort_internal()`](https://github.com/rust-lang/rust/blob/master/library/std/src/panicking.rs#L675), which generates an unfixed exit code. So I think we need an option to allow these use cases to generate different exit codes

Updates rust-lang#75760
cc rust-lang#95134

For example, when set `parallel_compiler = true`, issue-95134 will ice in `report_ice` since it try to print the query stack. Below is the brief error message:
```
failures:

---- [ui] tests\ui\recursion\issue-95134.rs stdout ----

error: Error: expected failure status (Some(101)) but received status Some(-1073740791).
status: exit code: 0xc0000409
command: PATH="D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage1\bin;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files\CMake\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\Nsight Compute 2021.2.1\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\HuaweiOpensource\anaconda3;C:\Users\HuaweiOpensource\anaconda3\Scripts;C:\Users\HuaweiOpensource\anaconda3\Library\bin;C:\Users\HuaweiOpensource\anaconda3\Library\mingw-w64;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\GnuWin32\bin;C:\Users\HuaweiOpensource\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\HuaweiOpensource\AppData\Local\Programs\Python\Python38\;C:\Users\HuaweiOpensource\.cargo\bin;C:\Users\HuaweiOpensource\.cargo\bin;D:\Program Files\JetBrains\CLion 2022.1.3\bin;;D:\Program Files\JetBrains\PyCharm Community Edition 2020.3\bin;;D:\Program Files\OpenSSL-Win64\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\stage1\\bin\\rustc.exe" "D:\\rust-backup\\parallel_rust\\rust-para\\tests\\ui\\recursion\\issue-95134.rs" "-Zthreads=1" "--target=x86_64-pc-windows-msvc" "--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=D:\\rust-backup\\parallel_rust\\rust-para\\tests\\ui=fake-test-src-base" "-C" "prefer-dynamic" "--out-dir" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\test\\ui\\recursion\\issue-95134" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\native\\rust-test-helpers" "-L" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\test\\ui\\recursion\\issue-95134\\auxiliary" "-Copt-level=0"
stdout: none
--- stderr -------------------------------
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', C:\Users\HuaweiOpensource\.cargo\registry\src\github.com-1ecc6299db9ec823\ena-0.14.2\src\snapshot_vec.rs:199:10
stack backtrace:
   0:     0x7ffc3e90bc05 - std::backtrace_rs::backtrace::trace_unsynchronized::hfabb14c555fa1e54
   1:     0x7ffc3e900799 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h88786f2c1c37cad0
   2:     0x7ffc3e95143b - core::fmt::write::hef4555c5285e005b
   3:     0x7ffc3e8ef2aa - std::io::Write::write_fmt::h9ea304efc4781c26
   4:     0x7ffc3e90059b - std::sys_common::backtrace::print::h7b33cd350eefb143
......
 178:     0x7ffc27d6a3f2 - <&mut serde_json[7222a1897944c7c8]::ser::Serializer<&mut alloc[6a6f6c0f0cd9fa15]::vec::Vec<u8>, serde_json[7222a1897944c7c8]::ser::PrettyFormatter> as serde[d3e6684f4f38fcf7]::ser::Serializer>::collect_seq::<&alloc[6a6f6c0f0cd9fa15]::vec::Vec<serde_json[7222a1897944c7c8]::value::Value>>
 179:     0x7ffc3e8ed9ec - std::sys::windows::thread::Thread::new::thread_start::h5be4f069fac1a629
 180:     0x7ffcb0b37614 - BaseThreadInitThunk
 181:     0x7ffcb18c26a1 - RtlUserThreadStart

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-dev running on x86_64-pc-windows-msvc

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 -C opt-level=0

query stack during panic:
thread 'rustc' panicked at 'type variables should not be hashed: _#0t', D:\rust-backup\parallel_rust\rust-para\compiler\rustc_type_ir\src\lib.rs:718:17
stack backtrace:
   0:     0x7ffc3e90bc05 - std::backtrace_rs::backtrace::trace_unsynchronized::hfabb14c555fa1e54
   1:     0x7ffc3e900799 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h88786f2c1c37cad0
   2:     0x7ffc3e95143b - core::fmt::write::hef4555c5285e005b
   3:     0x7ffc3e8ef2aa - std::io::Write::write_fmt::h9ea304efc4781c26
   4:     0x7ffc3e90059b - std::sys_common::backtrace::print::h7b33cd350eefb143
   5:     0x7ffc3e91c109 - std::panicking::default_hook::h12f01c5f2b8959c6
......
 197:     0x7ffc27d6a3f2 - <&mut serde_json[7222a1897944c7c8]::ser::Serializer<&mut alloc[6a6f6c0f0cd9fa15]::vec::Vec<u8>, serde_json[7222a1897944c7c8]::ser::PrettyFormatter> as serde[d3e6684f4f38fcf7]::ser::Serializer>::collect_seq::<&alloc[6a6f6c0f0cd9fa15]::vec::Vec<serde_json[7222a1897944c7c8]::value::Value>>
 198:     0x7ffc3e8ed9ec - std::sys::windows::thread::Thread::new::thread_start::h5be4f069fac1a629
 199:     0x7ffcb0b37614 - BaseThreadInitThunk
 200:     0x7ffcb18c26a1 - RtlUserThreadStart

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-dev running on x86_64-pc-windows-msvc

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 -C opt-level=0

query stack during panic:
thread panicked while processing panic. aborting.
------------------------------------------
```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 6, 2023
add `dont_check_failure_status` option in the compiler test

Sometimes the compiler triggers one ice while processing another ice. This will cause a recursive panic and go to [`sys::abort_internal()`](https://github.com/rust-lang/rust/blob/master/library/std/src/panicking.rs#L675), which generates an unfixed exit code. So I think we need an option to allow these use cases to generate different exit codes

Updates rust-lang#75760
cc rust-lang#95134

For example, when set `parallel_compiler = true`, issue-95134 will ice in `report_ice` since it try to print the query stack. Below is the brief error message:
```
failures:

---- [ui] tests\ui\recursion\issue-95134.rs stdout ----

error: Error: expected failure status (Some(101)) but received status Some(-1073740791).
status: exit code: 0xc0000409
command: PATH="D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage1\bin;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\rust-backup\parallel_rust\rust-para\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files\CMake\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\Nsight Compute 2021.2.1\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\HuaweiOpensource\anaconda3;C:\Users\HuaweiOpensource\anaconda3\Scripts;C:\Users\HuaweiOpensource\anaconda3\Library\bin;C:\Users\HuaweiOpensource\anaconda3\Library\mingw-w64;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\GnuWin32\bin;C:\Users\HuaweiOpensource\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\HuaweiOpensource\AppData\Local\Programs\Python\Python38\;C:\Users\HuaweiOpensource\.cargo\bin;C:\Users\HuaweiOpensource\.cargo\bin;D:\Program Files\JetBrains\CLion 2022.1.3\bin;;D:\Program Files\JetBrains\PyCharm Community Edition 2020.3\bin;;D:\Program Files\OpenSSL-Win64\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\stage1\\bin\\rustc.exe" "D:\\rust-backup\\parallel_rust\\rust-para\\tests\\ui\\recursion\\issue-95134.rs" "-Zthreads=1" "--target=x86_64-pc-windows-msvc" "--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=D:\\rust-backup\\parallel_rust\\rust-para\\tests\\ui=fake-test-src-base" "-C" "prefer-dynamic" "--out-dir" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\test\\ui\\recursion\\issue-95134" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\native\\rust-test-helpers" "-L" "D:\\rust-backup\\parallel_rust\\rust-para\\build\\x86_64-pc-windows-msvc\\test\\ui\\recursion\\issue-95134\\auxiliary" "-Copt-level=0"
stdout: none
--- stderr -------------------------------
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', C:\Users\HuaweiOpensource\.cargo\registry\src\github.com-1ecc6299db9ec823\ena-0.14.2\src\snapshot_vec.rs:199:10
stack backtrace:
   0:     0x7ffc3e90bc05 - std::backtrace_rs::backtrace::trace_unsynchronized::hfabb14c555fa1e54
   1:     0x7ffc3e900799 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h88786f2c1c37cad0
   2:     0x7ffc3e95143b - core::fmt::write::hef4555c5285e005b
   3:     0x7ffc3e8ef2aa - std::io::Write::write_fmt::h9ea304efc4781c26
   4:     0x7ffc3e90059b - std::sys_common::backtrace::print::h7b33cd350eefb143
......
 178:     0x7ffc27d6a3f2 - <&mut serde_json[7222a1897944c7c8]::ser::Serializer<&mut alloc[6a6f6c0f0cd9fa15]::vec::Vec<u8>, serde_json[7222a1897944c7c8]::ser::PrettyFormatter> as serde[d3e6684f4f38fcf7]::ser::Serializer>::collect_seq::<&alloc[6a6f6c0f0cd9fa15]::vec::Vec<serde_json[7222a1897944c7c8]::value::Value>>
 179:     0x7ffc3e8ed9ec - std::sys::windows::thread::Thread::new::thread_start::h5be4f069fac1a629
 180:     0x7ffcb0b37614 - BaseThreadInitThunk
 181:     0x7ffcb18c26a1 - RtlUserThreadStart

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-dev running on x86_64-pc-windows-msvc

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 -C opt-level=0

query stack during panic:
thread 'rustc' panicked at 'type variables should not be hashed: _#0t', D:\rust-backup\parallel_rust\rust-para\compiler\rustc_type_ir\src\lib.rs:718:17
stack backtrace:
   0:     0x7ffc3e90bc05 - std::backtrace_rs::backtrace::trace_unsynchronized::hfabb14c555fa1e54
   1:     0x7ffc3e900799 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h88786f2c1c37cad0
   2:     0x7ffc3e95143b - core::fmt::write::hef4555c5285e005b
   3:     0x7ffc3e8ef2aa - std::io::Write::write_fmt::h9ea304efc4781c26
   4:     0x7ffc3e90059b - std::sys_common::backtrace::print::h7b33cd350eefb143
   5:     0x7ffc3e91c109 - std::panicking::default_hook::h12f01c5f2b8959c6
......
 197:     0x7ffc27d6a3f2 - <&mut serde_json[7222a1897944c7c8]::ser::Serializer<&mut alloc[6a6f6c0f0cd9fa15]::vec::Vec<u8>, serde_json[7222a1897944c7c8]::ser::PrettyFormatter> as serde[d3e6684f4f38fcf7]::ser::Serializer>::collect_seq::<&alloc[6a6f6c0f0cd9fa15]::vec::Vec<serde_json[7222a1897944c7c8]::value::Value>>
 198:     0x7ffc3e8ed9ec - std::sys::windows::thread::Thread::new::thread_start::h5be4f069fac1a629
 199:     0x7ffcb0b37614 - BaseThreadInitThunk
 200:     0x7ffcb18c26a1 - RtlUserThreadStart

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-dev running on x86_64-pc-windows-msvc

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 -C opt-level=0

query stack during panic:
thread panicked while processing panic. aborting.
------------------------------------------
```
@jyn514
Copy link
Member

jyn514 commented Jul 8, 2023

this test also fails when parallel-compiler is enabled:

failures:

---- [ui] tests/ui-fulldeps/missing-rustc-driver-error.rs stdout ----
diff of stderr:

10
11      error: crate `hashbrown` required to be available in rlib format, but was not found in this form
12
+       error: crate `rayon` required to be available in rlib format, but was not found in this form
14
-       error: aborting due to 6 previous errors
+       error: aborting due to 18 previous errors

probably we need to normalize the stderr so that only one crate is shown? that also avoids having to update the test when we add dependencies.

cc #112143 (comment)

@SparrowLii
Copy link
Member

SparrowLii commented Jul 10, 2023

this test also fails when parallel-compiler is enabled:

I think diagnostic information should be preserved as much as possible.
Maybe add an option to compiler-test to temporarily skip this test when parallel-compiler=true?

@jyn514
Copy link
Member

jyn514 commented Jul 10, 2023

i don't think it's useful to have a full list of the crates in the sysroot. see fd95715 for the solution i came up with (it also allows us to stop ignoring the test on non-unix platforms).

@jyn514
Copy link
Member

jyn514 commented Jul 12, 2023

a bunch of rustdoc tests are also failing - the rustdoc suite is painful to look into but the rustdoc-ui one looks really weird

failures:

---- [ui] tests/rustdoc-ui/infinite-recursive-type.rs stdout ----

error: ui test compiled successfully!

failures:
    [rustdoc] tests/rustdoc/auto_aliases.rs
    [rustdoc] tests/rustdoc/auto-trait-not-send.rs
    [rustdoc] tests/rustdoc/blanket-reexport-item.rs
    [rustdoc] tests/rustdoc/auto-impl-primitive.rs
    [rustdoc] tests/rustdoc/const-generics/const-impl.rs
    [rustdoc] tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
    [rustdoc] tests/rustdoc/duplicated_impl.rs
    [rustdoc] tests/rustdoc/empty-impls.rs
    [rustdoc] tests/rustdoc/generic-impl.rs
    [rustdoc] tests/rustdoc/infinite-redirection.rs
    [rustdoc] tests/rustdoc/issue-110422-inner-private.rs
    [rustdoc] tests/rustdoc/issue-50159.rs
    [rustdoc] tests/rustdoc/issue-51236.rs
    [rustdoc] tests/rustdoc/issue-54705.rs
    [rustdoc] tests/rustdoc/issue-55321.rs
    [rustdoc] tests/rustdoc/issue-56822.rs
    [rustdoc] tests/rustdoc/issue-60726.rs
    [rustdoc] tests/rustdoc/issue-78673.rs
    [rustdoc] tests/rustdoc/issue-78701.rs
    [rustdoc] tests/rustdoc/issue-80233-normalize-auto-trait.rs
    [rustdoc] tests/rustdoc/issue-86620.rs
    [rustdoc] tests/rustdoc/issue-94183-blanket-impl-reexported-trait.rs
    [rustdoc] tests/rustdoc/primitive-tuple-auto-trait.rs
    [rustdoc] tests/rustdoc/primitive-unit-auto-trait.rs
    [rustdoc] tests/rustdoc/primitive-slice-auto-trait.rs
    [rustdoc] tests/rustdoc/primitive/primitive-generic-impl.rs
    [rustdoc] tests/rustdoc/redirect.rs
    [rustdoc] tests/rustdoc/sized_trait.rs
    [rustdoc] tests/rustdoc/src-links-auto-impls.rs
    [rustdoc] tests/rustdoc/synthetic_auto/basic.rs
    [rustdoc] tests/rustdoc/synthetic_auto/crate-local.rs
    [rustdoc] tests/rustdoc/synthetic_auto/complex.rs
    [rustdoc] tests/rustdoc/synthetic_auto/lifetimes.rs
    [rustdoc] tests/rustdoc/synthetic_auto/manual.rs
    [rustdoc] tests/rustdoc/synthetic_auto/negative.rs
    [rustdoc] tests/rustdoc/synthetic_auto/no-redundancy.rs
    [rustdoc] tests/rustdoc/synthetic_auto/nested.rs
    [rustdoc] tests/rustdoc/synthetic_auto/overflow.rs
    [rustdoc] tests/rustdoc/synthetic_auto/project.rs
    [rustdoc] tests/rustdoc/synthetic_auto/self-referential.rs
    [rustdoc] tests/rustdoc/synthetic_auto/static-region.rs

@SparrowLii
Copy link
Member

@jyn514 Due to #106930, rustdoc will not get auto traits when parallel compilation is enabled, otherwise it will cause homu to wait infinitely.
https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/utils.rs#L487-L489

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 15, 2023
…cjgillot

Don't require each rustc_interface tool to opt-in to parallel_compiler

Previously, forgetting to call `interface::set_thread_safe_mode` would cause the following ICE:
```
thread 'rustc' panicked at 'uninitialized dyn_thread_safe mode!', /rustc/dfe0683138de0959b6ab6a039b54d9347f6a6355/compiler/rustc_data_structures/src/sync.rs:74:18
```

This calls `set_thread_safe_mode` in `interface::run_compiler` to avoid requiring it in the caller.

Fixes `tests/run-make-fulldeps/issue-19371` when parallel-compiler is enabled.

r? `@SparrowLii` cc rust-lang#75760
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jul 16, 2023
Don't require each rustc_interface tool to opt-in to parallel_compiler

Previously, forgetting to call `interface::set_thread_safe_mode` would cause the following ICE:
```
thread 'rustc' panicked at 'uninitialized dyn_thread_safe mode!', /rustc/dfe0683138de0959b6ab6a039b54d9347f6a6355/compiler/rustc_data_structures/src/sync.rs:74:18
```

This calls `set_thread_safe_mode` in `interface::run_compiler` to avoid requiring it in the caller.

Fixes `tests/run-make-fulldeps/issue-19371` when parallel-compiler is enabled.

r? `@SparrowLii` cc rust-lang/rust#75760
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 C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-compiler-parallel Working group: Parallelizing the compiler
Projects
None yet
Development

No branches or pull requests

5 participants