php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34208 crash using session_set_save_handler & throwing exception in own errorhandler
Submitted: 2005-08-22 01:39 UTC Modified: 2005-08-22 22:59 UTC
From: carsten dot jendro at gmx dot net Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.1.0RC1 OS: win32 only
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: carsten dot jendro at gmx dot net
New email:
PHP Version: OS:

 

 [2005-08-22 01:39 UTC] carsten dot jendro at gmx dot net
Description:
------------
php5/apache crashes when using set_error_handler and session_set_save_handler together and throwing an exception in error handler.

Testet with php 5.0.4.4 and 5.1rc1, apache 1 & 2

Reproduce code:
---------------
<?php

function ErrorHandler($errno, $errstr, $errfile, $errline)
{
	//session_destroy(); //uncomment this line and php will not crash
	throw new Exception();
}

function Read($id){	return "";}
function Open($save_path, $session_name){ return true; }
function Close(){ return true; }
function Write($id, $sess_data) { return true; }
function Destroy($id){ }
function GarbageCollect($maxlifetime){ return true; }

set_error_handler("ErrorHandler");
session_set_save_handler("Open", "Close", "Read", "Write", "Destroy", "GarbageCollect");
session_start();

//create fatal error
$Foo->Bar();

?>

Expected result:
----------------
no crash ;-)

Actual result:
--------------
	php5ts.dll!00a2b37a() 	
 	php5ts.dll!00aa1248() 	
 	php5ts.dll!00aa1494() 	
 	php5ts.dll!00aa59fe() 	
 	php5ts.dll!00aa587d() 	
 	php5ts.dll!00aa5beb() 	
 	php5ts.dll!009f640c() 	
 	php5ts.dll!00a2e552() 	
 	php5ts.dll!009f23bd() 	
 	php5ts.dll!00a5244e() 	
 	msvcrt.dll!77bfc2e3() 	
 	ntwdblib.dll!7333ab22() 	
 	ntwdblib.dll!7333f33e() 	
 	ntwdblib.dll!7333f3eb() 	
 	php5apache2.dll!003f2f9f() 	
 	php5apache2.dll!003f34e8() 	
 	php5apache2.dll!003f3163() 	
 	libhttpd.dll!6ff0155f() 	
 	libhttpd.dll!6ff018a9() 	
 	libhttpd.dll!6ff0d582() 	
 	libhttpd.dll!6ff095e6() 	
 	libhttpd.dll!6ff0411f() 	
 	libhttpd.dll!6ff04372() 	
 	libhttpd.dll!6ff1bc3a() 	
 	msvcrt.dll!77c0a3b0() 	
 	kernel32.dll!7c80b50b() 	
 	kernel32.dll!7c8399f3() 	


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-22 11:09 UTC] sniper@php.net
Does NOT crash under Linux. (ZTS problem propably)

 [2005-08-22 17:40 UTC] sniper@php.net
Please try using this CVS snapshot:

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


 [2005-08-22 22:40 UTC] carsten dot jendro at gmx dot net
works fine with actual http://snaps.php.net/win32/php5-win32-latest.zip

what was the bugfix? looks like php sessions are disabled after fatal error.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 21:01:28 2024 UTC