lighttpd forum XCache > xcache and segmentation faults in apache?

Posted by jv (Guest)
on 24.01.2008 20:21
Hi, I'm using Apache 2.2 and Php 5.2.5 with xCache 2.2.
I am on Intel Quad Core with 4 GB Memory.

It seems I always get segmentation fault after like leaving it run for a 
day or two.

I have the following php modules loaded.

[root@server ~]# php -l -v
PHP 5.2.5 (cli) (built: Jan 10 2008 02:38:22)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
    with the ionCube PHP Loader v3.1.26, Copyright (c) 2002-2006, by 
ionCube Ltd., and
    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend 
Technologies
    with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend 
Technologies



And here is my xcache settings:
[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =                512M
xcache.count =                 1
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0
xcache.var_size  =            8M
xcache.var_count =             1
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     0
xcache.test =                Off
xcache.readonly_protection = Off
xcache.mmap_path =    "/tmp/xcache"
xcache.coredump_directory =   ""
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           Off

[xcache.coverager]
xcache.coverager =          Off
xcache.coveragedump_directory = ""



The reason why i set count to 1 is because i seem to get even more 
segmentation faults when i set it to 4. 1 seem to last me longer before 
the seg fault.

Can someone poitn me out here to see what could be the problem?

It's very uncomforting to know that your server will crash in middle of 
the night with this segfault.

Thx in advance.
Posted by James James
on 28.01.2008 06:42
moo?

do you have a say for this?
Posted by apples (Guest)
on 29.01.2008 02:45
I have problem too.

Please help me.

[Tue Jan 29 09:10:16 2008] [notice] child pid 8168 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:20 2008] [notice] child pid 7886 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:20 2008] [notice] child pid 8028 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:20 2008] [notice] child pid 8186 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:22 2008] [notice] child pid 7693 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:24 2008] [notice] child pid 7699 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:24 2008] [notice] child pid 8173 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:24 2008] [notice] child pid 8174 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:30 2008] [notice] child pid 8007 exit signal 
Segmentation fault (11)
[Tue Jan 29 09:10:47 2008] [notice] child pid 8287 exit signal 
Segmentation fault (11)
Posted by moo XCache
on 31.01.2008 01:27
Posted by moo XCache
on 05.02.2008 17:16
this is not a XCache but a known php problem, see the following bug
reports in php
http://bugs.php.net/bug.php?id=43476
http://bugs.php.net/bug.php?id=43295

pls try to downgrade to 5.2.4 and wait for 5.2.6
Posted by JJ (Guest)
on 13.02.2008 16:24
I downgraded to 5.2.4 but still get segfaults under load with gallery2. 
I'll try to generate backtrace
Posted by JJ (Guest)
on 29.02.2008 12:28
My apache error log, with backtrace at the bottom (i think)

http://www.lolzing.com/Support/XCache/Apache_error_log_and_gdb_backtrace.rtf

I'd be happy to pay someone to fix this too, if anyone has a 
recommendation :)
Posted by moo XCache
on 01.03.2008 02:13
JJ wrote:
> My apache error log, with backtrace at the bottom (i think)
> 
> http://www.lolzing.com/Support/XCache/Apache_error_log_and_gdb_backtrace.rtf
> 
> I'd be happy to pay someone to fix this too, if anyone has a 
> recommendation :)

hrm... you forgot to type "bt" in gdb, but glibc did show the backtrace.
can u try to disable suhosin and see if it's fine
Posted by JJ (Guest)
on 01.03.2008 13:17
> hrm... you forgot to type "bt" in gdb, but glibc did show the backtrace.
> can u try to disable suhosin and see if it's fine

Sry here's the bt part: http://www.lolzing.com/Support/XCache/gdb_bt.txt

Was having this before suhosin but I'll get rid of that if you like :)

Cross posting to gallery forum in case they have ideas
http://gallery.menalto.com/node/74441

thx for your help, XCache is essential :)
Posted by moo XCache
on 02.03.2008 14:57
JJ wrote:
>> hrm... you forgot to type "bt" in gdb, but glibc did show the backtrace.
>> can u try to disable suhosin and see if it's fine
> 
> Sry here's the bt part: http://www.lolzing.com/Support/XCache/gdb_bt.txt
> 
> Was having this before suhosin but I'll get rid of that if you like :)
> 
> Cross posting to gallery forum in case they have ideas
> http://gallery.menalto.com/node/74441
> 
> thx for your help, XCache is essential :)

see http://bugs.php.net/bugs-generating-backtrace.php
(gdb) frame 3
#3  0x080f1cc4 in execute (op_array=0x816c670) at ./zend_execute.c:1605
(gdb) print (char 
*)(executor_globals.function_state_ptr->function)->common.function_name
$14 = 0x80fa6fa "pg_result_error"
(gdb) print (char *)executor_globals.active_op_array->function_name
$15 = 0x816cfc4 "result_error"
(gdb) print (char *)executor_globals.active_op_array->filename
$16 = 0x816afbc "/home/yohgaki/cvs/php/DEV/segfault.php"
(gdb)

but the example was for php4, i'm not sure if it works for php5.
i'd like to log into the box and check the core/gdb myself, or u can 
send me the core file, httpd, libphp5.so etc, i'm not sure which files 
is required yet
Posted by Justin Jones
on 07.03.2008 12:19
JJ here, I noticed that when MySQL gets busy (circled red area) and 
spikes to 50% CPU use, that will cause segfaults hourly.
http://www.lolzing.com/Support/XCache/mysql_bytes-week.png

The first thing in the error log when a server is overloaded is a 
segfault, that might be the cause of some people's random segfaults. 
However even with low MySQL activity I still get 3-4 segfaults a day. 
That'd be great if you want to login to the box and have a look.  It's a 
simple setup, Apache 1.3 PHP 5.2.4, and gallery2 is the only script.  I 
sent you a message through the board with login info :)
Posted by moo XCache
on 07.03.2008 15:25
the core file you kept is truncated to 0 byte, can u do a rename (mv) 
and keep it from truncating before i can check it next time?