Message358358
On Sat, Nov 30, 2019 at 9:23 PM Kyle Stanley <report@bugs.python.org> wrote:
> Based on the above hint, I was able to make some progress on a potential solution. Thanks Eric.
That's great!
> Instead of only checking "frame->f_executing", I changed "_is_running()" to also check the
> "finalizing" field of PyInterpreterState. The "finalizing" field is set to 1 in "Py_EndInterpreter()",
> so this ensures that an interpreter in the process of being destroyed is considered "running",
> so that operations (such as running scripts, destroying the interpreter, etc) can't occur during
> finalization.
Ah, that makes sense.
> I had to add a private function to the C-API in order to access "interp->finalizing" from
> Modules/_xxsubinterpretersmodule.c due to the struct for PyInterpreterState being internal only.
Yep, it has to use the public C-API just like any other module. The
function has a "_Py" prefix and be defined in Include/cpython, right? |
|
Date |
User |
Action |
Args |
2019-12-13 21:39:20 | eric.snow | set | recipients:
+ eric.snow, vstinner, aeros |
2019-12-13 21:39:20 | eric.snow | link | issue37224 messages |
2019-12-13 21:39:19 | eric.snow | create | |
|