ID:               35415
 Comment by:       kuprishuz at gmail dot com
 Reported By:      gm at html dot it
 Status:           Feedback
 Bug Type:         PDO related
 Operating System: Linux Fedora Core 4
 PHP Version:      5.1.0
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2005-11-27 14:00:56] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



------------------------------------------------------------------------

[2005-11-27 09:57:23] gm at html dot it

Nothing has changed, always the same apache crash and the same error in
error.log

[Sun Nov 27 09:55:53 2005] [notice] child pid 2260 exit signal
Segmentation fault (11)

------------------------------------------------------------------------

[2005-11-27 01:12:38] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

If you're still able to reproduce it - please provide GDB backtrace.

------------------------------------------------------------------------

[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

Reply via email to