Repository navigation
Closed
Labels
GCStressJitStressCLR JIT issues involving JIT internal stress modesCLR JIT issues involving JIT internal stress modesarch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runsBlocking optional rolling runsos-windows
Description
Failed in: runtime-coreclr gcstress-extra 20240225.1
Failed tests:
coreclr windows x64 Checked gcstress0xc_jitminopts_heapverify1 @ Windows.10.Amd64.Open
- JIT/Regression/JitBlue/Runtime_63942/Runtime_63942/Runtime_63942.cmd
R2R-CG2 windows x64 Checked jitminopts @ Windows.10.Amd64.Open
- JIT/Regression/JitBlue/Runtime_63942/Runtime_63942/Runtime_63942.cmd
coreclr windows x64 Checked jitminopts @ Windows.10.Amd64.Open
- JIT/Regression/JitBlue/Runtime_63942/Runtime_63942/Runtime_63942.cmd
Error message:
Assert failure(PID 3592 [0x00000e08], Thread: 9128 [0x23a8]): Assertion failed '((int)offs < 0) || emitComp->opts.IsOSR()' in 'System.SpanHelpers:Fill[ubyte](byref,ulong,ubyte)' during 'Generate code' (IL size 906; hash 0xd8592510; MinOpts)
File: D: _work1ssrccoreclrjitemitxarch.cpp:3876
Image: C:hwA06E08C0pcorerun.exe
Return code: 1
Raw output file: C:hwA06E08C0wA0EC08DFuploadsJitBlueRuntime_63942Runtime_63942output.txt
Raw output:
BEGIN EXECUTION
"C:hwA06E08C0pcorerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true" Runtime_63942.dll
Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:cores since 2/25/2024 11:08:14 PM
Processing C:corescorerun.exe.3592.dmp
Invoking: C:Program Files (x86)Windows Kits10Debuggersdcdb.exe -c "$<C:hwA06E08C0 mpv1i5sg.tmp" -z "C:corescorerun.exe.3592.dmp"
stdout:
Microsoft (R) Windows Debugger Version 10.0.18362.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:corescorerun.exe.3592.dmp]
User Mini Dump File with Full Memory: Only application data is available
************* Path validation summary **************
Response Time (ms) Location
OK C:hwA06E08C0pPDB
Symbol search path is: C:hwA06E08C0pPDB
Executable search path is:
Windows 10 Version 14393 MP (4 procs) Free x64
Product: Server, suite: TerminalServer DataCenter SingleUserTS
10.0.14393.6343 (rs1_release.230913-1727)
Machine Name:
Debug session time: Sun Feb 25 23:08:17.000 2024 (UTC + 0:00)
System Uptime: 0 days 0:33:35.118
Process Uptime: 0 days 0:00:03.000
............................
************* Symbol Loading Error Summary **************
Module name Error
ntdll The system cannot find the file specified
You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded.
You should also verify that your symbol search path (.sympath) is correct.
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(e08.23a8): Unknown exception - code c0000602 (first/second chance not available)
For analysis of this file, run !analyze -v
*** WARNING: Unable to verify checksum for coreclr.dll
KERNELBASE!RaiseFailFastException+0xae:
00007ffe`736d96ce 803d4d78120000 cmp byte ptr [KERNELBASE!local_unwind+0x7fe2 (00007ffe`73800f22)],0 ds:00007ffe`73800f22=00
0:000> cdb: Reading initial command '$<C:hwA06E08C0 mpv1i5sg.tmp'
0:000> .load C:Users
unner.dotnetsossos.dll
0:000> ~*k
. 0 Id: e08.23a8 Suspend: 0 Teb: 0000004f`83f2c000 Unfrozen
Child-SP RetAddr Call Site
0000004f`84176050 00007ffe`456140cc KERNELBASE!RaiseFailFastException+0xae
0000004f`84176620 00007ffe`44fa2aa6 coreclr!_DbgBreakCheck+0x2ec
*** WARNING: Unable to verify checksum for clrjit.dll
0000004f`84177790 00007ffe`484ea04c coreclr!CEEInfo::doAssert+0x76
0000004f`84177830 00007ffe`484e9c6a clrjit!assertAbort+0x13c
(Inline Function) --------`-------- clrjit!noWayAssertAbortHelper+0x17
0000004f`841798c0 00007ffe`48735219 clrjit!noWayAssertBodyConditional+0x4a
0000004f`841798f0 00007ffe`48734d4d clrjit!emitter::emitInsSizeSVCalcDisp+0x279
0000004f`84179940 00007ffe`4873b492 clrjit!emitter::emitInsSizeSV+0x13d
0000004f`841799a0 00007ffe`48719a93 clrjit!emitter::emitIns_R_S+0x1a2
(Inline Function) --------`-------- clrjit!CodeGen::genCodeForCpBlkUnroll::__l40::<lambda_1>::operator()+0x23
0000004f`84179a00 00007ffe`4871d0b8 clrjit!CodeGen::genCodeForCpBlkUnroll+0x3e3
0000004f`84179b10 00007ffe`4871fb8c clrjit!CodeGen::genCodeForStoreBlk+0x1b8
0000004f`84179b50 00007ffe`484ba10a clrjit!CodeGen::genCodeForTreeNode+0x141c
0000004f`84179d70 00007ffe`484b1d84 clrjit!CodeGen::genCodeForBBl
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)
at Program.<<Main>$>g__TestExecutor428|0_429(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)
Metadata
Metadata
Assignees
Labels
GCStressJitStressCLR JIT issues involving JIT internal stress modesCLR JIT issues involving JIT internal stress modesarch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runsBlocking optional rolling runsos-windows
Activity
BruceForstall commentedon Feb 27, 2024
This is a JIT assert; changing area to codegen
amanasifkhalid commentedon Feb 27, 2024
This is failing in runtime-coreclr jitstress, too.
JulieLeeMSFT commentedon Feb 27, 2024
@TIHan, PTAL. It is blocking clean ci optional. It is asserting in Generate Code.
TIHan commentedon Feb 28, 2024
Will do.
6 remaining items
tannergooding commentedon Feb 28, 2024
The reason why 3 may be difficult/not possible is because
BitCastis constrained (TFrom/TTo must be struct) but the calling API might not be. We do have options for that, like removing the constraints and doing the "is value type" check manually (which we've done in other places), would just need to work through that if that's the path opted for.BitCastends up working around the assert here because it is preserved as a call which throws if the sizes don't match, so we'd never get an "invalid" reinterpret cast leftover in the code the JIT sees.BruceForstall commentedon Feb 28, 2024
If the assert hits, we're going to generate code this is (probably) going to corrupt the stack (in this case, read garbage). In this case it looks like it's because we're unrolling a Vector256 store and the second instruction has a displacement that makes the ebp offset positive.
One way to fix this is to make all the asserts in
emitInsSizeSVCalcDispbased on the variable frame offset before adding the displacementdsp. This significantly weakens the asserts, but if we must allow unsafe code that is truly unsafe, then that might be a way to go.tannergooding commentedon Feb 28, 2024
Notably we're generating the code here, but it will never execute in this particular scenario because we have guards that ensure the path is only taken when the read would be valid. It's mostly getting generated because
MinOptsprevents the removal of definitely dead code so we get stuck with this unreachable extra logic.A user could certainly write such code themselves without the guards however, in which case we will generate the code and not hit any assert (since it will use the production JIT).
I expect the assert here was mostly to catch places where the JIT computes an incorrect offset, but that of course doesn't account for users doing it themselves (either "safely" due to the code being unreachable like we have, or "unsafely" because the user has written some incorrect code). Hence why I suggested 3 as an alternative fix, basically don't allow
MinOptsto see the code that is unreachable and would cause the assert, so our own code would never trigger it, but user code still might.TIHan commentedon Feb 28, 2024
I tried this, but the assert now gets hit a lot in normal cases. The change was this:
BruceForstall commentedon Feb 28, 2024
Except for these are
noway_assert, which hit in Release builds. They drop back to MinOpts, which wouldn't help in this case.Without this assert we might generate bad code, if we don't calculate the instruction size properly in the code that follows.
That's basically what I was thinking.
TIHan commentedon Feb 28, 2024
What do you recommend we do then?
tannergooding commentedon Feb 29, 2024
Any reason we don't just ensure we compute the size correctly in this case? I would've thought it already mostly just works since the logic for
[ebp+offset]is pretty static based on what the offset is and is ultimately shared with all other addressing mode paths.That is, any non-zero offset requires the
SIBmodifier. That offset for both 32-bit and 64-bit can be encoded as 1 or 4 bytes and is sign extended to the pointer width, thus any offset between[-128, +127]is 1-byte and anything else is 4-bytes. There's really not much to get wrong here in terms of instruction size prediction.SingleAccretion commentedon Mar 2, 2024
I am working on a change which will resolve this by not containing out-of-bounds access to locals, which is how we've been handling this problem so far.
v-wenyuxu commentedon Mar 4, 2024
Failed in: runtime-coreclr gcstress-extra 20240302.2
Failed tests:
Error message:
Stack trace: