Repository navigation
Closed
Labels
JitStressCLR JIT issues involving JIT internal stress modesPriority:3Work that is nice to havearch-x86area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
Looking at this failure: https://dev.azure.com/dnceng-public/public/_build/results?buildId=323067&view=ms.vss-test-web.build-test-results-tab&runId=6640628&resultId=201899&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab
Console log: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-88090-merge-db22b0df4ffd4c4bae/System.Runtime.Serialization.Xml.Tests/1/console.c66fcf9f.log?helixlogtype=result
C:\h\w\C0A909A9\w\A6330968\e>set DOTNET
DOTNET_JitStress=2
DOTNET_TieredCompilation=0
C:\h\w\C0A909A9\w\A6330968\e>call RunTests.cmd --runtime-path C:\h\w\C0A909A9\p
----- start Wed 06/28/2023 5:16:38.33 =============== To repro directly: =====================================================
pushd C:\h\w\C0A909A9\w\A6330968\e\
"C:\h\w\C0A909A9\p\dotnet.exe" exec --runtimeconfig System.Runtime.Serialization.Xml.Tests.runtimeconfig.json --depsfile System.Runtime.Serialization.Xml.Tests.deps.json xunit.console.dll System.Runtime.Serialization.Xml.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
popd
===========================================================================================================
C:\h\w\C0A909A9\w\A6330968\e>"C:\h\w\C0A909A9\p\dotnet.exe" exec --runtimeconfig System.Runtime.Serialization.Xml.Tests.runtimeconfig.json --depsfile System.Runtime.Serialization.Xml.Tests.deps.json xunit.console.dll System.Runtime.Serialization.Xml.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
Discovering: System.Runtime.Serialization.Xml.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Runtime.Serialization.Xml.Tests (found 279 of 280 test cases)
Starting: System.Runtime.Serialization.Xml.Tests (parallel test collections = on, max threads = 4)
Assert failure(PID 904 [0x00000388], Thread: 1924 [0x0784]): !CREATE_CHECK_STRING(!"Detected use of a corrupted OBJECTREF. Possible GC hole.")
CORECLR! GetCLRRuntimeHost + 0xEE190 (0x72415e80)
CORECLR! GetCLRRuntimeHost + 0xEDC38 (0x72415928)
CORECLR! GetCLRRuntimeHost + 0xE97F6 (0x724114e6)
CORECLR! GetCLRRuntimeHost + 0x173CB1 (0x7249b9a1)
CORECLR! GetCLRRuntimeHost + 0x173B6B (0x7249b85b)
<no module>! <no symbol> + 0x0 (0x0d748f93)
<no module>! <no symbol> + 0x0 (0x0d8dedbe)
<no module>! <no symbol> + 0x0 (0x0d748360)
<no module>! <no symbol> + 0x0 (0x0b4d1184)
SYSTEM.PRIVATE.CORELIB! <no symbol> + 0x0 (0x714dfc74)
File: D:\a\_work\1\s\src\coreclr\vm\object.cpp Line: 600
Image: C:\h\w\C0A909A9\p\dotnet.exe
Note that this is win-x86. It reproduces locally for me on every run with DOTNET_TieredCompilation=0, DOTNET_JitStress=2 and DOTNET_GCStress=c.
Metadata
Metadata
Assignees
Labels
JitStressCLR JIT issues involving JIT internal stress modesPriority:3Work that is nice to havearch-x86area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Activity
jakobbotsch commentedon Jun 28, 2023
Also repros consistently with
-maxthreads 1 -parallel none -method System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export_NegativeCases, so seems quite deterministic.BruceForstall commentedon Jul 7, 2023
Stack trace is
I can repro with:
Note that we're in the
faulthandler of atry/fault, which is itself nested within thetryclause of atry/filter/filter-handlerclause.In the JitDump, the fragment looks like:
BruceForstall commentedon Jul 7, 2023
@janvorli Can you take a look at this? It seems like an object used by
TransitionFramemust not be properly protected somewhere. The code is in afaultblock, so perhaps the EH system is breaking something?janvorli commentedon Jul 18, 2023
I'll take a look.
janvorli commentedon Jul 19, 2023
I've reproduced it locally and investigated it. The problem always occurs at the same place when GC is triggered in the exception filter in the
System.Runtime.Serialization.XsdDataContractExporter.Exportmethod. The filter is supposed to report references of its parent too, but it doesn't do that and that causes the GC hole. Here is a disass of the method including the GC and EH info. The affected slot is the [EBP-2Ch]. The stack walk first reports the frame of the filter at 1324D2DC and then the frame of its parent at 1324D234. As you can see from the list of valid ranges for the [EBP-2CH], the 1324D234 (offset 0xb4) is covered by the range 004F..012A, but the 1324D2DC (offset 15c) is not covered.So, I believe it is a problem of incorrect GC info for the filter.
BruceForstall commentedon Jul 20, 2023
Thank you @janvorli for the investigation!
It turns out this same issue was found and fixed with dotnet/coreclr#23044, but that fix had a minor problem with top-level
filterclauses. I've put up a fix with #89228.Fix GC hole with `filter` liveness
JIT: Fix handling of filter successors
JIT: Fix handling of filter successors (#89275)