PHP 4.0 Bug #3148: access violation in kernel32.dll when running scripts with date/gmdate function
| From: | zimpel at t-online dot de | Date: | Sat, 08 Jan 2000 19:21:45 +0000 |
| Subject: | PHP 4.0 Bug #3148: access violation in kernel32.dll when running scripts with date/gmdate function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14429@lists.php.net to get a copy of this message | ||
From: zimpel@t-online.de
Operating system: Windows 95B
PHP version: 4.0 Beta 3
PHP Bug Type: Reproduceable crash
Bug description: access violation in kernel32.dll when running scripts with date/gmdate function
build:
PHP4TS.DLL
MSVC++ 5 settings:
NDEBUG,_WINDOWS,_USRDLL,PHP4DLLTS_EXPORTS,MSVC5,PHP_EXPORTS,LIBZEND_EXPORTS,
TSRM_EXPORTS,SAPI_EXPORTS,ZTS,WIN32,_MBCS,ZEND_DEBUG=0
test script:
<HTML><BODY>
<? gmdate("U"); ?>
</BODY></HTML>
reason:
reentrancy.c - local_lock(GMTIME_R);
GMTIME_R wasn't initialized due to missing call of reentrancy_startup
To fix:
Suggest changes in SAPI.C
SAPI_API void sapi_startup(sapi_module_struct *sf)
{
sapi_module = *sf;
zend_hash_init(&known_post_content_types, 5, NULL, NULL, 1);
sapi_register_post_readers(supported_post_content_types);
#ifdef ZTS
sapi_globals_id = ts_allocate_id(sizeof(sapi_globals_struct), NULL, NULL);
#if defined(PHP_NEED_REENTRANCY)
reentrancy_startup();
#endif
#endif
php_global_startup_internal_extensions();
}