Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to detect GIL usage with Python 3.7 #100

Closed
benfred opened this issue Mar 17, 2019 · 2 comments
Closed

Fails to detect GIL usage with Python 3.7 #100

benfred opened this issue Mar 17, 2019 · 2 comments

Comments

@benfred
Copy link
Owner

benfred commented Mar 17, 2019

The _PyThreadState_Current symbol is no longer being used - so we won't be able to use it to figure out which thread is holding on to the GIL anymore.

It should be possible to get this from _PyRuntime.gilstate.tstate_current (if the process has symbols). Alternatively, it might be possible to call the _PyThreadState_UncheckedGet function in the target process.

@benfred benfred changed the title Issues detecting GIL usage Fails to detect GIL usage with Python 3.7 Mar 17, 2019
@benfred
Copy link
Owner Author

benfred commented Mar 24, 2019

Initial version here #104 .

Unfortunately using bindgen for pyruntimestate isn't really an option: there are OS specific member variables (like mutexes) inside this struct, and they don't have a consistent size across OS/architecture. Instead I'm computing the offset and using on a per OS/architecture/python version basis.

@benfred
Copy link
Owner Author

benfred commented Apr 1, 2019

Windows implementation here - 155b467 . Will be fixed in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant