Edit report at http://bugs.php.net/bug.php?id=51248&edit=1
ID: 51248 Comment by: aaphp at mailinator dot com Reported by: mbecc...@php.net Summary: Segmentation fault in mysql_fetch_array Status: Assigned Type: Bug Package: MySQL related Operating System: FreeBSD 6.2 PHP Version: 5.3.2 Assigned To: mysql Block user comment: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2010-09-24 20:38:23] janinemueller26 at gmail dot com I had also a mysql error with drupal and mysql on http://www.sportwettentipp.com, but update to the newest version and works fine, thanks for the bug fixing. ------------------------------------------------------------------------ [2010-09-04 20:54:38] php at group dot apple dot com As I noted, the problem disappears when compiled debug, so perhaps that option was enabled in your build? Since valgrind reports heap issues and this appears to be stack corruption, what data are you looking for? Mac OS X has a number of great debugging and analysis tools (Instruments, Shark, dtrace) I can use to get what you need. ------------------------------------------------------------------------ [2010-09-03 18:16:49] mbecc...@php.net I've tried to use -fstack-protector-all both on FreeBSD 6.2 amd64 and Ubuntu Linux x64 and I can't see any segfaults, nor valgrind errors (tested on linux only) using the provided script. ------------------------------------------------------------------------ [2010-09-02 00:49:49] php at group dot apple dot com Does the request for valgrind mean you are unable to reproduce the behavior with - fstack-protector-all? ------------------------------------------------------------------------ [2010-09-01 16:05:57] and...@php.net valgrind output would be helpful :) Thanks! ------------------------------------------------------------------------ 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