Bug #76443 [Ver]: php+php_interbase.dll crash on module_shutdown
| From: | cmb@php.net | Date: | Sun, 10 Jun 2018 23:38:40 +0000 |
| Subject: | Bug #76443 [Ver]: php+php_interbase.dll crash on module_shutdown | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215591@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76443&edit=1
ID: 76443
Updated by: cmb@php.net
Reported by: phpdev at ehrhardt dot nl
Summary: php+php_interbase.dll crash on module_shutdown
Status: Verified
Type: Bug
Package: InterBase related
Operating System: Windows
PHP Version: 7.3.0alpha1
Block user comment: N
Private report: N
New Comment:
Thanks for testing (and for reporting this issue in the first
place), Jan! I'm not quite sure how to resolve this; see
<http://news.php.net/php.internals.win/1188>.
Previous Comments:
------------------------------------------------------------------------
[2018-06-10 23:22:20] kalle@php.net
Ah yes I see, should be fine reverting it tho I never experienced any issue with it back when I
implemented it which I guess is why it was not caught until now
------------------------------------------------------------------------
[2018-06-10 21:16:13] phpdev at ehrhardt dot nl
The hammer on the nail! So this commit by @KalleZ should be reversed:
https://github.com/php/php-src/commit/fd29202022ecd952c175a3d1f805678801092be4#diff-e9c0f3e6898bf699286fc2fa83998cb7
------------------------------------------------------------------------
[2018-06-10 20:52:18] cmb@php.net
According to GetModuleHandle docs[1]:
| Therefore, do not pass a handle returned by GetModuleHandle to
| the FreeLibrary function.
So please try again after removing the FreeLibrary() call[2].
[1] <https://msdn.microsoft.com/de-de/library/windows/desktop/ms683199(v=vs.85).aspx>
[2] <https://github.com/php/php-src/blob/php-7.3.0alpha1/ext/interbase/interbase.c#L837>.
------------------------------------------------------------------------
[2018-06-10 19:30:19] phpdev at ehrhardt dot nl
Description:
------------
PHP 7.3.0 Alpha 1 crashes at the end of a script when extension=interbase is loaded.
PHP 7.3.0.Alpha 1 was compiled with VC15 after applying this patch:
https://github.com/php/php-src/commit/f96df64cb2219fda42ca875483f874cf3052647c
Config:
cscript /nologo configure.js "--disable-all" "--enable-cli"
"--enable-cgi" "--enable-crt-debug" "--enable-debug-pack"
"--disable-zts" "--with-interbase=shared"
build-dist with pdb's:
https://phpdev.toolsforresearch.com/php-7.3.0alpha1-nts-Win32-VC15-x86-interbase.zip
The same thing happens with every other full build (x86 / x64, TS / NTS). They are available here:
https://www.apachelounge.com/viewtopic.php?p=36936#36936
Test script:
---------------
php phpinfo.php or php-cgi phpinfo.php, where phpinfo.php =
<?php phpinfo();?>
php.ini:
[PHP]
extension_dir = "ext"
extension=interbase
Expected result:
----------------
A graceful_reverse_destroy
Actual result:
--------------
The output of phpinfo() is echoed to the console, but at the end it crashes.
Unhandled exception at 0x7789BA26 (ntdll.dll) in php.exe: 0xC0000005: Access violation reading
location 0xBE2C9F38. occurred
backtrace:
ntdll.dll!_LdrpUpdateLoadCount2@8()
ntdll.dll!_LdrpUpdateLoadCount2@8()
ntdll.dll!_LdrpUnloadDll@8()
ntdll.dll!_LdrUnloadDll@4()
KernelBase.dll!_FreeLibrary@4()
> php7.dll!module_destructor(_zend_module_entry * module) Line 2624
php7.dll!module_destructor_zval(_zval_struct * zv) Line 748
[Inline Frame] php7.dll!_zend_hash_del_el_ex(_zend_array * idx, unsigned int) Line 1162
[Inline Frame] php7.dll!_zend_hash_del_el(_zend_array *) Line 1185
php7.dll!zend_hash_graceful_reverse_destroy(_zend_array * ht) Line 1639
php7.dll!zend_shutdown() Line 980
php7.dll!php_module_shutdown() Line 2330
php.exe!main(int argc, char * * argv) Line 1421
[External Code]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76443&edit=1