Bug #61411 [Com]: PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE

From: Date: Fri, 26 Dec 2014 11:43:24 +0000
Subject: Bug #61411 [Com]: PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189216@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61411&edit=1

 ID:                 61411
 Comment by:         fundom02 at yahoo dot com
 Reported by:        julien at palard dot fr
 Summary:            PDO Segfaults with PERSISTENT == TRUE &&
                     EMULATE_PREPARES == FALSE
 Status:             Re-Opened
 Type:               Bug
 Package:            PDO MySQL
 Operating System:   Linux 2.6.32-5-amd64
 PHP Version:        5.4.0
 Assigned To:        uw
 Block user comment: N
 Private report:     N

 New Comment:

Perhaps this is a slightly different problem with the same symptoms.

The problem I see is using ATTR_PERSISTENT => true with ATTR_EMULATE_PREPARES => false with a
low wait_timeout on the server causes "MySQL server has gone away" issues. 

To replicate this try the following.

Configure your MySQL with a wait_timeout of 2 seconds.

Then run the following. 
                                                

	    function create_connection(){
		$options = array(PDO::ATTR_PERSISTENT => TRUE,PDO::ATTR_EMULATE_PREPARES => FALSE); 
		return new PDO('mysql:host=127.0.0.1;dbname=trafficadbar;charset=utf8',
		    'root', 'wnn99BCc', $options);
	    }


	    $pdo = create_connection();
	    sleep(5);
	    $pdo1 = create_connection();

	    $statement = $pdo1->prepare("SELECT count(*) from users");
	    $statement->execute();
	    foreach ($statement as $line)
		var_dump($line);


Previous Comments:
------------------------------------------------------------------------
[2014-12-23 23:00:51] don at smugmug dot com

I just tried the given test script against PHP-5.6.4 and it didn't segfault for me. 

I'll try our main codebase on it and see if it's been resolved.

------------------------------------------------------------------------
[2014-12-23 11:24:55] fundom02 at yahoo dot com

Hi,

I'm using PHP 5.6.3 and I still see this bug.

Darren

------------------------------------------------------------------------
[2013-08-12 11:08:09] mike@php.net

Can any of you still reproduce this?

------------------------------------------------------------------------
[2013-01-18 03:59:39] don at smugmug dot com

FWIW, 5.3.3 segfaults like this, but 5.3.2 doesn't.  I spot-checked a handful of 
other versions up to .21 and they all segfaulted as well.

------------------------------------------------------------------------
[2013-01-18 01:07:03] don at smugmug dot com

I can reproduce this in 5.4.10 and 5.4.4, FWIW.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=61411


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


Thread (21 messages)

« previous php.bugs (#189216) next »