Skip to content

RemoteExecutor crashes on NET Framework 4.7.2 with Microsoft.Net.Compilers.Toolset > 3.3.1 #51178

@JimBobSquarePants

Description

@JimBobSquarePants
  • This issue is blocking
  • This issue is causing unreasonable pain

I haven't managed to create an isolated example yet but the following exception is thrown for all implementations of RemoteExecutor for methods containing a generic parameter if I use Microsoft.Net.Compilers.Toolset > 3.3.1 in a unit test targeting NET 4.7.2

  • No exceptions are thrown with NET Core in all tested Microsoft.Net.Compilers.Toolset versions up to and including 3.8.0-3.final.
  • Microsoft.Net.Compilers.Toolset 3.3.1 works without error on NET 4.7.2
Message: 
    Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
  Stack Trace: 
    Child exception:
      System.InvalidOperationException: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.
    RuntimeMethodInfo.ThrowNoInvokeException()
    RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    Program.Main(String[] args) line 54
    Child process:
      SixLabors.ImageSharp.Tests, Version=0.0.1.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13 SixLabors.ImageSharp.Tests.Formats.Png.PngEncoderTests Void <EncodeWorksWithoutSsse3Intrinsics>g__RunTest|32_0[TPixel](System.String)
    Child arguments:
      U2l4TGFib3JzLkltYWdlU2hhcnAuVGVzdHMuVGVzdEltYWdlUHJvdmlkZXJgMStUZXN0UGF0dGVyblByb3ZpZGVyW1tTaXhMYWJvcnMuSW1hZ2VTaGFycC5QaXhlbEZvcm1hdHMuUmdiYTMyLCBTaXhMYWJvcnMuSW1hZ2VTaGFycCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWQ5OThlZWE3YjE0Y2FiMTNdXQ0Kd2lkdGg6MTAwDQpoZWlnaHQ6MTAwDQpQaXhlbFR5cGU6UmdiYTMyDQpUeXBlTmFtZTpQbmdFbmNvZGVyVGVzdHMNCk1ldGhvZE5hbWU6RW5jb2RlV29ya3NXaXRob3V0U3NzZTNJbnRyaW5zaWNzDQpPdXRwdXRTdWJmb2xkZXJOYW1lOg0K

I attached a local build and attempted to debug. There's no difference in the method name arguments passed to the process.

testConsoleAppArgs

 "SixLabors.ImageSharp.Tests, Version=0.0.1.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13" SixLabors.ImageSharp.Tests.Formats.Png.PngEncoderTests <EncodeWorksWithoutSsse3Intrinsics>g__RunTest|32_0 C:\Users\james\AppData\Local\Temp\3bozqbqd.fwy U2l4TGFib3JzLkltYWdlU2hhcnAuVGVzdHMuVGVzdEltYWdlUHJvdmlkZXJgMStUZXN0UGF0dGVyblByb3ZpZGVyW1tTaXhMYWJvcnMuSW1hZ2VTaGFycC5QaXhlbEZvcm1hdHMuUmdiYTMyLCBTaXhMYWJvcnMuSW1hZ2VTaGFycCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWQ5OThlZWE3YjE0Y2FiMTNdXQ0Kd2lkdGg6MTAwDQpoZWlnaHQ6MTAwDQpQaXhlbFR5cGU6UmdiYTMyDQpUeXBlTmFtZTpQbmdFbmNvZGVyVGVzdHMNCk1ldGhvZE5hbWU6RW5jb2RlV29ya3NXaXRob3V0U3NzZTNJbnRyaW5zaWNzDQpPdXRwdXRTdWJmb2xkZXJOYW1lOg0K

Here's an example unit test

        [Theory]
        [WithTestPatternImages(100, 100, PixelTypes.Rgba32)]
        public void EncodeWorksWithoutSsse3Intrinsics<TPixel>(TestImageProvider<TPixel> provider)
            where TPixel : unmanaged, IPixel<TPixel>
        {
            static void RunTest(string providerDump)
            {
                TestImageProvider<TPixel> provider =
                    BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
#if SUPPORTS_RUNTIME_INTRINSICS
                Assert.False(Ssse3.IsSupported);
#endif

                foreach (PngInterlaceMode interlaceMode in InterlaceMode)
                {
                    TestPngEncoderCore(
                        provider,
                        PngColorType.Rgb,
                        PngFilterMethod.Adaptive,
                        PngBitDepth.Bit8,
                        interlaceMode,
                        appendPixelType: true,
                        appendPngColorType: true);
                }
            }

Update. This looks to be affecting NET Core on Ubuntu also

https://github.com/SixLabors/ImageSharp/pull/1378/checks?check_run_id=1256202313#step:6:351

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CompilersuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions