php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36752 pdo_odbc crashes apache
Submitted: 2006-03-16 00:14 UTC Modified: 2006-12-12 13:54 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: mauroi at digbang dot com Assigned: wez (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2006-03-16 (snap) OS: Win XP SP2
Private report: No CVE-ID: None
 [2006-03-16 00:14 UTC] mauroi at digbang dot com
Description:
------------
I'm trying to create a class that provides a layer between the programmer and the PDO native class.
When running the following code, Apache crashes. Only with the odbc PDO driver.

Thanks in advance.


Reproduce code:
---------------
class db
{
	protected $_Handle;
	function __construct($dsn)
	{
		$this->_Handle = new PDO($dsn);
	}
	public function DoSomething()
	{
		$a = $this->_Handle->prepare('SELECT * FROM valid_table');
		echo $undefined_variable; // or any other error
	}
}

function strange($errorNumber, $errorMessage)
{
	echo $errorMessage;
	exit; // if i take this out everything works as expected
}
set_error_handler('strange');

$a = new db('odbc:valid_connection_string');
$b = $a->DoSomething();

Expected result:
----------------
The $errorMessage reported by the error handler. And the script execution terminated.

Actual result:
--------------
Crash

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-28 12:30 UTC] tony2001@php.net
Please try using this CVS snapshot:

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


 [2006-03-28 14:26 UTC] mauroi at digbang dot com
Yes.
The same happens.

Thanks.
 [2006-04-21 04:11 UTC] wez@php.net
Please try using this CVS snapshot:

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


 [2006-04-21 13:33 UTC] mauroi at digbang dot com
Yes. It still happens.
phpinfo() reports 5.1.3RC4-dev.

Thank you.
 [2006-04-30 01:29 UTC] wez@php.net
Please try using this CVS snapshot:

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

Try with the next snapshot dated after this message.
 [2006-05-02 18:08 UTC] mauroi at digbang dot com
Yes. It happens.
phpinfo() reports PHP Version 5.2.0-dev .
I've downloaded php5.1-win32-200605012230.zip .
 [2006-12-12 13:54 UTC] mauroi at digbang dot com
It doesn't happen in PHP 5.2.0 !!! 

Thank you all.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 13:01:27 2024 UTC