#34450 [NEW]: Segfault when calling close() in destructor.

From: Date: Sat, 10 Sep 2005 01:46:59 +0000
Subject: #34450 [NEW]: Segfault when calling close() in destructor.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84817@lists.php.net to get a copy of this message
From: etnu at etnu dot org Operating system: Linux 2.6.8 PHP version: 5CVS-2005-09-10 (snap) PHP Bug Type: MySQLi related Bug description: Segfault when calling close() in destructor. Description: ------------ I'm getting a seg fault when calling mysqli::close() from a derived object in the destructor. This happens in PHP 5.0.5 (stable), 5.1.0RC1, and all latest snaps, but it does NOT happen in 5.0.4. Current workaround: Leave connections open; dunno if this is a major issue or not as connections are supposed to get closed when the script terminates anyway. Reproduce code: --------------- <?php class Data extends mysqli { public function __construct($Host,$User,$Pass,$DB) { parent::__construct($Host,$User,$Pass,$DB); } public function __destruct() { // parent::close(); causes the segfault as well. $this->close(); } } $DB = new Data('192.168.50.3','web','f@m!l!es','hermes'); ?> Expected result: ---------------- Not seg faulting. Actual result: -------------- Segmentation faults. -- Edit bug report at http://bugs.php.net/?id=34450&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34450&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34450&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34450&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34450&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34450&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34450&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34450&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34450&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34450&r=support Expected behavior: http://bugs.php.net/fix.php?id=34450&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34450&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34450&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34450&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34450&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34450&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34450&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34450&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34450&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34450&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34450&r=mysqlcfg

« previous php.bugs (#84817) next »