php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42075 pdo_oci crash (with persistent connection) when couldn't connect to db
Submitted: 2007-07-23 06:57 UTC Modified: 2016-03-08 01:50 UTC
From: romande at gmail dot com Assigned: mbeccati (profile)
Status: No Feedback Package: PDO OCI
PHP Version: 5.2.3 OS: linux (2.4.21-49.EL)
Private report: No CVE-ID: None
 [2007-07-23 06:57 UTC] romande at gmail dot com
Description:
------------
pdo_oci crash when trying to connect to db with bad instance name/or user name/ or password, or db is down.



Reproduce code:
---------------
make $db to point to not existing db instance/to db which is down

include("config.inc");
    try{
      $this->conn = new PDO($db, $db_username,$db_password, 
			    array(PDO::ATTR_PERSISTENT => true));
    }catch (PDOException $e)
    {
    	include("config.inc");
		$logger =  &Log::singleton('file', $file, 'DBManager.php', $conf, $logLevel);
		$logger->log("Failed connecting to DB: ".$e->getMessage(), PEAR_LOG_ERR);
	//	$logger->log("DB error. Continuing without DB.", PEAR_LOG_INFO);
    }

Expected result:
----------------
It's expected that "catch" statement will catch the exception

Actual result:
--------------
script crashes with message in apache log:

*** glibc detected *** free(): invalid pointer: 0xb71e6ec4 ***
[Mon Jul 23 09:08:17 2007] [notice] child pid 7065 exit signal Aborted (6)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-21 10:38 UTC] mj@php.net
I'm unable to reproduce this issue with PHP 5.3.0-dev using the following script:

<?php
try {
    $db = new PDO("oci:dbname=nosuchthingsasthis", "test", "foo", array(PDO::ATTR_PERSISTENT => true));
} catch (PDOException $e) {
    print $e->getMessage();
}
?>

I get no crash but the expected error message "SQLSTATE[42S02]: pdo_oci_handle_factory: ORA-12154: TNS:could not resolve the connect identifier specified".

Can you please try again with a 5.3.0 snapshot from http://snaps.php.net/? Thanks!
 [2008-07-29 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".
 [2009-05-12 22:04 UTC] mbeccati@php.net
Please try using this CVS snapshot:

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

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

This bug should be fixed after applying the fix for #48070
 [2009-05-20 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".
 [2016-03-08 01:50 UTC] sixd@php.net
-Package: PDO related +Package: PDO OCI
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC