Edit report at http://bugs.php.net/bug.php?id=51248&edit=1
ID: 51248 Updated by: and...@php.net Reported by: mbecc...@php.net Summary: Segmentation fault in mysql_fetch_array -Status: Assigned +Status: Feedback Type: Bug Package: MySQL related Operating System: FreeBSD 6.2 PHP Version: 5.3.2 Assigned To: mysql Block user comment: N New Comment: Again, no crash and...@vihren:~/dev/php5.3-201010130830> $ ./php a.php mysql version: 5.1.44 and...@vihren:~/dev/php5.3-201010130830> $ cat config.nice #! /bin/sh # # Created by configure CC='/usr/bin/llvm-gcc' \ './configure' \ '--with-mysql=mysqlnd' \ '--with-mysqli=mysqlnd' \ '--disable-libxml' \ '--disable-dom' \ '--disable-simplexml' \ '--disable-xml' \ '--disable-xmlreader' \ '--disable-xmlwriter' \ '--without-pear' \ "$@" and...@vihren:~/dev/php5.3-201010130830> $ uname -a Darwin vihren 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 The system is a MacOS X 10.6.something Previous Comments: ------------------------------------------------------------------------ [2010-10-07 04:33:41] php at group dot apple dot com Thank you for attempting to reproduce on Mac OS X. The issue may be the choice of compiler, as the problem more readily reproduces with LLVM, which claims to be much more aggressive in its stack protection than GCC. One option would be to try to build using LLVM as the compiler, i.e.: CC=/usr/bin/llvm-gcc ./configure ... ------------------------------------------------------------------------ [2010-10-06 14:17:47] and...@php.net No crash on 64bit MacOS X 10.6.4 , with or without the flags, libmysql. MySQL is 5.5.2 ------------------------------------------------------------------------ [2010-10-06 13:54:59] and...@php.net forgot to mention that I used the -g -fstack-protector-all ------------------------------------------------------------------------ [2010-10-06 13:52:59] and...@php.net I get no crash on Ubuntu 9.10 x86, PHP 5.3.4-dev, MySQL 5.1.51 . Neither with libmysql nor with mysqlnd, but by looking at the stacktrace it should not matter much. Will get it checked on Mac OS ------------------------------------------------------------------------ [2010-09-30 11:53:28] aaphp at mailinator dot com Received this using 5.3.3 on Apache 2.2.16 w/ Cpanel; CENTOS 4.8 x86_64 and osCommerce. Caused segfaults logged to /var/log/messages: Sep 29 20:23:22 hostname kernel: conftest[30619]: segfault at 0000000000000001 rip 0000000000405dae rsp 0000007fbffff250 error 4 Sep 29 21:36:28 hostname kernel: php[20444]: segfault at 0000002a00000014 rip 0000000000741da3 rsp 0000007fbfffabb0 error 4 And php errors in /var/log/httpd/error_log: [Wed Sep 29 20:28:02 2010] [error] [client x.x.x.x] Premature end of script headers: php5 The errors are consistent - nothing loads on the site but 500 Internal Server Errors. Did not go away until PHP was downgraded to 5.2.14 or the following change made to the script: The Line: return mysql_fetch_array($db_query, MYSQL_ASSOC); Once changed to: return mysql_fetch_assoc($db_query); The error ceases & site functions as expected. ------------------------------------------------------------------------ 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 http://bugs.php.net/bug.php?id=51248 -- Edit this bug report at http://bugs.php.net/bug.php?id=51248&edit=1