Repository navigation
arm64 jitstress failing with encoding_found assert #61944
Description
We regressed somewhere in this range. Likely suspect in bold.
8275c37 Update DNNE version (#61738)
95e3144 Create runtime clone to manually kick off full test runs (#61641)
581d4d2 Hide 'align' instruction behind jmp (#60787)
7f874ee Remove race condition from DllImportGenerator build (#61695)
0d25969 [wasm][debugger] Tie sdb agent lifetime to the ExecutionContext and simplify the api (#61392)
66b31ca Upload dasm files as artifacts for "asmdiffs pipeline" (#61700)
30550d6 Remove DisableImplicitNamespaceImports_DotNet (#61656)
9962c10 src/tests tree test xunit-based source generated runner (#60846)
f9e3e28 Update docker image (#61217)
16300e0 Skip HardwareIntrinsics/x86base/Pause tests on Mono (#61743)
899bf97 Merge System.Security.Cryptography.Algorithms to System.Security.Cryptography
13024af HostFactoryResolver - Increase default timeout to thirty seconds (#61621)
8cf0b19 A few follow up changes to LookupTypeKey change (#61718)
25237fa Factor out and improve the vectorization of RegexInterpreter.FindFirstChar (#61490)
a508fb5 [DllImportGenerator] Enable on projects without System.Memory and System.Runtime.CompilerServices.Unsafe (#61704)
de883e3 Remove XUnit reference metadata from tests I switched over last week (#61691)
c03f4ec refactoring (#60074)
5331f21 Ignore missing data result from superpmi-replay run (#61699)
83661ff Remove some unnecessary slicing from generated Regex code (#61701)
44d28bf Extend RegexCharClass.Canonicalize range inversion optimization (#61562)
d1b3816 Minor File.ReadAllBytes* improvements (#61519)
10e107d [wasm][debugger] Fix evaluation of a static class attribute; using current namespace for evaluation (#61252)
0666ebc [mono][aot] Fix the inclusion of generic instances when doing profiled AOT. (#61627)
da0e0f7 [wasm] renames and cleanup before modularization (#61596)
Typical failure
Assert failure(PID 107 [0x0000006b], Thread: 107 [0x006b]): Assertion failed 'encoding_found' in 'Span.SpanBench:TestSpanFill(System.Byte[],int)' during 'Emit code' (IL size 37)
File: /__w/1/s/src/coreclr/jit/emitarm64.cpp Line: 2203
cc @dotnet/jit-contrib
Activity
AndyAyersMS commentedon Nov 23, 2021
Does indeed seem to be alignment related -- something about the interaction of alignment padding and STRESS_EMIT. Details soon.
AndyAyersMS commentedon Nov 23, 2021
When we switch to using breakpoints instead of nops under stress, we end up with the wrong form.
brkisIF_SI_0AnopisIF_SN_0AThink the fix may be simple...
AndyAyersMS commentedon Nov 23, 2021
Problem is only on non-windows, this is the likely culprit:
runtime/src/coreclr/jit/compiler.h
Lines 11987 to 11991 in 48fe637
Fix is either to use
INS_bkptexplicitly in this coderuntime/src/coreclr/jit/emitarm64.cpp
Lines 11457 to 11472 in 48fe637
or give up on this bit of stress until we can find another way to go about it.
AndyAyersMS commentedon Nov 23, 2021
Fixing the instruction is not enough. We also seem to emit these in places where they can be executed. For example:
So suggest for now we disable this bit of code.
kunalspathak commentedon Nov 23, 2021
I agree. Let's disable the emitting of bkpt/int3 on xarch/arm64 under stress mode. I will enable it once I get back.
Disable converting nop padding to breakpoints for arm64 under jit str…
AndyAyersMS commentedon Nov 23, 2021
I don't see this failing for xarch, so just disabled arm64 for now.
Disable changing align nop padding to breakpoints for arm64 under jit…
BruceForstall commentedon Nov 23, 2021
This is a dup of #61824
AndyAyersMS commentedon Nov 23, 2021
Hopefully worked around for now via #61951.
We possibly still may see failures from #61939.
kunalspathak commentedon Nov 28, 2021
From Armv8 manual:
So it seems that we should really check for Arm vs. Arm64 to decide whether to use
BKPTvs.BRK.@TamarChristinaArm - can you please confirm?
kunalspathak commentedon Nov 28, 2021
We already set
BKPTfor Arm32, but for Arm64, we useBRKin Unix andBKPTotherwise. Not sure why it was written like that.TamarChristinaArm commentedon Nov 29, 2021
Indeed, Arm64 should use
BRK, the encoding forBKPTis undefined on Arm64.From what I remember, this was because
BKPTwas used on Arm64 but with the encoding ofBRK. This was corrected in #892 (comment) But I guess this usage was missed. Perhaps it's easier to useINS_BREAKPOINThere? Which already seems to do platform abstractions.Note that the immediate also matters, from what I remember, GDB and Window need different immediates. Windows wants
0xf000and GDB will enter a signal loop for anything aside from0x0.kunalspathak commentedon Nov 29, 2021
Thanks @TamarChristinaArm .
I think below portion of your #892 (comment) was never done. I will do it in my upcoming PR.