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: Interop/PInvoke/CriticalHandles/Test/Test/Test.cmd #103939

Closed
v-wenyuxu opened this issue Jun 25, 2024 · 10 comments
Closed

Test failure: Interop/PInvoke/CriticalHandles/Test/Test/Test.cmd #103939

v-wenyuxu opened this issue Jun 25, 2024 · 10 comments
Assignees
Labels
arch-arm32 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs GCStress os-linux Linux OS (any supported distro) Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@v-wenyuxu
Copy link

Failed in: runtime-coreclr r2r-extra 20240623.1

Failed tests:

R2R-CG2 linux arm Checked gcstress0xc @ (Debian.12.Arm32.Open)Ubuntu.2004.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
    - Interop/PInvoke/CriticalHandles/Test/Test/Test.cmd

Error message:

 /root/helix/work/workitem/e/Interop/Interop/../PInvoke/CriticalHandles/Test/Test/Test.sh: line 315: -r:/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/IL-CG2/*.dll: No such file or directory

Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/PInvoke/CriticalHandles/Test/Test/output.txt
Raw output:
BEGIN EXECUTION
in takeLock
/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/IL-CG2/Test.dll
05:22:36
Response file: /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll.rsp
/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/IL-CG2/Test.dll
-o:/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll
-r:/root/helix/work/correlation/System.*.dll
-r:/root/helix/work/correlation/Microsoft.*.dll
-r:/root/helix/work/correlation/xunit.*.dll
-r:/root/helix/work/correlation/mscorlib.dll
--verify-type-and-field-layout
--method-layout:random
--targetarch:arm
--targetos:linux
Running CrossGen2:  dotnet /root/helix/work/correlation/crossgen2/crossgen2.dll @/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll.rsp  
Emitting R2R PE file: /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll
Running R2RDump:  dotnet /root/helix/work/correlation/R2RDump/R2RDump.dll --header --sc --in /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll --out /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/Test.dll.r2rdump --val
05:22:38
/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/IL-CG2/TestLibrary.dll
05:22:38
Response file: /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll.rsp
/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/IL-CG2/TestLibrary.dll
-o:/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll
-r:/root/helix/work/correlation/System.*.dll
-r:/root/helix/work/correlation/Microsoft.*.dll
-r:/root/helix/work/correlation/xunit.*.dll
-r:/root/helix/work/correlation/mscorlib.dll
--verify-type-and-field-layout
--method-layout:random
--targetarch:arm
--targetos:linux
Running CrossGen2:  dotnet /root/helix/work/correlation/crossgen2/crossgen2.dll @/root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll.rsp  
Emitting R2R PE file: /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll
Running R2RDump:  dotnet /root/helix/work/correlation/R2RDump/R2RDump.dll --header --sc --in /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll --out /root/helix/work/workitem/e/Interop/PInvoke/CriticalHandles/Test/Test/TestLibrary.dll.r2rdump --val
05:22:40
in ReleaseLock
in takeLock
/root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true Test.dll ''
Test Failure: Xunit.Sdk.TrueException: Assert.True() Failure
Expected: True
Actual:   False
   at Xunit.Assert.True(Boolean condition) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 97
   at CriticalHandleTest.Ref()
   at Test.TestEntryPoint()
Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 100
Actual:   101
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 168
   at __GeneratedMainWrapper.Main()
in ReleaseLock
Expected: 100
Actual: 101
END EXECUTION - FAILED
Test failed. Trying to see if dump file was created in /home/helixbot/dotnetbuild/dumps since 6/24/2024 5:22:36 AM
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> /root/helix/work/workitem/e/Interop/Interop/../PInvoke/CriticalHandles/Test/Test/Test.sh

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at Xunit.Assert.True(Boolean condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 128
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor263|25_264(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass25_0&)
@v-wenyuxu v-wenyuxu added arch-arm32 os-linux Linux OS (any supported distro) GCStress blocking-clean-ci-optional Blocking optional rolling runs labels Jun 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 25, 2024
@v-wenyuxu
Copy link
Author

Failed in: runtime-coreclr gcstress0x3-gcstress0xc 20240714.1

Failed tests:

coreclr windows x64 Checked gcstress0x3 @ Windows.10.Amd64.Open
    - Interop/PInvoke/CriticalHandles/Test/Test/Test.cmd

Error message:

 
Return code:      1
Raw output file:      C:hwAD1D0946wB0D8099FuploadsPInvokeCriticalHandlesTestTestoutput.txt
Raw output:
BEGIN EXECUTION
 "C:hwAD1D0946pcorerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  Test.dll 
Test Failure: Xunit.Sdk.TrueException: Assert.True() Failure
Expected: True
Actual:   False
   at CriticalHandleTest.Ref()
   at Test.TestEntryPoint()
Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 100
Actual:   101
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 168
   at __GeneratedMainWrapper.Main()
Expected: 100
Actual: 101
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:cores since 7/14/2024 3:01:14 PM
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:hwAD1D0946wB0D8099FeInteropInterop../PInvoke/CriticalHandles/Test/Test/Test.cmd

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor263|25_264(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass25_0&)

@JulieLeeMSFT JulieLeeMSFT added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed area-crossgen2-coreclr labels Jul 15, 2024
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 15, 2024
@JulieLeeMSFT JulieLeeMSFT added this to the 9.0.0 milestone Jul 15, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@JulieLeeMSFT
Copy link
Member

@AndyAyersMS, PTAL.

@JulieLeeMSFT
Copy link
Member

Also failed in runtime-coreclr gcstress0x3-gcstress0xc/20240714.1

15:01:14.557 Running test: Interop/PInvoke/CriticalHandles/Test/Test/Test.cmd

Return code:      1
Raw output file:      C:\h\w\AD1D0946\w\B0D8099F\uploads\PInvoke\CriticalHandles\Test\Test\output.txt
Raw output:
BEGIN EXECUTION
 "C:\h\w\AD1D0946\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  Test.dll 
Test Failure: Xunit.Sdk.TrueException: Assert.True() Failure
Expected: True
Actual:   False
   at CriticalHandleTest.Ref()
   at Test.TestEntryPoint()
Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 100
Actual:   101
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 168
   at __GeneratedMainWrapper.Main()
Expected: 100
Actual: 101
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:\cores since 7/14/2024 3:01:14 PM
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:\h\w\AD1D0946\w\B0D8099F\e\Interop\Interop\../PInvoke/CriticalHandles/Test/Test/Test.cmd

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor263|25_264(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass25_0&)

@AndyAyersMS
Copy link
Member

I was able to repro this on windows x64, but it took 506 runs... doesn't feel like a codegen issue, but will keep looking.

@AndyAyersMS AndyAyersMS added the Priority:2 Work that is important, but not critical for the release label Jul 25, 2024
@AndyAyersMS
Copy link
Member

@VSadov does this seem like the kind of issue you're fixing with #105289?

@VSadov
Copy link
Member

VSadov commented Jul 25, 2024

Yes, it could be.

This test has a bunch of scenarios that rely on deterministic

        GC.Collect();
        GC.WaitForPendingFinalizers()

@VSadov
Copy link
Member

VSadov commented Jul 25, 2024

I saw your comment, but was waiting for my fix to go in and just suggest to wait for more failures, if they happen.

It is easy to rely on determinism of WaitForPendingFinalizers(), while not guaranteeing that the object is indeed unreachable. Then fixing WaitForPendingFinalizers() would not help.

It may take some more time for my fix to go in though. Hopefully less than an hour. I am waiting for GC stress to finish.
I do not expect any failures from GC stress, just want to be sure the fix does not mess up the GC stress itself, as that also has some special casing for WaitForPendingFinalizers

@VSadov
Copy link
Member

VSadov commented Jul 25, 2024

#105289 has been merged. Hopefully this issue will be fixed with that.

@AndyAyersMS
Copy link
Member

No failures over the weekend, so closing this.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm32 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs GCStress os-linux Linux OS (any supported distro) Priority:2 Work that is important, but not critical for the release
Projects
None yet
Development

No branches or pull requests

4 participants