Under CLI ZTS build, when loading a PHP-GTK 2 .dll built against anything
this side of PHP 5.1.2 release, I'm seeing an 'access violation' crash on
reaching:
if (resource_types_table && !resource_types_table[j].done &&
resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}
Similar code is also used in:
tsrm_free_interpreter_context()
ts_free_thread()
ts_free_worker_threads()
ts_free_id()
I thought ts_free_thread() was crashing at that line too at first, but that
turned out to be because there's no 'done' check there, i.e. double dtors
are possible via some functions. It's still vaguely possible there's a
double flypast causing the crash I'm seeing, but I have everything I know
about protected now. (On my laptop that is.)
Eventually I found the resource id for PHP-GTK - the only extension I'm
loading during runtime, via php.ini - is 32nd out of a possible 32.
"Eventually", because that means I can't use ts_free_id() to avoid the crash
as advised by Frank (and Tony, and Dmitry, and anyone else who ever used
that MSHUTDOWN workaround for CLI). Interesting too, because the resource
that causes the crash appears to be something completely other. Tracking
down resource id #5 - and that's all I know about it apart from it crashes -
is a barrel of laughs, I'll let y'all know if I ever find out which of the
many possible extensions/files in ext/standard or core it is.
Short version: One line is problematic, and only in one function, and
presumably only under CLI SAPI. (CGI already doesn't call tsrm_shutdown(),
thanks to similar issues some 3 years ago).
The question is whether to take 'the Zeev approach' and simply comment out
the tsrm_shutdown() call at the end of sapi/cli/php_cli.c, or whether to
spend time knitting up a fine-grained approach to prevent the one bad line
in the function from being called in single-threaded environments? I think
I've given up on the idea of actually resolving the bug now...
Thoughts?
- oh, and don't make one of them 'chicken-and-egg' - this is definitively
NOT related to the shutdown order in main.c!!!!!
- Steph
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php