|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
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!