php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46638 PHP crashes while receiving an ibase event
Submitted: 2008-11-21 11:41 UTC Modified: 2009-08-21 01:00 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:2 (33.3%)
From: roland dot fischer at dorobet dot com Assigned:
Status: No Feedback Package: InterBase related
PHP Version: 5.2.7RC4 OS: Windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: roland dot fischer at dorobet dot com
New email:
PHP Version: OS:

 

 [2008-11-21 11:41 UTC] roland dot fischer at dorobet dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-13 09:31 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

And update the version properly if you can still reproduce or close this report if not.
 [2009-08-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2012-07-03 20:27 UTC] always666 at gmail dot com
Tested on php-5.3.14-Win32-VC9-x86 TS + fbclient.dll 2.5.1.26351 FirebirdX86,
the bug still exists NO Firebird access or calls to api (php_interbase.dll) functions can be made from inside the handler function or expect access 
violation...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC