[UWP] Bug report: .Net Native compiler crashing

ed123 6 Reputation points
2019-12-04T17:53:29.877+00:00

I am unable to compile UWP application in Release configuration when the following two lines added to the project:

public struct TestStruct { }
public delegate ref TestStruct TestDelegate();

The below is from the Output window:

1>------ Build started: Project: NetNativeCrash, Configuration: Release x64 ------
1> NetNativeCrash -> C:\Projects\NetNativeCrash\bin\x64\Release\NetNativeCrash.exe
1> Processing application code
1> Computing application closure and generating interop code
1> Loading 44 modules...
1> Generating code...
1> Interop code generated.
1> Compiling interop code
1> Generating System.Reflection.DispatchProxy proxy code.
1> Cleaning up unreferenced code
1> Generating native code
1>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.7-rel-27913-00\tools\Microsoft.NetNative.targets(801,5): error : ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x64.microsoft.net.native.compiler\2.2.7-rel-27913-00\tools\x64\ilc\Tools\nutc_driver.exe @"C:\Projects\NetNativeCrash\obj\x64\Release\ilc\intermediate\MDIL\NetNativeCrash.rsp"' returned exit code 2
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Universal Windows Platform (UWP)
0 comments No comments
{count} vote

4 answers

Sort by: Most helpful
  1. Daniel Ruse 6 Reputation points
    2020-12-02T10:49:35.943+00:00

    44395-image.png

    I have same problem when I try to run the application in release mode
    Did someone find an workaround ?

    1 person found this answer helpful.
    0 comments No comments

  2. Fay Wang - MSFT 5,196 Reputation points
    2019-12-05T02:59:29.283+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    From this error information, the nutc_driver crashes is often because of the compiler running out of memory. You could find a Properties folder under you project and open the "Default.rd.xml" file. There has the following code:

    < Assembly Name="*Application*" Dynamic="Required All" />
    

    Try to comment it out, this code means the compiler is told to consider all the code in your app used, so it may cause the exception. Then you can build you project again to check it. For more details about this error, you can refer to this thread.

    Thanks.


  3. Matthew Whilden 1 Reputation point
    2019-12-06T17:47:12.513+00:00

    Hello!

    Thanks for the report. This is a bug in the .NET Native optimizer. In particular, it appears to be running in to complications while building up the initial program graph. I've created an issue and assigned it to the appropriate folks to take a look. As this happens so early in that component, I have not found a way to work around the issue. In the mean time I suspect you'll need to avoid this construct.

    Some additional info always helps us with triage. Did you find this while developing a new app? Is it part of a larger package you rely on? etc.

    Matt
    .NET Native Runtime and Compiler team


  4. Joao 1 Reputation point
    2020-06-19T17:22:04.4+00:00

    Hi Matt,

    I'm facing the same issue when compiling an empty UWP project with the Microsoft.ML.ONNXRuntime dependency and the ".NET Native tool chain" option enabled.

    When using UWP 6.2.9 version, the compilation error is : ILT0021: Could not resolve method 'EETypeRva:0x00047188'

    With UWP 6.2.10 version: ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x64.microsoft.net.native.compiler\2.2.8-rel-28605-00\tools\x64\ilc\Tools\nutc_driver.exe @"C:\Src\uwp-sample-app\UWPSampleApp\obj\x64\Debug\ilc\intermediate\MDIL\UWP.Sample.App.rsp"' returned exit code 2

    Do you have any updates on this issue? Is this something that must be changed in the ONNXRuntime lib or is it a .NET native issue?

    0 comments No comments