In trying to find the location of a valid instance of PyInterpreterState in
the virtual memory of a running Python (3.6) application (using
process_vm_read on Linux), I have noticed that I can only rely on
_PyThreadState_Current.interp at the very beginning of the execution. If I
try to attach to a running Python process, then
_PythreadState_Current.interp doesn't seem to point to anything useful to
derive the currently running threads and the frame stacks for each of them.
This makes me wonder about the purpose of this symbol in the
.dynsym section. Apart from a brute force approach for finding a valid
PyInterpreterState, is there a more reliable approach for the version of
Python that I'm targeting?

Thanks,
Gabriele
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to