php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56729 Apache 1.3.x segfaults
Submitted: 2005-12-16 18:32 UTC Modified: 2006-08-30 00:52 UTC
From: tony at teamxbox dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 4.4.1 OS: RHEL release 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tony at teamxbox dot com
New email:
PHP Version: OS:

 

 [2005-12-16 18:32 UTC] tony at teamxbox dot com
Description:
------------
apache 1.3.34 (mod_php loaded as so)

php 4.4.1, compiled with:  	 './configure' '--prefix=/usr/local/php' '--with-apxs=/usr/local/apache/bin/apxs' '--with-config-file-path=/usr/local/apache/conf' '--with-libxml-dir=/usr/lib/libxml2' '--with-mysql' '--with-gettext' '--with-xml' '--with-dom' '--with-zlib' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-tiff-dir' '--with-freetype-dir' '--with-ttf' '--with-zlib' '--with-dom' '--with-dom-xslt' '--enable-cli' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libgcc' '--enable-localizer' '--enable-magic-quotes' '--enable-mailparse' '--enable-mbstring' '--enable-pcntl' '--enable-shmop' '--enable-sigchild' '--enable-sysvshm' '--enable-sysvsem' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-force-cgi-redirect' '--enable-sockets' '--with-sockets' '--enable-soap' '--disable-cgi'

apc 3.0.8, compiled with: ./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/local/apache/bin/apxs --with-php-config=/usr/local/php/bin/php-config

php.ini directives:

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/"
extension="apc.so"
apc.enabled="1"
apc.shm_segments="1"
apc.optimization="0"
apc.shm_size="64"
apc.ttl="7200"
apc.user_ttl="7200"
apc.num_files_hint="2000"
apc.mmap_file_mask="/tmp/apc.XXXXXX"

Any page requested using php will return no output, and I see segfaults in apache's error log, as such:

[Fri Dec 16 15:20:24 2005] [notice] child pid 5757 exit signal Segmentation fault (11)

I can't even get a phpinfo going, but I know the module is loading cause as soon as I enable it in php.ini I see this behavior.

Reproduce code:
---------------
<?php phpinfo(); ?>

Expected result:
----------------
phpinfo, duh :P

Actual result:
--------------
Blank Output, and an apache segfault.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 18:35 UTC] rasmus@php.net
How about a backtrace?  

As in:

gdb /usr/sbin/httpd 
run -X
bt
 [2006-01-05 18:06 UTC] tony at teamxbox dot com
# gdb /usr/local/apache/bin/httpd
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[Thread debugging using libthread_db enabled]
[New Thread -1208023360 (LWP 17634)]
(no debugging symbols found) [many repeats of this message]

[page requested]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208023360 (LWP 17634)]
0x01174bc6 in zend_hash_num_elements (ht=0x8)
    at /var/tmp/php-4.4.1/Zend/zend_hash.c:1001
1001            return ht->nNumOfElements;

(gdb) bt
#0  0x01174bc6 in zend_hash_num_elements (ht=0x8)
    at /var/tmp/php-4.4.1/Zend/zend_hash.c:1001
#1  0x003ee045 in my_compile_file (h=0xbffe46e0, type=2)
    at /home/tford/APC-3.0.8/apc_main.c:278
#2  0x011707d7 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /var/tmp/php-4.4.1/Zend/zend.c:934
#3  0x01149870 in php_execute_script (primary_file=0xbffe46e0)
    at /var/tmp/php-4.4.1/main/main.c:1743
#4  0x01187db4 in apache_php_module_main (r=0x8fd58c0, display_source_mode=0)
    at /var/tmp/php-4.4.1/sapi/apache/sapi_apache.c:54
#5  0x011885e0 in send_php (r=0x8fd58c0, display_source_mode=0, filename=0x0)
    at /var/tmp/php-4.4.1/sapi/apache/mod_php4.c:627
#6  0x08055f89 in ap_invoke_handler ()
#7  0x012f4c97 in tens () from /usr/local/apache/libexec/libphp4.so
(gdb) Quit
 [2006-01-23 12:01 UTC] tony at teamxbox dot com
Any update on this ticket?

Thanks
 [2006-02-24 00:09 UTC] rasmus@php.net
Try current CVS.  There isn't enough info in this report to give me any clue on this.
 [2006-02-24 17:26 UTC] tony at teamxbox dot com
Latest CVS of php or APC? If you're talking about APC where is cvs hosted at?
 [2006-02-25 04:17 UTC] rasmus@php.net
cvs -d :pserver:cvsread@cvs.php.net:/repository login
Password: phpfi
cvs -d :pserver:cvsread@cvs.php.net:/repository co pecl/apc
phpize
./configure --enable-apc-mmap --with-apxs=/usr/local/bin/apxs
make
make install
 [2006-03-08 19:30 UTC] tony at teamxbox dot com
I've just built apc 3.0.9 and I still have the same segfaults in apache. I can't get any page to load, there aren't even http response headers. Here is backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208023360 (LWP 779)]
0x0106cbc6 in zend_hash_num_elements (ht=0x8) at /var/tmp/php-4.4.1/Zend/zend_hash.c:1001
1001    /var/tmp/php-4.4.1/Zend/zend_hash.c: No such file or directory.
        in /var/tmp/php-4.4.1/Zend/zend_hash.c
(gdb) bt
#0  0x0106cbc6 in zend_hash_num_elements (ht=0x8) at /var/tmp/php-4.4.1/Zend/zend_hash.c:1001
#1  0x0027a8c7 in my_compile_file (h=0xbffa6650, type=2) at /home/tford/APC-3.0.9/apc_main.c:258
#2  0x010687d7 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /var/tmp/php-4.4.1/Zend/zend.c:934
#3  0x01041870 in php_execute_script (primary_file=0xbffa6650) at /var/tmp/php-4.4.1/main/main.c:1743
#4  0x0107fdb4 in apache_php_module_main (r=0x9d63c20, display_source_mode=0) at /var/tmp/php-4.4.1/sapi/apache/sapi_apache.c:54
#5  0x010805e0 in send_php (r=0x9d63c20, display_source_mode=0, filename=0x0) at /var/tmp/php-4.4.1/sapi/apache/mod_php4.c:627
#6  0x08055f89 in ap_invoke_handler ()
#7  0x011ecc97 in tens () from /usr/local/apache/libexec/libphp4.so
 [2006-03-11 04:45 UTC] rasmus@php.net
This is with a simple hello world script?
 [2006-03-13 12:08 UTC] tony at teamxbox dot com
This was happening on any request that used php. I went ahead and setup a hello world script:

<?php

echo 'Hello World';

?>

and the same issue is still there. It's pretty much anything, can't even get a phpinfo to respond.

Thanks
 [2006-04-27 10:01 UTC] cschmitz at gedak dot de
Hi!

I?ve got the same error when I use Zend Optimizer at the same time. Without ZO it?s running...
 [2006-04-30 17:27 UTC] tony at teamxbox dot com
Rasmus, I'm till trying to get this going and decided to try some different things today. Curious, apc works and is enabled from the shell. With apc enabled in php.ini and I run:

shell> php -q -r "phpinfo();"

I get a full phpinfo output and there's an apc section:

apc

APC Support => enabled
Version => 3.0.10
MMAP Support => Enabled
MMAP File Mask => /tmp/apc.IRNHty
Revision => $Revision: 3.84 $
Build Date => Apr 30 2006 14:07:02

Directive => Local Value => Master Value
apc.cache_by_default => On => On
apc.enable_cli => On => On
apc.enabled => On => On
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => /tmp/apc.IRNHty => /tmp/apc.IRNHty
apc.num_files_hint => 1024 => 1024
apc.optimization => Off => Off
apc.shm_segments => 1 => 1
apc.shm_size => 128 => 128
apc.slam_defense => Off => Off
apc.stat => On => On
apc.ttl => 7200 => 7200
apc.user_entries_hint => 100 => 100
apc.user_ttl => 7200 => 7200

So, this has to be something apache related, but I built against my apxs defining the path during configure. Also, I've gone as far as to disable other apache modules I'm loading as dsos just to be sure there's no conflict, but same behavior. Let me know what I can do to help.

Thanks
 - Tony
 [2006-07-29 08:59 UTC] tony at teamxbox dot com
Yo Rasmus, I was looking at another similar bug: 6935 and I saw that you recommended compiling apache with no optimizations. Well, I thought I'd give it and try and it worked :)

Iwas compiling apache with CFLAGS="O3" and after I rebuilt apache with no compile flags apc is loading just fine.
 [2006-08-30 00:52 UTC] gopalv82 at yahoo dot com
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support/ as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

Closing as bogus (gcc optimization)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC