runtime icon indicating copy to clipboard operation
runtime copied to clipboard

netcoreapp2.0 - System.AccessViolationException using native dll

Open darkengines opened this issue 9 years ago • 2 comments

Sorry if this is not the right place for this issue.

Steps to reproduce

Create a new netcoreapp2.0 project

  • Add reference to Google.OrTools
  • Set target platform to x64
  • Use the following Main function:
static void Main(string[] args) {
    var solver = new Solver("Test");
}
  • Run

Expected behavior

The solver should be instanciated and the program should terminate without exception.

Actual behavior

The solver instanciation throws an exception: System.AccessViolationException : 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

Environment data

dotnet --info output:

Outils en ligne de commande .NET (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Notes

The library currently works on the net46 framework. An issue is also opened on the google side: https://github.com/google/or-tools/issues/463

Question

Knowing that this dll uses a Swig wrapper, is there any indication that could be provided to https://github.com/google/or-tools/issues/463?

darkengines avatar Sep 27 '17 00:09 darkengines

Google.OrTools.dll is C++/CLI assembly. C++/CLI is not supported by .NET Core. We should try to add better error message for this instead of a random AV.

jkotas avatar Sep 27 '17 01:09 jkotas

This issue was moved to dotnet/coreclr#14212

jkotas avatar Sep 27 '17 02:09 jkotas