From: roland dot fischer at dorobet dot com
Operating system: Windows 2003
PHP version: 5.2.7RC4
PHP Bug Type: Reproducible crash
Bug description: PHP crashes while receiving an ibase event
Description:
------------
I've encountered the same problem as bug 29769 - even with PHP 5.2.6,
5.2.7 RC4 and 5.2.7.7 lates build from 2008.11.21 the error happens:
When using ibase_set_event_handler and there are database operations
inside the event-handler-function the php-engine crashes.
Without the database operations inside the event-handler-function
everything is working fine.
I've tried to try it with php 5.3 and 6.0 versions - but the
php_interbase.dll is missing from this packages?
As soon as an event is caught from the event handler function windows
shows me an error report and the event-handler is dead. interestingly the
loop that echoes the "sleep" continues until I close the error report from
windows - than the script is stopped.
No entry in the php error log about this problem.
Reproduce code:
---------------
function event_handler($event_name, $link) {
if ($event_name == "EVT_MODUS") {
echo "EVENT #".$event_name."#\r\n";
$result= ibase_query ($link, 'SELECT * FROM test');
while ($row = ibase_fetch_object ($result)) {
echo 'TEST: '.$row->TEST."\n";
}
ibase_free_result($result);
ibase_commit($link);
}
}
while(1) {
if (isset($dbi)) ibase_close ($dbi);
$dbi = ibase_connect("localhost:C:/TEST.FDB", "SYSDBA", "masterkey");
ibase_set_event_handler($dbi, "event_handler", "EVT_MODUS");
while(1){
sleep(2);
echo "TS: ".strftime("%H:%M:%S")." - Sleep\n";
}
}
ibase_commit ($dbi);
ibase_close ($dbi);
Expected result:
----------------
When a firebird event is posted the event-handler-function should read all
the date from the table "TEST" and echo the row "TEST".
Instead it crashes the php engine..
Actual result:
--------------
PHP crash from 5.2.6:
Thread 1 - System ID 3672
Entry point msvcrt!_endthreadex+3a
Create time 21.11.2008 12:26:07
Time spent in user mode 0 Days 0:0:0.0
Time spent in kernel mode 0 Days 0:0:0.0
Function Arg 1 Arg 2 Arg 3 Source
php5ts!_zend_hash_index_update_or_next_insert+2c 013d1b88 00000000
01d7fa00
php5ts!zend_list_insert+65 01dc3598 00000018 003c3581
php5ts!zend_register_resource+f 01dc2358 01dc3598 00000018
php_interbase!zif_ibase_query+4d1 00000002 00000002 00000000
php5ts!zend_do_fcall_common_helper_SPEC+7d9 01d7fb14 00323c78
0112b8b8
php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+e5 00000000 00323c78
00c0fc2c
php5ts!execute+1c5 013968e0 00323c78 00000002
php5ts!zend_call_function+fac 00c0fbd0 00326070 00c0fbd4
php5ts!call_user_function_ex+5c 00325e28 00000000 0112e4b8
php5ts!call_user_function+66 00325e28 00000000 0112e4b8
php_interbase!_php_ibase_callback+134 0112b950 000f000f
01255e40
GDS32!gds__to_sqlda+1113b 013918c0 0004e640 00000008
kernel32!BaseThreadStart+37 77c0a341 013918c0 00000000
PHP5TS!_ZEND_HASH_INDEX_UPDATE_OR_NEXT_INSERT+2CIn
php__PID__2920__Date__11_21_2008__Time_12_28_29PM__829__Second_Chance_Exception_C0000005.dmp
the assembly instruction at
php5ts!_zend_hash_index_update_or_next_insert+2c in
c:\applications\php\php5ts.dll from The PHP Group has caused an access
violation exception (0xC0000005) when trying to read from memory location
0x00000000 on thread 1
--
Edit bug report at http://bugs.php.net/?id=46638&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46638&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46638&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46638&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46638&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46638&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46638&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46638&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46638&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46638&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46638&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46638&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46638&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46638&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46638&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46638&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46638&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46638&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46638&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46638&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46638&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46638&r=mysqlcfg