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 JIT\\HardwareIntrinsics\\Arm\\AdvSimd.Arm64\\AdvSimd.Arm64_Part2_r\\AdvSimd.Arm64_Part2_r.cmd #65281

Closed
VincentBu opened this issue Feb 14, 2022 · 6 comments · Fixed by #73738
Assignees
Labels
arch-arm64 area-crossgen2-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro) os-windows
Milestone

Comments

@VincentBu
Copy link
Contributor

VincentBu commented Feb 14, 2022

Run: runtime-coreclr outerloop 20220213.2

Failed test:

R2R-CG2 windows arm64 Checked @ Windows.10.Arm64v8.Open

- JIT\\HardwareIntrinsics\\Arm\\AdvSimd.Arm64\\AdvSimd.Arm64_Part2_ro\\AdvSimd.Arm64_Part2_ro.cmd
- JIT\\HardwareIntrinsics\\Arm\\AdvSimd.Arm64\\AdvSimd.Arm64_Part2_r\\AdvSimd.Arm64_Part2_r.cmd

R2R-CG2 windows arm64 Checked no_tiered_compilation @ Windows.10.Arm64v8.Open

- JIT\\HardwareIntrinsics\\Arm\\AdvSimd.Arm64\\AdvSimd.Arm64_Part2_ro\\AdvSimd.Arm64_Part2_ro.cmd
- JIT\\HardwareIntrinsics\\Arm\\AdvSimd.Arm64\\AdvSimd.Arm64_Part2_r\\AdvSimd.Arm64_Part2_r.cmd

R2R-CG2 Linux arm64 Checked no_tiered_compilation @ (Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r/AdvSimd.Arm64_Part2_r.sh

R2R-CG2 Linux arm64 Checked no_tiered_compilation @ (Alpine.314.Arm64.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-arm64v8-20210910135810-8a6f4f3

- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r/AdvSimd.Arm64_Part2_r.sh

R2R-CG2 Linux arm64 Checked @ (Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro/AdvSimd.Arm64_Part2_ro.sh
- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r/AdvSimd.Arm64_Part2_r.sh

R2R-CG2 Linux arm64 Checked @ (Alpine.314.Arm64.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-arm64v8-20210910135810-8a6f4f3

- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro/AdvSimd.Arm64_Part2_ro.sh
- JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r/AdvSimd.Arm64_Part2_r.sh

Error message:

Could Not Find D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\IL-CG2\composite-r2r.dll
Could Not Find D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.dll.rsp
Could Not Find D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\TestLibrary.dll.rsp

Assert failure(PID 5444 [0x00001544], Thread: 12672 [0x3180]): Verify_TypeLayout 'TestStruct' failed to verify type layout

CORECLR! LoadDynamicInfoEntry + 0x10C0 (0x00007ff8132d27d8) CORECLR! Module::FixupNativeEntry + 0x6C (0x00007ff81325077c)
CORECLR! Module::FixupDelayListAux<Module ,int (__cdecl Module::)(CORCOMPILE_IMPORT_SECTION *,unsigned __int64,unsigned __int64 *,int)> + 0x18C (0x00007ff813393094) CORECLR! ReadyToRunInfo::GetEntryPoint + 0x2F4 (0x00007ff813394224)
CORECLR! MethodDesc::GetPrecompiledR2RCode + 0x38 (0x00007ff81332e5e0) CORECLR! MethodDesc::GetPrecompiledCode + 0x28 (0x00007ff81332e3b8)
CORECLR! MethodDesc::PrepareILBasedCode + 0x2AC (0x00007ff813330404) CORECLR! MethodDesc::PrepareCode + 0x54 (0x00007ff81333014c)
CORECLR! CodeVersionManager::PublishVersionableCodeIfNecessary + 0x2A8 (0x00007ff813277100) CORECLR! MethodDesc::DoPrestub + 0x344 (0x00007ff81332c054)
File: D:\a_work\1\s\src\coreclr\vm\jitinterface.cpp Line: 13513
Image: D:\h\w\A1B208CC\p\corerun.exe

Return code:      1
Raw output file:      D:\h\w\A1B208CC\w\A405093D\uploads\Reports\JIT.HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.output.txt
Raw output:
BEGIN EXECUTION
AdvSimd.Arm64_Part2_ro.dll
TestLibrary.dll
2 file(s) copied.
Response file: D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.dll.rsp
D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\IL-CG2\AdvSimd.Arm64_Part2_ro.dll
-o:D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.dll
--targetarch:arm64
--verify-type-and-field-layout
--method-layout:random
-r:D:\h\w\A1B208CC\p\System..dll
-r:D:\h\w\A1B208CC\p\Microsoft..dll
-r:D:\h\w\A1B208CC\p\mscorlib.dll
-r:D:\h\w\A1B208CC\p\netstandard.dll
-O
" "dotnet" "D:\h\w\A1B208CC\p\crossgen2\crossgen2.dll" @"D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.dll.rsp"   -r:D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\IL-CG2*.dll"
Emitting R2R PE file: D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\AdvSimd.Arm64_Part2_ro.dll
Response file: D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\TestLibrary.dll.rsp
D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\IL-CG2\TestLibrary.dll
-o:D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\TestLibrary.dll
--targetarch:arm64
--verify-type-and-field-layout
--method-layout:random
-r:D:\h\w\A1B208CC\p\System..dll
-r:D:\h\w\A1B208CC\p\Microsoft..dll
-r:D:\h\w\A1B208CC\p\mscorlib.dll
-r:D:\h\w\A1B208CC\p\netstandard.dll
-O
" "dotnet" "D:\h\w\A1B208CC\p\crossgen2\crossgen2.dll" @"D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\TestLibrary.dll.rsp"   -r:D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\IL-CG2*.dll"
Emitting R2R PE file: D:\h\w\A1B208CC\w\A405093D\e\JIT\HardwareIntrinsics\Arm\AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro\TestLibrary.dll
"D:\h\w\A1B208CC\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  AdvSimd.Arm64_Part2_ro.dll
Supported ISAs:
AdvSimd:   True
Aes:       True
ArmBase:   True


Stack trace
   at JIT_HardwareIntrinsics._Arm_AdvSimd_Arm64_AdvSimd_Arm64_Part2_ro_AdvSimd_Arm64_Part2_ro_._Arm_AdvSimd_Arm64_AdvSimd_Arm64_Part2_ro_AdvSimd_Arm64_Part2_ro_cmd()

NOTE: AdvSimd.Arm64\AdvSimd.Arm64_Part2_r and AdvSimd.Arm64\AdvSimd.Arm64_Part2_ro are disabled by #65227.

Please re-enable these tests when the issue is fixed!

@VincentBu VincentBu added arch-arm64 os-linux Linux OS (any supported distro) os-windows blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs labels Feb 14, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added area-crossgen2-coreclr untriaged New issue has not been triaged by the area owner labels Feb 14, 2022
@echesakov
Copy link
Contributor

echesakov commented Feb 14, 2022

Here is a simplest program I managed to create to reproduce the issue (also pushed it to my clone of the repo - 14bce9a)

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;

class Runtime_63856
{
    [StructLayout(LayoutKind.Auto)]
    struct int8x16x2
    {
        Vector128<byte> _0;
        Vector128<byte> _1;
    }

    struct Wrapper
    {
        int8x16x2 fld;
    }

    static int Main()
    {
        var val = default(Wrapper);

        return 100;
    }
}

Note that [StructLayout(LayoutKind.Auto)] is required to trigger the issue (ValueTuple<T1,T2> in the failing tests also has the attribute).

When running on Arm64 with

RunCrossgen2=1

this will fail the following way

X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856>Runtime_63856\Runtime_63856.cmd
BEGIN EXECUTION
Runtime_63856.dll
        1 file(s) copied.
Could Not Find X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\IL-CG2\composite-r2r.dll
Could Not Find X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\Runtime_63856.dll.rsp
Response file: X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\\Runtime_63856.dll.rsp
X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\IL-CG2\Runtime_63856.dll
-o:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\\Runtime_63856.dll
--targetarch:arm64
--verify-type-and-field-layout
--method-layout:random
-r:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\System.*.dll
-r:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\Microsoft.*.dll
-r:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\mscorlib.dll
-r:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\netstandard.dll
-O
" "dotnet" "X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\crossgen2\crossgen2.dll" @"X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\\Runtime_63856.dll.rsp"   -r:X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\IL-CG2\*.dll"
Emitting R2R PE file: X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\JIT\Regression\JitBlue\Runtime_63856\Runtime_63856\\Runtime_63856.dll
 "X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_63856.dll
Type Wrapper: expected alignment 0x00000008, actual 0x00000010

Assert failure(PID 34016 [0x000084e0], Thread: 35932 [0x8c5c]): Verify_TypeLayout 'Wrapper' failed to verify type layout

CORECLR! LoadDynamicInfoEntry + 0xF18 (0x00007fff`79520c68)
CORECLR! Module::FixupNativeEntry + 0x6C (0x00007fff`794a1abc)
CORECLR! Module::FixupDelayListAux<Module *,int (__cdecl Module::*)(CORCOMPILE_IMPORT_SECTION *,unsigned __int64,unsigned __int64 *,int)> + 0x194 (0x00007fff`795e03a4)
CORECLR! ReadyToRunInfo::GetEntryPoint + 0x2F4 (0x00007fff`795e1534)
CORECLR! MethodDesc::GetPrecompiledR2RCode + 0x38 (0x00007fff`7957b768)
CORECLR! MethodDesc::GetPrecompiledCode + 0x28 (0x00007fff`7957b540)
CORECLR! MethodDesc::PrepareILBasedCode + 0x2A0 (0x00007fff`7957d3d8)
CORECLR! MethodDesc::PrepareCode + 0x54 (0x00007fff`7957d12c)
CORECLR! CodeVersionManager::PublishVersionableCodeIfNecessary + 0x2AC (0x00007fff`794c705c)
CORECLR! MethodDesc::DoPrestub + 0x344 (0x00007fff`79579074)
    File: D:\echesako\src\runtime3\src\coreclr\vm\jitinterface.cpp Line: 13513
    Image: X:\echesako\src\runtime3\artifacts\tests\coreclr\windows.arm64.checked\Tests\Core_Root\corerun.exe

Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED

@echesakov
Copy link
Contributor

@mangod9 Can someone on your team take a look at this issue?
I propose disabling the failing tests under R2R-GC2 and submitted PR last week to do this (#65227).

@echesakov echesakov added the disabled-test The test is disabled in source code against the issue label Feb 14, 2022
echesakov added a commit to echesakov/runtime that referenced this issue Feb 14, 2022
@mangod9
Copy link
Member

mangod9 commented Feb 14, 2022

@AaronRobinsonMSFT @davidwrighton if this is a new failure is it related to the ref fields work?

@trylek trylek added this to the 7.0.0 milestone Jun 14, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jun 14, 2022
@mangod9
Copy link
Member

mangod9 commented Aug 3, 2022

@davidwrighton is this something you could look into since its related to intrinsics?

@mangod9 mangod9 assigned davidwrighton and unassigned mangod9 Aug 4, 2022
@davidwrighton
Copy link
Member

This isn't intrinsics, this is struct layout, but fortunately enough while this failure is enough to break the test, it shouldn't actually break customers. However, lack of testing of the intrinsics is a problem so it does need to be fixed.

@davidwrighton
Copy link
Member

Ok, this is actually a general purpose AutoLayout bug impacting the alignment calculations for structures. We were improperly computing a the wrong alignment in a number of scenarios. (Sometimes too high, sometimes too low.). Given the general lack of autolayout structures, this probably isn't a terribly impacting bug, but it likely does reduce the set of functions that can be used out of an R2R image if ValueTuple is used, and for applications which hold ValueTuple within the version bubble of the app, larger problems may arise. (Also its a problem if ValueTuple starts being used in CoreLib.)

davidwrighton added a commit to davidwrighton/runtime that referenced this issue Aug 11, 2022
- In particular:
  1. The alignment requirement imposed by of a non-primitive, non-enum valuetype field is the alignment of that field
  2. The alignment requirement imposed by a primitive is the pointer size of the target platform, unless running on Arm32, in which case if the primitive or enum is 8 bytes in size, the alignment requirement is 8.

- The previous implementation produced an alignment of pointer size, unless running on Arm32 and one of the fields had an alignment requirement of 8 (in which case the alignment requirement computed for the structure would be 8)

In addition, add a test which verifies that the instance field layout test types are actually producing R2R compatible results at runtime.
 - This test shows that we have some issues around explicit layout, so I was forced to disable that portion of the test for now.

Fixes dotnet#65281
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 11, 2022
davidwrighton added a commit that referenced this issue Aug 17, 2022
…73738)

* New test

* Fix auto layout algorithm to compute structure alignment correctly
- In particular:
  1. The alignment requirement imposed by of a non-primitive, non-enum valuetype field is the alignment of that field
  2. The alignment requirement imposed by a primitive is the pointer size of the target platform, unless running on Arm32, in which case if the primitive or enum is 8 bytes in size, the alignment requirement is 8.

- The previous implementation produced an alignment of pointer size, unless running on Arm32 and one of the fields had an alignment requirement of 8 (in which case the alignment requirement computed for the structure would be 8)

In addition, add a test which verifies that the instance field layout test types are actually producing R2R compatible results at runtime.
 - This test shows that we have some issues around explicit layout, so I was forced to disable that portion of the test for now.

Fixes #65281

Co-authored-by: Tomas Rylek <trylek@microsoft.com>
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 17, 2022
github-actions bot pushed a commit that referenced this issue Aug 17, 2022
…In particular: 1. The alignment requirement imposed by of a non-primitive, non-enum valuetype field is the alignment of that field 2. The alignment requirement imposed by a primitive is the pointer size of the target platform, unless running on Arm32, in which case if the primitive or enum is 8 bytes in size, the alignment requirement is 8.

- The previous implementation produced an alignment of pointer size, unless running on Arm32 and one of the fields had an alignment requirement of 8 (in which case the alignment requirement computed for the structure would be 8)

In addition, add a test which verifies that the instance field layout test types are actually producing R2R compatible results at runtime.
 - This test shows that we have some issues around explicit layout, so I was forced to disable that portion of the test for now.

Fixes #65281
carlossanlop pushed a commit that referenced this issue Aug 18, 2022
…nment correctly (#74091)

* New test

* Fix auto layout algorithm to compute structure alignment correctly - In particular: 1. The alignment requirement imposed by of a non-primitive, non-enum valuetype field is the alignment of that field 2. The alignment requirement imposed by a primitive is the pointer size of the target platform, unless running on Arm32, in which case if the primitive or enum is 8 bytes in size, the alignment requirement is 8.

- The previous implementation produced an alignment of pointer size, unless running on Arm32 and one of the fields had an alignment requirement of 8 (in which case the alignment requirement computed for the structure would be 8)

In addition, add a test which verifies that the instance field layout test types are actually producing R2R compatible results at runtime.
 - This test shows that we have some issues around explicit layout, so I was forced to disable that portion of the test for now.

Fixes #65281

* Re-enable disabled test

* Remove file that shouldn't be added as part of the new test

* Make a few test types public to silence unassigned field errors

* Update comments and add more testing

Co-authored-by: David Wrighton <davidwr@microsoft.com>
Co-authored-by: Tomas Rylek <trylek@microsoft.com>
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-crossgen2-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro) os-windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants