Tracking down apache segfaults

Delivery ends in the middle of a PHP page. Where’s the rest of it ?

After some research, it came out that the apache logfile was reporting segfaults from the child processes. Unfortunately, this is not done in the domain’s error.log, but in /var/log/apache2/error.log :-(

Lot of googling showed several possible causes for segfault in apache :

  • PHP4 compatibility as set in httpd.conf or /etc/apache2/conf.d/…
  • Conflicting Berkeley DB libraries installed. However… which subpart is using this ?
  • Getting out of memory, having somewhere a malloc() returning NULL, and not catched by code (bad programming)
  • Using rewrite rules and doing bad matching. This can be monitored by setting XXXXXX
  • Releasing memory from recursive objects leads to memory leaks in PHP (< 5.3)