title: PHP APC causing Apache to seg fault
body: <p>First, versions:</p>
  
  <p>Apache 2.2.22<br>
  PHP 5.3.10<br>
  Ubuntu 12.04 LTS (everything updated)<br>
  APC 3.1.7 (installed via APT and not PEAR)</p>
  
  <p>The problem I'm experiencing is that when issuing a graceful restart (<code>sudo service apache2 graceful</code>), PHP has a fatal error which causes Apache to seg fault. This is what I see in <code>/var/log/apache2/error.log</code>:</p>
  
  <pre><code>[Tue Apr 30 11:05:33 2013] [notice] Graceful restart requested, doing restart
  PHP Fatal error:  PHP Startup: apc_mmap: mmap failed: in Unknown on line 0
  [Tue Apr 30 11:05:34 2013] [notice] seg fault or similar nasty error detected in the parent process
  </code></pre>
  
  <p><code>/etc/php5/conf.d/apc.ini</code> only contains the following:</p>
  
  <pre><code>extension=apc.so
  apc.shm_size=256M
  </code></pre>
  
  <p><a href="http://www.linode.com/" rel="nofollow">Linode</a> is my host. I have the 1GB version with a 256MB swap partition, so 256M should be a reasonable value for <code>apc.shm_size</code> (prior to the recent <a href="http://blog.linode.com/2013/04/09/linode-nextgen-ram-upgrade/" rel="nofollow">Linode memory upgrade</a>, I only had 512MB of memory, and <code>apc.shm_size</code> was set to 128M).</p>
  
  <p>Here is some general cache information as shown in <code>apc.php</code>:</p>
  
  <pre><code>APC Version 3.1.7
  PHP Version 5.3.10-1ubuntu3.6
  APC Host    [removed]
  Server Software Apache/2.2.22 (Ubuntu)
  Shared Memory   1 Segment(s) with 256.0 MBytes
  (mmap memory, pthread mutex Locks locking)
  Start Time  2013/04/30 11:09:44
  Uptime  21 minutes
  File Upload Support 1
  </code></pre>
  
  <p>Here are my runtime settings as shown in <code>apc.php</code>:</p>
  
  <pre><code>apc.cache_by_default    1
  apc.canonicalize    1
  apc.coredump_unmap  0
  apc.enable_cli  0
  apc.enabled 1
  apc.file_md5    0
  apc.file_update_protection  2
  apc.filters 
  apc.gc_ttl  3600
  apc.include_once_override   0
  apc.lazy_classes    0
  apc.lazy_functions  0
  apc.max_file_size   1M
  apc.mmap_file_mask  
  apc.num_files_hint  1000
  apc.preload_path    
  apc.report_autofilter   0
  apc.rfc1867 0
  apc.rfc1867_freq    0
  apc.rfc1867_name    APC_UPLOAD_PROGRESS
  apc.rfc1867_prefix  upload_
  apc.rfc1867_ttl 3600
  apc.serializer  default
  apc.shm_segments    1
  apc.shm_size    256M
  apc.slam_defense    1
  apc.stat    1
  apc.stat_ctime  0
  apc.ttl 0
  apc.use_request_time    1
  apc.user_entries_hint   4096
  apc.user_ttl    0
  apc.write_lock  1
  </code></pre>
  
  <p>I've done a ton of searching around, but I just can't figure out what's causing this. Is this perhaps a PHP or APC or Apache bug? Is there some configuration value I need to add/change?</p>
  
  <p>Thanks for any help!</p>
  
  <p>[edit]<br>
  I just tried updating APC (removed it in apt and installed through PECL), but that didn't fix the problem. I still see seg faults with APC 3.1.13.</p>