8000 Python.exe crashes if __pycache__ directories exist (garbage collection trashed) · Issue #481 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content
Python.exe crashes if __pycache__ directories exist (garbage collection trashed) #481
Closed
@testrunner123

Description

@testrunner123

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?

pythonGCCrash.zip

  1. Unpack zip, open Visual Studio 2015 Update 3 Command Prompt in this directory
  2. Need to compile pythonnet for python 3.5 64-bit windows. Copy clr.pyd and Python.Runtime.dll to the directory of run.bat
  3. start run.bat
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0