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

Test failure JIT\\Regression\\VS-ia64-JIT\\V2.0-Beta2\\b311420\\b311420\\b311420.cmd #66969

Closed
VincentBu opened this issue Mar 22, 2022 · 6 comments · Fixed by #66999
Closed

Comments

@VincentBu
Copy link

Run: runtime-coreclr r2r 20220320.1

Failed test:

R2R windows arm Checked no_tiered_compilation @ Windows.10.Arm64v8.Open

- JIT\\Regression\\VS-ia64-JIT\\V2.0-Beta2\\b311420\\b311420\\b311420.cmd
- JIT\\Regression\\VS-ia64-JIT\\V1.2-M02\\b28158\\b28158\\b28158.cmd
- JIT\\jit64\\opt\\cse\\HugeField2\\HugeField2.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_r\\ctest1_cs_r.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_d\\ctest1_cs_d.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_do\\ctest1_cs_do.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_do\\ctest1_cs_do.cmd
- JIT\\jit64\\opt\\cse\\HugeField1\\HugeField1.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_do\\bigvtbl_cs_do.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_r\\bigvtbl_cs_r.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_d\\bigvtbl_cs_d.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_ro\\bigvtbl_cs_ro.cmd
- JIT\\jit64\\hfa\\main\\testB\\hfa_nf0B_r\\hfa_nf0B_r.cmd
- JIT\\jit64\\mcc\\interop\\mcc_i04\\mcc_i04.cmd
- JIT\\jit64\\mcc\\interop\\mcc_i17\\mcc_i17.cmd
- JIT\\opt\\virtualstubdispatch\\manyintf\\ctest_cs_r\\ctest_cs_r.cmd

R2R windows arm Checked @ Windows.10.Arm64v8.Open

- JIT\\Regression\\VS-ia64-JIT\\V2.0-Beta2\\b311420\\b311420\\b311420.cmd
- JIT\\Regression\\VS-ia64-JIT\\V1.2-M02\\b28158\\b28158\\b28158.cmd
- JIT\\jit64\\opt\\cse\\HugeField2\\HugeField2.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_d\\ctest1_cs_d.cmd
- Loader\\classloader\\MethodImpl\\CovariantReturns\\UnitTest\\UnitTestMultiModule\\UnitTestMultiModule.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_do\\ctest1_cs_do.cmd
- JIT\\opt\\virtualstubdispatch\\hashcode\\ctest1_cs_ro\\ctest1_cs_ro.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_ro\\bigvtbl_cs_ro.cmd
- JIT\\jit64\\opt\\cse\\HugeField1\\HugeField1.cmd
- JIT\\opt\\virtualstubdispatch\\bigvtbl\\bigvtbl_cs_r\\bigvtbl_cs_r.cmd

Error message:

Could Not Find D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\IL-CG2\composite-r2r.dll
Could Not Find D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.dll.rsp
Failed to load: 'D:\h\w\AB170977\p\coreclr.dll'. Error: 0x000000c1

Return code:      1
Raw output file:      D:\h\w\AB170977\w\B1180983\uploads\Reports\JIT.Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.output.txt
Raw output:
BEGIN EXECUTION
b311420.dll
1 file(s) copied.
Response file: D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.dll.rsp
D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\IL-CG2\b311420.dll
-o:D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.dll
--targetarch:arm
--verify-type-and-field-layout
--method-layout:random
-r:D:\h\w\AB170977\p\System..dll
-r:D:\h\w\AB170977\p\Microsoft..dll
-r:D:\h\w\AB170977\p\mscorlib.dll
-r:D:\h\w\AB170977\p\netstandard.dll
-O
" "dotnet" "D:\h\w\AB170977\p\crossgen2\crossgen2.dll" @"D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.dll.rsp"   -r:D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\IL-CG2*.dll"
Emitting R2R PE file: D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.dll
"D:\h\w\AB170977\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  b311420.dll
Expected: 100
Actual: -1
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:

set CORE_ROOT=D:\h\w\AB170977\p
D:\h\w\AB170977\w\B1180983\e\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.cmd
Expected: True
Actual:   False


Stack trace
   at JIT_Regression._VS_ia64_JIT_V2_0_Beta2_b311420_b311420_b311420_._VS_ia64_JIT_V2_0_Beta2_b311420_b311420_b311420_cmd()
@dotnet-issue-labeler dotnet-issue-labeler bot added area-crossgen2-coreclr untriaged New issue has not been triaged by the area owner labels Mar 22, 2022
@jakobbotsch
Copy link
Member

Failed to load: 'D:\h\w\AB170977\p\coreclr.dll'. Error: 0x000000c1

I ran into this issue on Windows ARM32 locally as well while trying to investigate #66424.
FWIW, 0xc1 is ERROR_BAD_EXE_FORMAT. I bisected it to eb8460f. @janvorli can you take a look?

@jakobbotsch
Copy link
Member

There also seems to be some weird Windows loader effect going on. I have noticed that if I build the bad commit, then run corerun.exe I get the above error. If I then rebuild the parent commit on top of it, and run it from the same path, I still get the same error. However if I then copy this Core_Root somewhere else and run it again, it works.

@janvorli
Copy link
Member

We have been hitting bad exe format error in the CI for quite some time on various windows targets, @trylek was investigating it, but was never able to repro it locally. The current theory was that it is something in the CI causing problems with access to the file being loaded, like an antivirus or something like that.

@jakobbotsch
Copy link
Member

jakobbotsch commented Mar 22, 2022

Are you sure it is the same issue? The above is reproducing reliably for me after eb8460f. Whenever I run corerun.exe <path to managed .dll> I get the error and it works fine on the commit before (provided I copy the Core_Root to separate places).

@trylek
Copy link
Member

trylek commented Mar 22, 2022

I think these are two separate issues. The bug I'm still investigating mostly manifests when loading managed components of Crossgen2 and is rather sporadic whereas this bug is related to the load of native coreclr.dll and seems quite prevalent. In fact I have just nailed down the cause of #66954 and it might explain the managed component load issue as the problem is a race condition around assembly / native image loading that can make the runtime start using an assembly before it is sufficiently loaded.

jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Mar 22, 2022
It seems there is a linker bug related to control-flow guard that is
causing dotnet#66969. In eb8460f a thunktemplates.asm file was added that has
a LEAF_END_MARKED at the end of the file. This creates two symbols for
the same upcoming address. Normally that should be fine, but in this
case it causes the linker to place the same address twice in a CFG table
in the PE file. This causes the kernel to fail while loading the image.

A simple workaround would be to add a nop at the end of
thunktemplates.asm, but @janvorli suggested giving these symbols their
own address in all cases for goodness when debugging. We already do so
for Windows x64 it looks like.

Fix dotnet#66969
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 22, 2022
@janvorli
Copy link
Member

Right, I have misread the coreclr.dll in the comment as System.Private.CoreLib.dll first.

jakobbotsch added a commit that referenced this issue Mar 23, 2022
…ug (#66999)

It seems there is a linker bug related to control-flow guard that is
causing #66969. In eb8460f a thunktemplates.asm file was added that has
a LEAF_END_MARKED at the end of the file. This creates two symbols for
the same upcoming address. Normally that should be fine, but in this
case it causes the linker to place the same address twice in a CFG table
in the PE file. This causes the kernel to fail while loading the image.

A simple workaround would be to add a nop at the end of
thunktemplates.asm, but @janvorli suggested giving these symbols their
own address in all cases for goodness when debugging. We already do so
for Windows x64 it looks like.

Fix #66969
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 23, 2022
radekdoulik pushed a commit to radekdoulik/runtime that referenced this issue Mar 30, 2022
…ug (dotnet#66999)

It seems there is a linker bug related to control-flow guard that is
causing dotnet#66969. In eb8460f a thunktemplates.asm file was added that has
a LEAF_END_MARKED at the end of the file. This creates two symbols for
the same upcoming address. Normally that should be fine, but in this
case it causes the linker to place the same address twice in a CFG table
in the PE file. This causes the kernel to fail while loading the image.

A simple workaround would be to add a nop at the end of
thunktemplates.asm, but @janvorli suggested giving these symbols their
own address in all cases for goodness when debugging. We already do so
for Windows x64 it looks like.

Fix dotnet#66969
@ghost ghost locked as resolved and limited conversation to collaborators Apr 22, 2022
@jeffhandley jeffhandley removed the untriaged New issue has not been triaged by the area owner label May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants