Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
pykd pykd
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 19
    • Issues 19
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pykd
  • pykdpykd
  • Issues
  • #76

Closed
Open
Created Jun 24, 2020 by Todd Hartman@ojomojomojom

windbg crashes at script end: "PyThreadState_Delete: tstate is still current"

I might be setting things up incorrectly, but every time I run any Python script, when the script is finished, the debugger crashes.

Fatal Python error: PyThreadState_Delete: tstate is still current

I downloaded the latest bootstrapper and installed the pykd module via pip. I set PYTHONHOME. The script engine (this issue aside) works great. It just kills the debugger at the end.

> cdb -z test.dmp

.load pykd
.load path\to\python\Lib\site-packages\pykd\pykd.pyd
!py test.py

test.py

from pykd import *
dprintln('Hello World')

I was trying to get this to work with a Python 3.7.1 WinPython, but I also tried it with 3.8.3 (WinPython) and Anaconda 2 (2.7.16) and 3 (3.7.6) (all 32-bit). Same results. It crashes in both windbg and cdb (10.0.17134.12 x86).

I also tried some of the python scripts in windbg-extensions, like heap_stat.py with the same result: the script runs fine but crashes the debugger when it's finished.

Am I doing something wrong? The (google translated) docs provide some info, but not a thorough discussion of how to set up an environment.

Edited Jun 24, 2020 by Todd Hartman
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking