Skip to content

Access violation while finding shadow stack pointer in nativeaot/SmokeTests/UnitTests #104628

Closed
@jakobbotsch

Description

@jakobbotsch

When I run this test locally in checked on win-x64 I get the following failure:

===== Running test BasicThreading.Run =====
FinalizeTest passed
===== Test BasicThreading.Run succeeded =====
===== Running test Delegates.Run =====
Testing delegates to value types...OK
Testing delegates to virtual methods...OK
Testing delegates to interface methods...OK
Testing static open and closed delegates...OK
Testing multicast delegates...OK
Testing dynamic invoke...OK
Testing LINQ Expressions...
Testing default interface methods...
===== Test Delegates.Run succeeded =====
===== Running test Generics.Run =====
Base.GMethod1<System.Int32>(1,2)
Base.IMethod1<System.Int32>(3,4)
Base.IMethod1<System.Int32>(5,6)
Base.IMethod1<System.Int32>(7,8)
====================
Derived.GMethod1<System.Int32>(1,2)
Derived.IFoo<string>.IMethod1<System.Int32>(3,4)
Derived.IFoo<string>.IMethod1<System.Int32>(5,6)
Base.IMethod1<System.Int32>(7,8)
====================
Derived.GMethod1<System.Int32>(1,2)
Derived.IFoo<string>.IMethod1<System.Int32>(3,4)
Derived.IFoo<string>.IMethod1<System.Int32>(5,6)
SuperDerived.IFoo<int>.IMethod1<System.Int32>(7,8)
====================
GenBase<System.Byte>.GMethod1<System.Int32>(1,2)
GenBase<System.Byte>.IMethod1<System.Int32>(3,4)
GenBase<System.Byte>.IMethod1<System.Int32>(5,6)
GenBase<System.Byte>.IMethod1<System.Int32>(7,8)
====================
GenDerived<System.Byte>.GMethod1<System.Int32>(1,2)
GenDerived<System.Byte>.IFoo<string>.IMethod1<System.Int32>(3,4)
GenDerived<System.Byte>.IFoo<string>.IMethod1<System.Int32>(5,6)
GenBase<System.Byte>.IMethod1<System.Int32>(7,8)
====================
GenDerived<System.String>.GMethod1<System.Int32>(1,2)
GenDerived<System.String>.IFoo<string>.IMethod1<System.Int32>(3,4)
GenDerived<System.String>.IFoo<string>.IMethod1<System.Int32>(5,6)
GenBase<System.String>.IMethod1<System.Int32>(7,8)
====================
GenDerived<System.Byte>.GMethod1<System.Int32>(1,2)
GenDerived<System.Byte>.IFoo<string>.IMethod1<System.Int32>(3,4)
GenDerived<System.Byte>.IFoo<string>.IMethod1<System.Int32>(5,6)
GenSuperDerived<System.Byte>.IFoo<int>.IMethod1<System.Int32>(7,8)
====================
MyStruct1.IFoo<string>.IMethod1<System.Int32>(1,2)
MyStruct1.IFoo<string>.IMethod1<System.Int32>(3,4)
MyStruct1.IFoo<int>.IMethod1<System.Int32>(5,6)
====================
MyStruct2.IFoo<string>.IMethod1<System.Int32>(1,2)
MyStruct2.IFoo<string>.IMethod1<System.Int32>(3,4)
MyStruct2.IMethod1<System.Int32>(5,6)
====================
MyStruct3.IMethod1<System.Int32>(1,2)
MyStruct3.IMethod1<System.Int32>(3,4)
MyStruct3.IFoo<int>.IMethod1<System.Int32>(5,6)
====================
AnotherBaseClass.IFaceGVMethod1
BarImplementor:123
YahooDerived:456
Covariant<String>.ICovariantGVM<Exception>
Accepted
Foo<ClassType> cctor
Foo<StructType> cctor
Bar cctor
Testing static fields on type Foo<ClassType> ...
Testing static fields on type Foo<StructType> ...
Testing static fields on type Bar ...
Testing instance fields on type Foo<ClassType> ...
Testing instance fields on type Foo<StructType> ...
Testing instance fields on type Bar ...
Foo<Object> cctor
Foo<ClassType2> cctor
Testing dynamic invoke stubs...
GenericDerived<System.Object>.Get<System.String>
--------------------------------------------------
Debug Assertion Violation

Message: Hardware exception raised inside the runtime.

Expression: 'ASSERT_UNCONDITIONALLY'

File: C:\dev\dotnet\runtime2\src\coreclr\nativeaot\Runtime\EHHelpers.cpp, Line: 651

If I attach VS then I see an access violation on the cmp in this loop:

;; Find the shadow stack pointer for the frame we are going to restore to.
;; The SSP we search is pointing to the return address of the frame represented
;; by the passed in context. So we search for the instruction pointer from
;; the context and return one slot up from there.
;; (Same logic as in GetSSPForFrameOnCurrentStack)
xor r11, r11
@@: inc r11
cmp [r9 + r11 * 8 - 8], r10
jne @b

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions