ID: 42075
Updated by: [EMAIL PROTECTED]
Reported By: romande at gmail dot com
Status: Assigned
Bug Type: PDO related
Operating System: linux (2.4.21-49.EL)
PHP Version: 5.2.3
Assigned To: sixd
New Comment:
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!
Previous Comments:
------------------------------------------------------------------------
[2007-07-23 06:57:36] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42075&edit=1