|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-02 13:59 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
Description: ------------ php (as cli or as apache2 module) generate a Segmentation fault if a pdo statement is created and after that, in the script called exit() or die() but the statemnt was never executed !!! An other segfault is when a class extends an other, create a pdo statement object, and call a function of witch the object has no right (e.g. private not protected). No error is shown on the apache website, instead the connection is reseted, only on the console it says the problem and segfaulting. Reproduce code: --------------- <?php class MyAuthHttp { private $mydb; /** * Constructor */ public function __construct($adb) { $this->mydb = $adb; $this->checkAuthData('heda1','heda1'); } private function checkAuthData($user, $password) { try { $shpw = sha1($password); $stmt = $this->mydb->prepare("SELECT *, ( select id as did from Dozent d where d.id = p.id ) as dozentid, ( select id as sid from Student s where s.id = p.id ) as studentid FROM Person p where loginName = 'heda1' and passwordDigestSHA1x = '". $shpw . "'"); die('test'); //$stmt->bindParam(':user',$user, PDO::PARAM_STR); //$stmt->bindParam(':paw', $shpw, PDO::PARAM_STR); $stmt->execute(); $res = $stmt->fetchAll(PDO::FETCH_ASSOC); // do somephing with the result ,,, return false; } catch (Exception $e) { debug_print_backtrace(); die("<br>\nFehler: ".__FILE__." : ".__LINE__." :<br>\n".$e->getMessage()."<br>\n"); return false; } } } $auth = new MyAuthHTTP(new PDO('mysql:host=localhost;dbname=dbname', 'user', 'pw')); ?> Expected result: ---------------- nerve@powerstation ~/semarbeit $ php test.php testSegmentation fault nerve@powerstation ~/semarbeit $ Actual result: -------------- nerve@powerstation ~/semarbeit $ php test.php test nerve@powerstation ~/semarbeit $