From: michael at cosby dot dhs dot org Operating system: Linux 2.6 PHP version: 5.0.4 PHP Bug Type: MySQL related Bug description: mysql_fetch_field() causes segmentation fault
Description: ------------ environment: apache 2.0.52 in multi-threaded mode mysql 4.1.11 (and 4.1.6-gamma) PHP 5.0.4 php configuration: ./configure --with-apxs2=/usr/sbin/apxs \ --with-zlib --enable-calendar \ --with-gd --with-mhash \ --with-xsl --enable-memory-limit \ --prefix=/home/php --with-mysql \ --with-openssl --with-jpeg-dir=/usr/lib \ --with-gettext \ --with-curl=/usr/local/lib Notes: * This bug does not occur if I use PHP 5.0.2 in the same environment instead of PHP 5.0.4. * It's possible that the fix for bug #31288 is related to this issue. This code does *not* call the (deprecated) function mysql_list_fields() at all. Reproduce code: --------------- The following code snippet (taken from WordPress wp-includes/wp-db.php, a blogging program): while ($i < mysql_num_fields($this->result)) { $this->col_info[$i] = mysql_fetch_field($this->result); $i++; } Even a single invocation of mysql_fetch_field() will cause the seg. fault. Nothing is written to the server's error log from PHP itself. Expected result: ---------------- Code inside a script should not cause a seg. fault. Actual result: -------------- When using the code snippet specified, the apache child running the request seg. faults. -- Edit bug report at http://bugs.php.net/?id=32675&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32675&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32675&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32675&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32675&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32675&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32675&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32675&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32675&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32675&r=support Expected behavior: http://bugs.php.net/fix.php?id=32675&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32675&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32675&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32675&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32675&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32675&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32675&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32675&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32675&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32675&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32675&r=mysqlcfg