Bug #63176 [PATCH]: Segmentation fault when instantiate 2 persistent PDO to the same db server

From: Date: Fri, 28 Sep 2012 02:47:52 +0000
Subject: Bug #63176 [PATCH]: Segmentation fault when instantiate 2 persistent PDO to the same db server
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-173764@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63176&edit=1

 ID:                 63176
 Patch added by:     laruence@php.net
 Reported by:        jrbasso at gmail dot com
 Summary:            Segmentation fault when instantiate 2 persistent PDO
                     to the same db server
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Ubunt 12.04.1
 PHP Version:        5.4.7
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug63176.patch
Revision:   1348800472
URL:        https://bugs.php.net/patch-display.php?bug=63176&patch=bug63176.patch&revision=1348800472


Previous Comments:
------------------------------------------------------------------------
[2012-09-28 02:10:28] jrbasso at gmail dot com

Description:
------------
Download the PHP version 5.4.7, compiled with ./configure --enable-debug --with-
pdo-mysql --enable-pcntl

Run the test script and it gives a segmentation fault when the script finish. If 
I remove the attribute from PDO2 it works fine. If the persistent option is 
disabled it works fine too.

gdb backtrace available on https://gist.github.com/3bda9d5253e7a86168e0


Test script:
---------------
<?php

class PDO2 extends PDO {
	protected $transLevel;
}

class ModelA {
	public function __construct() {
		$this->db = new PDO2('mysql:host=localhost', 'root', 'root',
array(PDO::ATTR_PERSISTENT => true));
		$this->db->query('SELECT 1')->fetchAll();
	}
}

$a = new ModelA();
$b = new ModelA();


Expected result:
----------------
No segmentation fault

Actual result:
--------------
Segmentation fault (core dumped)


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



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63176&edit=1


Thread (11 messages)

« previous php.bugs (#173764) next »