php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56831 Segfault on Solaris/Sparc loading APC
Submitted: 2006-02-09 12:27 UTC Modified: 2006-02-09 12:39 UTC
From: fred dot cohen at iridium dot com Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.1.1 OS: Solaris 9 Sparc
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fred dot cohen at iridium dot com
New email:
PHP Version: OS:

 

 [2006-02-09 12:27 UTC] fred dot cohen at iridium dot com
Description:
------------
APC Version: 5.0.8
PHP: 5.1.2

Apache/PHP will when segfault attempting to load apc.so extension.

GDB Backtrace will show error occured in OnUpdateLong
#0  0xffffffff78efbadc in OnUpdateLong () from /usr/local/apache/libe 

Problem can corrected by update to file apc_globals.h

In 64-bit environment int is 32bits, longs are 64bits.


# diff apc_globals.h.old apc_globals.h    
45,53c45,53
<     int enabled;            /* if true, apc is enabled (defaults to true) */
<     int shm_segments;       /* number of shared memory segments to use */
<     int shm_size;           /* size of each shared memory segment (in MB) */
<     int optimization;       /* optimizer level (higher = more aggressive) */
<     int num_files_hint;     /* parameter to apc_cache_create */
<     int user_entries_hint;
<     int gc_ttl;             /* parameter to apc_cache_create */
<     int ttl;                /* parameter to apc_cache_create */
<     int user_ttl;
---
>     long enabled;            /* if true, apc is enabled (defaults to true) */
>     long shm_segments;       /* number of shared memory segments to use */
>     long shm_size;           /* size of each shared memory segment (in MB) */
>     long optimization;       /* optimizer level (higher = more aggressive) */
>     long num_files_hint;     /* parameter to apc_cache_create */
>     long user_entries_hint;
>     long gc_ttl;             /* parameter to apc_cache_create */
>     long ttl;                /* parameter to apc_cache_create */
>     long user_ttl;
62c62
<     int cache_by_default;   /* true if files should be cached unless filtered out */
---
>     long cache_by_default;   /* true if files should be cached unless filtered out */
64c64
<     int slam_defense;       /* Probability of a process not caching an uncached file */
---
>     long slam_defense;       /* Probability of a process not caching an uncached file */
66,67c66,67
<     int file_update_protection; /* Age in seconds before a file is eligible to be cached - 0 to disable */
<     int enable_cli;         /* Flag to override turning APC off for CLI */
---
>     long file_update_protection; /* Age in seconds before a file is eligible to be cached - 0 to disable */
>     long enable_cli;         /* Flag to override turning APC off for CLI */




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-09 12:30 UTC] fred dot cohen at iridium dot com
diff output of our files is also available here:
http://demosoft.org/php/apc_globals.h.diff
 [2006-02-09 12:39 UTC] rasmus@php.net
Oh glory be!  A bug report with a patch.  That hasn't happened in ages.  Thanks.

I changed your patch a bit.  Some of these should actually be booleans.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 13:01:33 2025 UTC