Closed
Description
Environment
- Pythonnet version: 2.3.0
- Python version: 3.5 64-bit
- Operating System: Windows 7 Pro 64-bit SP1
Details
- Describe what you were trying to get done.
I am trying to import .NET assemblies and use them together. Unfortunately, python interpreter always crashes if .py files are already precompiled and lay inside pycache directories. I tried breifly python 3.6 and newer pythonnet, but it still crashes. However it doesn't crash with old python 2.7.13 64-bit (need to recompile pythonnet for 2.7).
I used Debugger and see that python garbage collection is trashed. Mostly object->tp_is_gc field is invalid not showing to real function.
Deleteing pycache directories allow test.py to run once.
Please, help in identify the issue and in making the fix.
- What commands did you run to trigger this issue?
- Unpack zip, open Visual Studio 2015 Update 3 Command Prompt in this directory
- Need to compile pythonnet for python 3.5 64-bit windows. Copy clr.pyd and Python.Runtime.dll to the directory of run.bat
- start run.bat
- python.exe crashes after printing "0"
- If there was a crash, please include the traceback here.
The crash happens mostly inside visit_decref() function in PyObject_IS_GC(op) macro. It shows either "op" is 0 or "op->tp_is_gc" has a wrong address.