[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

Benjamin Peterson report at bugs.python.org
Sun Jul 19 18:33:22 CEST 2009


Benjamin Peterson <benjamin at python.org> added the comment:

2009/7/19 Graham Dumpleton <report at bugs.python.org>:
>
> Graham Dumpleton <Graham.Dumpleton at gmail.com> added the comment:
>
> I know this issue is closed, but for this patch, the code:
>
> +    modstate = get_atexitmodule_state(module);
> +
> +    if (modstate->ncallbacks == 0)
> +        return;
>
> was added.
>
> Is there any condition under which modstate could be NULL.

The module is probably being deallocated before the callbacks are being called.

>
> Haven't touched Python 3.0 support in mod_wsgi for a long time and when
> revisiting code with final Python 3.0, I find that I get Py_Finalize()
> crashing on process shutdown. It is crashing because modstate above is
> NULL.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4200>
_______________________________________


More information about the Python-bugs-list mailing list