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

windows: x.py test failure from codegen test suite #96464

Open
pnkfelix opened this issue Apr 27, 2022 · 5 comments
Open

windows: x.py test failure from codegen test suite #96464

pnkfelix opened this issue Apr 27, 2022 · 5 comments
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Apr 27, 2022

I tried this code (on Windows, in powershell)

PS D:\pnkfelix\RustLang\rust.git\objdir> python ..\x.py test > capture-test-failure.txt

I got this output:

[...]
failures:

---- [codegen] src/test\codegen\vec-shrink-panik.rs stdout ----

error: verification with 'FileCheck' failed
status: exit code: 1
command: PATH=";D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX86\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Amazon\cfn-bootstrap\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Users\pnkfelix\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe" "D:\\pnkfelix\\RustLang\\rust.git\\objdir\\build\\x86_64-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--input-file" "D:\\pnkfelix\\RustLang\\rust.git\\objdir\\build\\x86_64-pc-windows-msvc\\test\\codegen\\vec-shrink-panik\\vec-shrink-panik.ll" "D:\\pnkfelix\\RustLang\\rust.git\\src/test\\codegen\\vec-shrink-panik.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,MSVC"
stdout: none
--- stderr -------------------------------
D:\pnkfelix\RustLang\rust.git\src/test\codegen\vec-shrink-panik.rs:24:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: ; call core::panicking::panic_no_unwind
                ^
D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\test\codegen\vec-shrink-panik\vec-shrink-panik.ll:195:10: note: scanning from here
 %cleanuppad.i = cleanuppad within none []
         ^
D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\test\codegen\vec-shrink-panik\vec-shrink-panik.ll:196:1: note: possible intended match here
; call core::ptr::drop_in_place<alloc::vec::Vec<u32>>
^
D:\pnkfelix\RustLang\rust.git\src/test\codegen\vec-shrink-panik.rs:39:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: ; call core::panicking::panic_no_unwind
                ^
D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\test\codegen\vec-shrink-panik\vec-shrink-panik.ll:318:10: note: scanning from here
 %cleanuppad.i.i.i = cleanuppad within none []
         ^
D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\test\codegen\vec-shrink-panik\vec-shrink-panik.ll:319:1: note: possible intended match here
; call core::ptr::drop_in_place<alloc::vec::Vec<&str>>
^

Input file: D:\pnkfelix\RustLang\rust.git\objdir\build\x86_64-pc-windows-msvc\test\codegen\vec-shrink-panik\vec-shrink-panik.ll
Check file: D:\pnkfelix\RustLang\rust.git\src/test\codegen\vec-shrink-panik.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         190:  
         191: .noexc.i: ; preds = %bb6.i2.i.i.i 
         192:  unreachable 
         193:  
         194: funclet_bb13.i: ; preds = %bb6.i2.i.i.i 
         195:  %cleanuppad.i = cleanuppad within none [] 
next:24'0              X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         196: ; call core::ptr::drop_in_place<alloc::vec::Vec<u32>> 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:24'1     ?                                                      possible intended match
         197:  call fastcc void @"_ZN4core3ptr47drop_in_place$LT$alloc..vec..Vec$LT$u32$GT$$GT$17h185632e1510f6779E"(%"alloc::vec::Vec<u32>"* nonnull %_2) #12 [ "funclet"(token %cleanuppad.i) ] 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         198:  cleanupret from %cleanuppad.i unwind to caller 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         199:  
next:24'0     ~
         200: "_ZN5alloc3vec16Vec$LT$T$C$A$GT$16into_boxed_slice17h006bd4b550d6b630E.exit": ; preds = %start.bb8_crit_edge.i, %bb13.i.i.i.i 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         201:  %_5.sroa.0.0.copyload12.i = phi [0 x i32]* [ %_5.sroa.0.0.copyload12.pre.i, %start.bb8_crit_edge.i ], [ %16, %bb13.i.i.i.i ] 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           .
           .
           .
         313:  
         314: .noexc.i.i.i: ; preds = %bb6.i2.i.i.i.i.i 
         315:  unreachable 
         316:  
         317: funclet_bb13.i.i.i: ; preds = %bb6.i2.i.i.i.i.i 
         318:  %cleanuppad.i.i.i = cleanuppad within none [] 
next:39'0              X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         319: ; call core::ptr::drop_in_place<alloc::vec::Vec<&str>> 
next:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:39'1     ?                                                       possible intended match
         320:  call fastcc void @"_ZN4core3ptr51drop_in_place$LT$alloc..vec..Vec$LT$$RF$str$GT$$GT$17h112bc9fce5ca56c3E"(%"alloc::vec::Vec<&str>"* nonnull %_2.i.i) #12 [ "funclet"(token %cleanuppad.i.i.i) ] 
next:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         321:  cleanupret from %cleanuppad.i.i.i unwind to caller 
next:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         322:  
next:39'0     ~
         323: _ZN4core4iter6traits8iterator8Iterator7collect17h7546795dad841ea0E.exit: ; preds = %_ZN4core4iter6traits8iterator8Iterator7collect17h38b30846c8fa863fE.exit.i.i, %bb13.i.i.i.i.i.i 
next:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         324:  %_5.sroa.0.0.copyload1213.i.i.i = phi [0 x { [0 x i8]*, i64 }]* [ %27, %bb13.i.i.i.i.i.i ], [ %10, %_ZN4core4iter6traits8iterator8Iterator7collect17h38b30846c8fa863fE.exit.i.i ] 
next:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>
------------------------------------------



failures:
    [codegen] src/test\codegen\vec-shrink-panik.rs

Here's a gist with more complete output: https://gist.github.com/pnkfelix/343528a3da2000880b370a22b6010b99

This all might be an artifact of weirdnesses in how I work, like putting the build products into their own subdirectory, objdir, of the rust.git source repo. Not sure yet.

@pnkfelix pnkfelix added C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc labels Apr 27, 2022
@luqmana
Copy link
Member

luqmana commented May 31, 2022

I think this might be a mis-merge in #94402 which was reverting #92419. The failing test wasn't modified in the original but it was in the revert. (cc @erikdesjardins) EDIT: Not a mis-merge but apparently just a flaky test depending on how much inlining happens.

Also reproduces on Linux too so not Windows specific.

As for why it didn't fail in CI but does locally: the test is marked with:

// ignore-debug: the debug assertions get in the way

and far as I can tell most targets are built with debug assertions in CI and hence will ignore the test altogether. e.g. here:

test [codegen] src/test\codegen\vec-shrink-panik.rs ... ignored

Looks like both the "compiler" and "codegen" config.toml profiles by default don't enable debug-assertions which may be why you ran into it.

@rustbot label: -O-windows -O-windows-msvc

@rustbot rustbot removed O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows labels May 31, 2022
@erikdesjardins
Copy link
Contributor

erikdesjardins commented May 31, 2022

Those changes were deliberate, since reverting #92419 introduced additional panics which made the test fail locally.

Before #92419, I believe the test passed by accident--the string panic did not occur in the function because it didn't panic itself, it just called a function that could panic (making the test vacuous).

It looks like the test has now returned to that original state. Less inlining is occuring, and again panic_no_unwind doesn't occur in the function, so the check lines that were necessary to avoid the initial failure are now causing failures.

@luqmana
Copy link
Member

luqmana commented May 31, 2022

Those changes were deliberate, since reverting #92419 introduced additional panics which made the test fail locally.

Ah ok, thanks for clarifying!

aarongable pushed a commit to chromium/chromium that referenced this issue Feb 6, 2023
The test is known to fail on Windows:
rust-lang/rust#96464

[email protected]

Bug: 1271215
Change-Id: Ic7fda651e5a8ae5e9ebcd565415716d9d9e5c8b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4226612
Reviewed-by: Collin Baker <[email protected]>
Commit-Queue: danakj <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1101810}
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
@danakj
Copy link
Contributor

danakj commented May 9, 2023

This test has started failing on Linux and Mac with TOT LLVM (again?)

Linux

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8781582054982754321/+/u/package_rust/stdout#L19104_3

--- stderr -------------------------------
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/tests/codegen/vec-shrink-panik.rs:28:12: error: CHECK: expected string not found in input
   // CHECK: filter
             ^
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-unknown-linux-gnu/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:95:32: note: scanning from here
  define { ptr, i64 } @issue71861(ptr noalias nocapture noundef dereferenceable(24) %vec) unnamed_addr #1 personality ptr @rust_eh_personality {
                                 ^
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-unknown-linux-gnu/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:95:47: note: possible intended match here
  define { ptr, i64 } @issue71861(ptr noalias nocapture noundef dereferenceable(24) %vec) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                ^
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/tests/codegen/vec-shrink-panik.rs:43:12: error: CHECK: expected string not found in input
   // CHECK: filter
             ^
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-unknown-linux-gnu/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:158:32: note: scanning from here
  define { ptr, i64 } @issue75636(ptr noalias noundef nonnull readonly align 8 %iter.0, i64 noundef %iter.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                 ^
  /b/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-unknown-linux-gnu/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:158:78: note: possible intended match here
  define { ptr, i64 } @issue75636(ptr noalias noundef nonnull readonly align 8 %iter.0, i64 noundef %iter.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                               ^

Mac

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8781582054982754273/+/u/package_rust/stdout#L22619_3

/opt/s/w/ir/cache/builder/src/third_party/rust_src/src/tests/codegen/vec-shrink-panik.rs:28:12: error: CHECK: expected string not found in input
   // CHECK: filter
             ^
  /opt/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-apple-darwin/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:95:32: note: scanning from here
  define { ptr, i64 } @issue71861(ptr noalias nocapture noundef dereferenceable(24) %vec) unnamed_addr #1 personality ptr @rust_eh_personality {
                                 ^
  /opt/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-apple-darwin/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:95:47: note: possible intended match here
  define { ptr, i64 } @issue71861(ptr noalias nocapture noundef dereferenceable(24) %vec) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                ^
  /opt/s/w/ir/cache/builder/src/third_party/rust_src/src/tests/codegen/vec-shrink-panik.rs:43:12: error: CHECK: expected string not found in input
   // CHECK: filter
             ^
  /opt/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-apple-darwin/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:158:32: note: scanning from here
  define { ptr, i64 } @issue75636(ptr noalias noundef nonnull readonly align 8 %iter.0, i64 noundef %iter.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                 ^
  /opt/s/w/ir/cache/builder/src/third_party/rust_src/src/build/x86_64-apple-darwin/test/codegen/vec-shrink-panik.new/vec-shrink-panik.ll:158:78: note: possible intended match here
  define { ptr, i64 } @issue75636(ptr noalias noundef nonnull readonly align 8 %iter.0, i64 noundef %iter.1) unnamed_addr #1 personality ptr @rust_eh_personality {

aarongable pushed a commit to chromium/chromium that referenced this issue May 9, 2023
rust-lang/rust#96464

The test used to fail on Windows only but now fails everywhere. The
Rust CI skips this test as they run in debug mode and the test does
not run in Debug mode, so we will hit failures before upstream does
here. This failure is likely being hit due to TOT LLVM though, which
upstream does not use.

[email protected]

Bug: 1401042
Change-Id: Ie379559f318f3b7bd57c5db4cd21806218bcb373
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4517966
Commit-Queue: danakj <[email protected]>
Reviewed-by: Hans Wennborg <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1141656}
@erikdesjardins
Copy link
Contributor

@danakj #111385 is open to fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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.
Projects
None yet
Development

No branches or pull requests

6 participants