I often encounter memory access-related crash issues when using Pythonnet #2291
Unanswered
hellofengge
asked this question in
Q&A
Replies: 2 comments
-
|
Operating System: Windows11 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Now, I have identified that the direct cause of the problem is that my Python code is maintaining a set, and my C # code is also traversing this set, which can cause the process to crash during the C # traversal process |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Details
I often encounter memory access-related crash issues when using Pythonnet. While debugging one of the dump files in Visual Studio, the problem appears to be in the following section of the Runtime.cs code:
The error message is 0xC0000005: Access violation. My .NET version is .NET 6, and the operating system is Windows 11. During program initialization, I call PythonEngine.BeginAllowThreads(), and I've added locks around every access to Python attributes and functions. Sample code is provided below.
Beta Was this translation helpful? Give feedback.
All reactions