From: Operating system: FreeBSD 8.1-RELEASE-p1 amd64 PHP version: 5.3.5 Package: Reproducible crash Bug Type: Bug Bug description:Crash after setting $field in mysql_result to NULL
Description: ------------ Assigning of value NULL to $field argument of mysql_result causes segmentation fault. PHP version: PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 10 2011 14:50:28) Installed modules: php5-ctype-5.3.5 php5-curl-5.3.5 php5-dom-5.3.5 php5-ftp-5.3.5 php5-gd-5.3.5 php5-hash-5.3.5 php5-iconv-5.3.5 php5-json-5.3.5 php5-mbstring-5.3.5 php5-mcrypt-5.3.5 php5-mysql-5.3.5 php5-mysqli-5.3.5 php5-openssl-5.3.5 php5-session-5.3.5 php5-simplexml-5.3.5 php5-soap-5.3.5 php5-tidy-5.3.5 php5-tokenizer-5.3.5 php5-xml-5.3.5 php5-zip-5.3.5 php5-zlib-5.3.5 Diff for php.ini: http://pastebin.com/5D1WsneT Test script: --------------- http://pastebin.com/2D4mVyEx Expected result: ---------------- Script should run and output nothing. Actual result: -------------- Segmentation fault. Problem is the wrong assigning of value NULL to $field argument of mysql_result on lines 13-14. Weird is that commenting out one line of for example lines 31, 32 or 33 avoids the crash. Cannot reproduce with Zend MM disabled. Cannot reproduce with PHP compiled with debug option (!). Backtrace (not useful since debug must be disabled) http://pastebin.com/KksuenGw Valgrind log (I guess not useful eighter since debug must be disabled) http://pastebin.com/vu9nsLLT -- Edit bug report at http://bugs.php.net/bug.php?id=53847&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53847&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53847&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53847&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53847&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53847&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53847&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53847&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53847&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53847&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53847&r=support Expected behavior: http://bugs.php.net/fix.php?id=53847&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53847&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53847&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53847&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53847&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53847&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53847&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53847&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53847&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53847&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53847&r=mysqlcfg