Note that there are some explanatory texts on larger screens.

plurals
  1. POCan actual PHP code be causing a segmentation fault in Apache, and if so how?
    primarykey
    data
    text
    <p>I have Apache 2.2.14 installed with PHP version 5.3.2 and libapache2-mod-php5 version 5.3.2-1ubuntu4.7 on Ubuntu 10.04 x64. I am getting segmentation faults rather frequently in my apache2 error logs. After getting Apache to dump a crash log and running it through gdb it seems the culprit is the php module. It's crashing on a specific bit of code. Here is the output from gdb:</p> <pre><code> Core was generated by `/usr/sbin/apache2 -k start'. Program terminated with signal 11, Segmentation fault. 0 0x00007ff2b3acaec3 in _zend_mm_free_canary_int (heap=0x7ff2b9035b10, p=0x6d48358fae6de187) at /build/buildd/php5-5.3.2/Zend/zend_alloc_canary.c:2090 2090 /build/buildd/php5-5.3.2/Zend/zend_alloc_canary.c: No such file or directory. in /build/buildd/php5-5.3.2/Zend/zend_alloc_canary.c </code></pre> <p>A look at frame 0, the innermost frame, yields this:</p> <pre><code>(gdb) dump_bt executor_globals.current_execute_data [0xb79f0c10] get() /var/www/somedirectory/Settingsfile.inc:18 [0xb79f09f0] get() /var/www/somedirectory/securityfile.inc:10 [0xb79ef068] __construct() /var/www/somedirectory/phpfile.php:3 </code></pre> <p>This code was previously running on a server with libapache2-mod-php5 and PHP version 5.2.6 and Apache 2.2.9. We moved everything to a server running newer versions of everything and started getting these segfaults along with reports that users are intermittently getting blank pages when they attempt to access the site. It would appear that the two are related and the segfaults are being caused by the code, but I've no idea how to begin to track down what might be wrong, nor if it's even in fact possible for PHP code to cause this. I don't actually know anything about PHP, and therefore didn't write this code. So my questions are:</p> <ol> <li>Could the code actually be causing segmentation faults in Apache? Am I interpreting this output properly? </li> <li>How does one debug PHP code? I tried to use Firebug and its companion plugins, but it required more web programming experience than I have. </li> <li><p>Could modules loaded into PHP itself cause issues with how the PHP module functions? I understand that with mod_php5 installed that's how Apache processes PHP requests/scripts, but does the actual PHP5 install have any bearing on how that's done? By that I mean that I have the following installed:</p> <p>libapache2-mod-php5 5.3.2-1ubuntu4.7<br> php5 5.3.2-1ubuntu4.7<br> php5-cli 5.3.2-1ubuntu4.7<br> php5-common 5.3.2-1ubuntu4.7<br> php5-curl 5.3.2-1ubuntu4.7<br> php5-mysql 5.3.2-1ubuntu4.7 </p></li> </ol> <p>I'm not sure how they work together, if they do at all, like if I could simply uninstall php5 all together and leave libapache2-mod-php5 if that would make a difference. </p> <p>Thanks in advance for any advice you can give me on tracking this down. If you need the actual lines from the PHP scripts themselves I can provide them as well. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload