php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33970 Seg fault when error should be returned
Submitted: 2005-08-02 17:40 UTC Modified: 2005-08-10 01:00 UTC
From: lists at cyberlot dot net Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.1.0b3 OS: Fedora Core 3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lists at cyberlot dot net
New email:
PHP Version: OS:

 

 [2005-08-02 17:40 UTC] lists at cyberlot dot net
Description:
------------
Running this script seg faults instead of producing a reasonable error.

Reproduce code:
---------------
$dsn         = "mysql:dbname=123;host=localhost";
$dbuser          = "123";
$dbpass          = "123";


   class PDO_Dynamic extends PDO {
       private $dsn;
       private $dbuser;
       private $dbpass;

       function PDO_Dynamic($dsn, $dbuser, $dbpass) {
           $this->dsn = $dsn;
           $this->dbuser = $dbuser;
           $this->dbpass = $dbpass;
           $temp = $this->PDO($dsn, $dbuser, $dbpass);

       }

   }


   $db_read = new PDO_Dynamic($dsn, $dbuser, $dbpass);
   $db_write = new PDO_Dynamic($dsn, $dbuser, $dbpass.'-');


Expected result:
----------------
No error at all expected, or at least some sort of warning/fault

Actual result:
--------------
#0  0x08130533 in pdo_hash_methods (dbh=0x9e189b4, kind=0) at /root/sources/php-5.1.0b3/ext/pdo/pdo_dbh.c:990
#1  0x081308bf in dbh_method_get (object_pp=0xbffb5294, method_name=0x9e1baa4 "PDO", method_len=3) at /root/sources/php-5.1.0b3/ext/pdo/pdo_dbh.c:1065
#2  0x0833f150 in ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER (execute_data=0xbffb5270) at zend_vm_execute.h:14663
#3  0x08317eeb in execute (op_array=0x9e1b52c) at zend_vm_execute.h:87
#4  0x0831835b in zend_do_fcall_common_helper_SPEC (execute_data=0xbffb54a0) at zend_vm_execute.h:213
#5  0x08318a73 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbffb54a0) at zend_vm_execute.h:299
#6  0x08317eeb in execute (op_array=0x9e140ac) at zend_vm_execute.h:87
#7  0x082f19f9 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/sources/php-5.1.0b3/Zend/zend.c:1087
#8  0x082b0a9d in php_execute_script (primary_file=0xbffb78d0) at /root/sources/php-5.1.0b3/main/main.c:1672
#9  0x0835ce9b in main (argc=2, argv=0xbffb79a4) at /root/sources/php-5.1.0b3/sapi/cli/php_cli.c:1039


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-02 18:12 UTC] sniper@php.net
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


 [2005-08-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC