#44981 [Opn->Fbk]: If script contains a function declaration and dl() fails -> segfault
| From: | jani@php.net | Date: | Thu, 28 Aug 2008 21:31:50 +0000 |
| Subject: | #44981 [Opn->Fbk]: If script contains a function declaration and dl() fails -> segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128511@lists.php.net to get a copy of this message | ||
ID: 44981
Updated by: jani@php.net
Reported By: mabouzou at sybase dot com
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: *
PHP Version: 5.2.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-05-13 14:12:34] mabouzou at sybase dot com
I forgot to mention that the extension library has to define at least
one function in the zend_function_entry table.
Also, if the library is loaded from the ini file directly the crash
does not happen.
------------------------------------------------------------------------
[2008-05-13 13:57:47] mabouzou at sybase dot com
Description:
------------
PHP would crash while executing the attached code. The code basically
declares a function and attempts to load an extension using the dl()
command. If the extension returns FAILURE in the MINIT function, PHP
will crash.
Reproduce code:
---------------
<?php
function foo()
{
echo "Inside foo.\n";
}
dl( 'my_extension.dll' );
?>
Expected result:
----------------
Inside foo.
<... something along the lines of ... cannot load extension
my_extension.dll ... >
Actual result:
--------------
A crash. Here is the stack trace:
php5ts.dll!destroy_op_array(_zend_op_array * op_array=0x011c9720,
void * * * tsrm_ls=0x00375d20) Line 228 + 0x3 bytes C
php5ts.dll!zend_function_dtor(_zend_function * function=0x0139df68)
Line 123 + 0x16 bytes C
php5ts.dll!zend_hash_destroy(_hashtable * ht=0x00373328) Line 526 +
0x6 bytes C
php5ts.dll!compiler_globals_dtor(_zend_compiler_globals *
compiler_globals=0x00377398, void * * * tsrm_ls=0x00375d20) Line 487 C
php5ts.dll!tsrm_shutdown() Line 180 + 0x6 bytes C
php.exe!main(int argc=0x00000002, char * * argv=0x00375c48) Line
1342 C
php.exe!__tmainCRTStartup() Line 597 + 0x17 bytes C
kernel32.dll!_BaseProcessStart@4() + 0x23 bytes
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44981&edit=1