#35415 [Opn->Bgs]: crash with persistent connection
| From: | tony2001@php.net | Date: | Mon, 28 Nov 2005 11:16:59 +0000 |
| Subject: | #35415 [Opn->Bgs]: crash with persistent connection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89181@lists.php.net to get a copy of this message | ||
ID: 35415
Updated by: tony2001@php.net
Reported By: gm at html dot it
-Status: Open
+Status: Bogus
Bug Type: PDO related
Operating System: Linux Fedora Core 4
PHP Version: 5CVS-2005-11-27 (snap)
New Comment:
Not reproducible -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2005-11-28 10:25:32] gm at html dot it
Sorry, but i'm not able to reproduce GDB backtrace. I tried both the
methods described in the howto page you linked, but something went
wrong
------------------------------------------------------------------------
[2005-11-28 06:48:41] kuprishuz at gmail dot com
description:
---------------
i have encountered the same problem, it appears that apache will crash
when an invalid sql call is used in conjunction with persistent
connections.
reproduce code:
---------------
keep in mind the sql statement must be incorrect to produce a crash.
crash will also occur when using $database->query as an alternative to
$database->prepare.
<?php
$database = new PDO('mysql:host=localhost;dbname=nitelife', 'root',
'Quell26A', array(PDO::ATTR_PERSISTENT => true));
$query = $database->prepare("SELECT * FROM user WHERE id = ?");
if ($query->execute(array('1'))) {
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
print_r($row);;
}
}
?>
Expected Result:
-------------------
sql call to fail and an error message retrievable from
$query->errorInfo()
Actual Result:
-------------------
Apache crash
------------------------------------------------------------------------
[2005-11-27 01:11:04] gm at html dot it
Description:
------------
The code reported causes an apache crash.
It happens only with persistent connection, if i set
PDO::ATTR_PERSISTENT = false, the script works fine.
Reproduce code:
---------------
<?php
try {
$dbo = new PDO(
'mysql:host=localhost;dbname=test',
'user',
'pass',
array(PDO::ATTR_PERSISTENT => true)
);
} catch(PDOException $e) {
echo 'Errore di connessione: '.$e->getMessage();
}
$pdostatement = $dbo->prepare('SELECT * FROM fake_table');
$pdostatement->execute();
echo 'print something';
?>
Expected result:
----------------
The script should just print out 'print something'.
Actual result:
--------------
Apache crash, this is the error in apache error.log:
Sun Nov 27 00:48:48 2005] [notice] child pid 3051 exit signal
Segmentation fault (11)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35415&edit=1