#37678 [Opn->Bgs]: Segfault when calling exit or die after creating a PDO stmt object

From: Date: Fri, 02 Jun 2006 14:00:00 +0000
Subject: #37678 [Opn->Bgs]: Segfault when calling exit or die after creating a PDO stmt object
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97980@lists.php.net to get a copy of this message
ID: 37678 Updated by: pajoye@php.net Reported By: courier at ipwar dot ch -Status: Open +Status: Bogus Bug Type: PDO related Operating System: Gentoo Linux PHP Version: 5.1.4 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. duplicate of #37445 Previous Comments: ------------------------------------------------------------------------ [2006-06-02 13:50:20] courier at ipwar dot ch 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 $ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37678&edit=1

« previous php.bugs (#97980) next »