I supposed the problem was on some php extension, so I deactivated some of them…but the problem was still there :(
After spending a lot of time looking for what was causing it, I decided to debug apache withgdb. I installed it throughbackportsbecause I needed an upper version than gdb 7.0 (7.0.1-2 is the current version on squeeze stable repository) otherwise I got this:“warning: The current binary is a PIE (Position Independent Executable), which GDB does NOT currently support. Most debugger features will fail if used in this session.”when I was trying to debug apache:
2956 /tmp/buildd/php5-5.3.3/Zend/zend_compile.c: No such file or directory.
I had a problem with php as I thought, and I was able to find more information about it. And after Googling for a few minutes, I found there is a bug with the PHP andAPCversion that I was using! (more infohere)
After that, I could solve the problem and until now I haven’t got more segfaults on this server :)
Using gdb will not solve your segmentation faults, but at least, you will be able to figure out what’s causing it, and you’ll get more info to solve it.