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

[RyuJIT/xarch] Assertion failed 'child->isContained()' in src/jit/lsraxarch.cpp Line: 494 #9472

Closed
4creators opened this issue Dec 27, 2017 · 3 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug
Milestone

Comments

@4creators
Copy link
Contributor

CI in PR dotnet/coreclr#15585 was failing for some optimized tests only (#15618 was fixed in my PR with solution from dotnet/coreclr#15637) with the following errors:

Windows_NT x86 Checked Innerloop Build and Test

Assert failure(PID 7592 [0x00001da8], Thread: 11900 [0x2e7c]): Assertion failed 'child->isContained()' in 'IntelHardwareIntrinsicTest.Program:Main(ref):int' (IL size 1287)
             File: d:\j\workspace\x86_checked_w---b3a226f6\src\jit\lsraxarch.cpp Line: 494
             Image: D:\j\workspace\x86_checked_w---b3a226f6\bin\tests\Windows_NT.x86.Checked\Tests\Core_Root\CoreRun.exe

Identical asserts were hit for:
Windows_NT x86 Checked Innerloop Build and Test https://ci.dot.net/job/dotnet_coreclr/job/master/job/x86_checked_windows_nt_prtest/13677/
Ubuntu x64 Checked Innerloop Build and Test https://ci.dot.net/job/dotnet_coreclr/job/master/job/checked_ubuntu_flow_prtest/14336/
OSX10.12 x64 Checked Innerloop Build and Test https://ci.dot.net/job/dotnet_coreclr/job/master/job/checked_osx10.12_flow_prtest/10570/
CentOS7.1 x64 Checked Innerloop Build and Test https://ci.dot.net/job/dotnet_coreclr/job/master/job/checked_centos7.1_flow_prtest/2090/

It was possible to create minimum repro for the assertion:

using System;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

namespace IntelHardwareIntrinsicTest
{
    internal static partial class Program
    {
        static unsafe int Main(string[] args)
        {
            if (Sse2.IsSupported)
            {
                using (var doubleTable = TestTableVector128<double>.Create(testsCount))
                {
                    (Vector128<double>, Vector128<double>, Vector128<double>) value = doubleTable[i];
                    doubleTable.SetOutArray(Sse2.Add(value.Item1, value.Item2));                  // => this call triggers assert
                }
            }
            return 0;
        }
    }
}

The workaround for the issue is quite simple, it is enough to create local variable which will receive value from Sse2.Add(value.Item1, value.Item2) call before passing it to doubleTable.SetOutArray i.e..

                    var result = Sse2.Add(value.Item1, value.Item2);
                    doubleTable.SetOutArray(result);

The assert is hit for all Sse2 methods tested so far when built with optimization. TestTableVector128 codes used in test case can be found here:
https://github.com/dotnet/coreclr/pull/15585/files#diff-a673f392be079e241929d6095941fa16

@tannergooding
Copy link
Member

@4creators, dotnet/coreclr#15640 sets up the basic infrastructure, for hardware intrinsics, so you can mark gtOps as contained.

@4creators
Copy link
Contributor Author

@tannergooding Thanks - will use it in my PR.

@4creators
Copy link
Contributor Author

Closing as this bug was fixed.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug
Projects
None yet
Development

No branches or pull requests

3 participants