php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63056 PHP 5.4: Segfault with apc_new_interned_string()
Submitted: 2012-09-10 15:43 UTC Modified: 2013-02-18 00:36 UTC
From: lstrojny@php.net Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.4.6 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-09-10 15:43 UTC] lstrojny@php.net
Description:
------------
See stacktrace:

#0  0x00007f087da208f1 in apc_new_interned_string () from 
/usr/lib/php5/20100525/apc.so
(gdb) bt full
#0  0x00007f087da208f1 in apc_new_interned_string () from 
/usr/lib/php5/20100525/apc.so
No symbol table info available.
#1  0x00007f087da14b04 in apc_string_pmemcpy () from /usr/lib/php5/20100525/apc.so
No symbol table info available.
#2  0x00007f087da18515 in my_copy_zval () from /usr/lib/php5/20100525/apc.so
No symbol table info available.
#3  0x00007f087da15f22 in apc_copy_op_array () from /usr/lib/php5/20100525/apc.so
No symbol table info available.
#4  0x00007f087da19386 in apc_compile_cache_entry () from 
/usr/lib/php5/20100525/apc.so
No symbol table info available.
#5  0x00007f087da19c43 in my_compile_file () from /usr/lib/php5/20100525/apc.so
No symbol table info available.
#6  0x0000000000540041 in phar_postprocess_file (idata=0x0, crc32=2, 
    error=0x7f0881b02710, process_zip=-12185)
    at /usr/src/php5.4/source/php5-5.4.6/ext/phar/phar.c:2413
        crc = 1968320357
        fp = 0x7fff235a6110
#7  0x9075a9834ce12514 in ?? ()
No symbol table info available.
#8  0x6f8befeab8b32514 in ?? ()
No symbol table info available.
#9  0x0000000000000000 in ?? ()
No symbol table info available.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-10 18:11 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-09-10 18:11 UTC] pajoye@php.net
this function is used for any class name, string, etc. It would help to have something to begin with, a script that is :)
 [2013-02-10 00:00 UTC] cstdenis at ctgameinfo dot com
I am getting this same segfault. It does not depend on the contents of the file 
(a one-word plain text file with no <?php will trigger it)

Using php 5.4.11 and APC 3.1.13 on FreeBSD 9.1

Seems to be triggered by setting apc.shm_size to a value of less than 5M. 
Setting apc.shm_size="5M" fixes it for me. 

#0  0x000000080241c79e in apc_new_interned_string () from 
/usr/local/lib/php/20100525/apc.so
#1  0x0000000802410e27 in apc_string_pmemcpy () from 
/usr/local/lib/php/20100525/apc.so
#2  0x00000008024116aa in my_copy_zval () from 
/usr/local/lib/php/20100525/apc.so
#3  0x00000008024124a7 in apc_copy_op_array () from 
/usr/local/lib/php/20100525/apc.so
#4  0x0000000802415653 in apc_compile_cache_entry () from 
/usr/local/lib/php/20100525/apc.so
#5  0x0000000802415e80 in my_compile_file () from 
/usr/local/lib/php/20100525/apc.so
#6  0x00000000005668ba in zend_execute_scripts ()
#7  0x000000000050a37c in php_execute_script ()
#8  0x000000000060a7c4 in do_cli ()
#9  0x000000000060af61 in main ()
#10 0x00000000004189fe in _start ()
 [2013-02-10 00:29 UTC] lstrojny@php.net
unfortunately I can’t confirm that theory, as we run APC with an shm size of 512M.
 [2013-02-10 03:21 UTC] cstdenis at ctgameinfo dot com
They may not be the same bug then -- I am running a newer version than your 
initial report. Mine happens immediately on the http request (or commandline 
execution with apc.enable_cli=1)

apc.shm_size="2M" works fine on my older php 5.3.13/apc3.1.7 installation so it 
looks like 5.4 (or newer memcache version) uses much more memory in the case of 
apc cache (or perhaps just a much higher initial overhead).

Cached Files: 3 (324.9 KBytes)
Memory used: 4.4 MBytes (87.1%)  (not using user cache, just opcode)

They may both be cache memory exhaustion related bugs, try increasing it if you 
can spare the ram and see what happens. 

Fyi, my shm type is: mmap memory, File Locks locking
 [2013-02-18 00:36 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue May 11 14:01:34 2021 UTC