From: Operating system: Debian PHP version: 5.4.0RC5 Package: Reproducible crash Bug Type: Bug Bug description:Segfault
Description: ------------ I can fix this segfault by either removing the ATTR_PERSISTENT option, or by assigning parent::prepare to a local variable (i.e. $stmt = parent::prepare('...')) Also worth nothing I had to compile PHP as shared due to a bug when trying to compile the extension with mysqlnd which is filed in a separate report. Linux localdev 3.1.0-1-amd64 #1 SMP Fri Dec 23 16:37:11 UTC 2011 x86_64 GNU/Linux $ php -v PHP 5.4.0RC5 (cli) (built: Jan 10 2012 19:42:22) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies $ phpize -v Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 $ cat /etc/issue Debian GNU/Linux wheezy/sid \n \l $ mysql --version mysql Ver 14.14 Distrib 5.1.58, for debian-linux-gnu (x86_64) using readline 6.2 Test script: --------------- <?php class BuggedPDO extends PDO { protected $stmt = null; public function __construct() { $options = array( \PDO::ATTR_PERSISTENT => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, ); try { parent::__construct('mysql:dbname=testdb;host=localhost', 'testuser', 'testpass', $options); $this->stmt = parent::prepare('select * from table'); } catch (\Exception $ex) { var_dump($ex); } } } $test = new BuggedPDO(); Expected result: ---------------- A proper resource in $this->stmt Actual result: -------------- Jan 11 10:26:00 kernel: [ 956.330577] php-fpm[2255]: segfault at 0 ip 0000000000729beb sp 00007fffad56c8e0 error 4 in php-fpm[400000+76d000] -- Edit bug report at https://bugs.php.net/bug.php?id=60715&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60715&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60715&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60715&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60715&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60715&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60715&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60715&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60715&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60715&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60715&r=support Expected behavior: https://bugs.php.net/fix.php?id=60715&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60715&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60715&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60715&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60715&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60715&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60715&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60715&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60715&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60715&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60715&r=mysqlcfg