- Notifications
You must be signed in to change notification settings - Fork750
Open
Description
Environment
- Pythonnet version: 3.0.0.post1
- Python version: 3.8.10
- Operating System: Windows 11
- .NET Runtime: .NET Framework 472
Details
Describe what you were trying to get done.
I am getting random access violations during shutdown in pythonnet. The issue can be re-produced with a C# function as simple as
public static int Add(int a, int b) => a + b;
I get the access violation; however, it is not deterministic at all. Some times, it succeeds as expected, other times I get this. Note that I am upgrading from pythonnet 2.5.2 to pythonnet 3.0.0.post1 so this code used to work. All I am doing is invoking this code from python. I am running this python code that uses pythonnet in pytest. I haven't seen this when we were using pythonnet 2.5.2.
- If there was a crash, please include the traceback here.
UnhandledException:System.AccessViolationException:Attemptedtoreadorwriteprotectedmemory.Thisisoftenanindicationthatothermemoryiscorrupt.atPython.Runtime.Runtime.PyObject_TYPE(BorrowedReferenceop)atPython.Runtime.Runtime.NullGCHandles(IEnumerable`1objects)atPython.Runtime.Runtime.TryCollectingGarbage(Int32runs,BooleanforceBreakLoops)atPython.Runtime.Runtime.Shutdown()atPython.Runtime.PythonEngine.Shutdown()atPython.Runtime.Loader.Shutdown(IntPtrdata,Int32size)
Metadata
Metadata
Assignees
Labels
No labels