Can someone help me find the smallest block of code that is making Apache SEGV? Actually the code is about 30 lines and actually depends with Doctrine (which I think it is not causing the crash as well, but it is combined with something else). I also make use of user defined stream wrappers. These combined cause PHP crash Apache when it is freeing resources (the last called function was stream_close, when I removed that method from my user-defined stream, it doesn't crashes anymore). The code makes use of register_shutdown_function to try to detect an E_ERROR (or other fatal error) and them output gracefully to the user. Removing Doctrine (that is actually just initialized) or my user-defined stream, there is no crash. PHP 5.2.6 (also tested with PHP 5.2.8) Apache 2.2 I am beginner on finding bugs on PHP, this one is really boring me because it makes an important part of my software not work. I have the backtrace and a ready to debug environment (PHP 5.2.6 and Apache 2.2) with GDB. -- Davi R. Tavares