Apache Debugging

As usual…

After some changes apache start producing segfauls.

#vi /etc/apache2/apache2.conf

CoreDumpDirectory /tmp/apache2-cores

#ulimit -c unlimited

#/etc/init.d/apache2 restart

 

Now apache will put core files to /tmp/apache2-cores (don`t forget to create folder with sufficient rights.)

Testing

#kill -11 PID
#ls /tmp/apache2-cores

All woring, we can observer core.

 

Now launch your ugly script causing cores.

Run GDB.

#gdb /usr/sbin/apache2 /tmp/apache2-cores/core

Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.
[New process 26683]
#0 0xf7662caf in memcpy () from /lib/libc.so.6
(gdb) where
#0 0xf7662caf in memcpy () from /lib/libc.so.6
#1 0xf63ef13f in restore_class () from /usr/lib/php5/20060613+lfs/eaccelerator.so
#2 0xf63ed390 in eaccelerator_compile_file () from /usr/lib/php5/lfs/eaccelerator.so
#3 0xf6987e73 in compile_filename () from /usr/lib/apache2/modules/libphp5.so
#4 0xf69d2bbf in ?? () from /usr/lib/apache2/modules/libphp5.so
#5 0x00000008 in ?? ()
#6 0xfff5de20 in ?? ()
#7 0xfff5dda8 in ?? ()
#8 0xf698aa8e in ?? () from /usr/lib/apache2/modules/libphp5.so
#9 0x08bfe23d in ?? ()
#10 0x08bfd240 in ?? ()
#11 0xfff5dda4 in ?? ()
#12 0xf69c912e in ?? () from /usr/lib/apache2/modules/libphp5.so
#13 0xf52edc24 in ?? ()
#14 0xfff5e024 in ?? ()
#15 0x00000000 in ?? ()
(gdb)

This mean segfault occurs at eaccelerator. When eaccelerator tries to put bytecode to disk.
Damn. As usual all accelerators are crap. 🙁

Disable eaccelerator at /etc/php5/conf-d/xxxx.ini
and restart apache.
Error gone. According to my experience and experience of my colleges, all accelerators creates segfault on some applications. If your want stability, better to extend number of servers. But if accelerator is working for you – your are lucky guy! 🙂

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>