php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56493 Segfault on AMD64
Submitted: 2005-08-15 21:50 UTC Modified: 2009-02-16 19:47 UTC
From: etnu at etnu dot org Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5_1 CVS-2005-08-15 (dev) OS: Debian 3.1 (Sarge)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: etnu at etnu dot org
New email:
PHP Version: OS:

 

 [2005-08-15 21:50 UTC] etnu at etnu dot org
Description:
------------
I'm seeing intermittent segfaults with both PHP5.0.4 and 5.1.

System setup:

OS: Debian 3.1 amd64 port
Kernel: 2.6.8 amd64 / smp
CPU: Dual Opteron 248.
Apache: 2.0.54
APC: 3.0.6

PHP, Apache, PostgreSQL, and APC all built from source. Everything else from apt-get

PHP Build:

export CFLAGS="-O3 -m64 -funroll-loops"
./configure \
--with-pgsql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr --with-mysqli=/usr/bin/mysql_config \
--prefix=/usr/local/apache2/php \
--with-config-file-path=/usr/local/apache2/php \
--enable-force-cgi-redirect \
--disable-magic-quotes \
--with-curl \
--with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib

APC build:

./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/local/apache2/bin/apxs --with-php-config=/usr/local/apache2/php/bin/php-config

I can't seem to find any consistent way to reproduce it. If I leave the server running long enough, it segfaults. The server that this runs on is running vBulletin, which is pretty buggy (i've had to patch the code in several places to get around the fatal errors when passing by reference, and i get about 4-5 notices every page view about uninitialized variables), so it could be anything.

One other interesting note: when I build this setup I got a few warnings from the postgres build about converting to pointers of different types. 



Expected result:
----------------
Not segfaulting

Actual result:
--------------
Segfaulting

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-15 22:50 UTC] rasmus@php.net
Which Apache2 mpm are you using?
 [2005-08-15 23:55 UTC] etnu at etnu dot org
Using prefork MPM.

My Apache build:

./configure \
--prefix=/usr/local/apache2 \
--with-mpm=prefork \
--enable-so \
--enable-cgi \
--enable-deflate \
--enable-speling \
--enable-rewrite \
--enable-ssl \
--enable-mime-magic \
--enable-suexec \
--enable-static-rotatelogs

I'm using a virtually identical setup on about a half-dozen Dual Xeon machines, though those are all running e-Accelerator as an opcode cache. e-Accelerator is pretty much dead in the water on amd64 / php5, and I've never really been happy with it anyway. I was hoping to migrate all the servers at both of my companies over to the PECL extension.

I have 6 of these boxes with more or less identical configurations (the only differences are in the RAID controllers & hard drives, so nothing that should affect this). 3 are dedicated mysql & pgsql db servers, and they don't seem to have any issues there. I originally suspected that the problem might be a debian-specific issue with the amd64 port, but nothing else seems to fail. 

One of the other boxes is running code that's a lot cleaner than the vbulletin stuff (not even E_STRICT warnings), and it seems to run perfectly without issue, even when I send 2000 simultaneous requests at it.
 [2005-08-16 00:18 UTC] rasmus@php.net
Can you get me a backtrace of one of these segfaults?  If nothing else works, try running httpd -X under gdb and hit it until it crashes then type: bt

I wouldn't be too surprised if you are hitting a memory corruption due to a race condition somewhere in that setup.  It isn't necessarily an APC bug directly, but it shows up under APC because of the different and persistent memory handling it does.

Can you also try disabling one of your cpus and trying it?

And, could you try also try building APC with --enable-apc-sem
to use semaphore locking.  Not that I think it will help, but it adds a datapoint by eliminating a potential source of the problem.
 [2005-08-16 22:16 UTC] etnu at etnu dot org
--enable-apc-sem seems to fix the problem in most cases, though I'm still seeing seg faults in a few rare occurances when a file that's been cached gets modified. Apache has been running for about 18 hours under this configuration without a problem.

Attempting to install gdb seems to give some errors compiling as well, so that's a no-go until I can get that straightened out.
 [2006-02-24 02:00 UTC] rasmus@php.net
Any update on this?  Try current CVS.  There have been a number of fixes recently.
 [2009-02-16 19:47 UTC] shire@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 18 08:03:18 2022 UTC