php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60415 APC 3.1.9 crashes CLI on shutdown with apc.enable_cli=1
Submitted: 2011-11-30 09:40 UTC Modified: 2013-02-18 00:35 UTC
Votes:4
Avg. Score:4.0 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: tim at digicol dot de Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.4.0RC2 OS: Linux 2.6.18 x86_64 CentOS 5.5
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim at digicol dot de
New email:
PHP Version: OS:

 

 [2011-11-30 09:40 UTC] tim at digicol dot de
Description:
------------
With apc.enable_cli=1 in php.ini, every command line PHP invocation displays a 
backtrace on shutdown. 

APC is the latest version, 3.1.9, installed via "sudo pecl install apc".

Test script:
---------------
php -v

Expected result:
----------------
PHP 5.4.0RC2 (cli) (built: Nov 30 2011 09:16:28) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies


Actual result:
--------------
PHP 5.4.0RC2 (cli) (built: Nov 30 2011 09:16:28) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies
*** glibc detected *** php: free(): invalid pointer: 0x00002b74080307b8 ***
======= Backtrace: =========
/lib64/libc.so.6[0x30b9e7230f]
/lib64/libc.so.6(cfree+0x4b)[0x30b9e7276b]
php(destroy_zend_class+0x270)[0x7792d0]
php(zend_hash_clean+0x69)[0x78fbc9]
/usr/local/lib/php/extensions/no-debug-non-zts-
20100525/apc.so(apc_interned_strings_shutdown+0x20)[0x2b740b957f60]
/usr/local/lib/php/extensions/no-debug-non-zts-
20100525/apc.so(apc_module_shutdown+0x12a)[0x2b740b9506ca]
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so[0x2b740b9474af]
php[0x787713]
php[0x78f679]
php(zend_hash_graceful_reverse_destroy+0x18)[0x78f8f8]
php[0x783355]
php(php_module_shutdown+0x25)[0x725bd5]
php[0x828988]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x30b9e1d994]
php[0x42e7e9]
======= Memory map: ========
00400000-00c01000 r-xp 00000000 fd:00 107857                             
/usr/local/bin/php
00e01000-00ec2000 rw-p 00801000 fd:00 107857                             
/usr/local/bin/php
00ec2000-00ee6000 rw-p 00ec2000 00:00 0 
17fd7000-18229000 rw-p 17fd7000 00:00 0                                  [heap]
30b9a00000-30b9a1c000 r-xp 00000000 fd:00 648557                         
/lib64/ld-2.5.so
30b9c1b000-30b9c1c000 r--p 0001b000 fd:00 648557                         
/lib64/ld-2.5.so
30b9c1c000-30b9c1d000 rw-p 0001c000 fd:00 648557                         
/lib64/ld-2.5.so
30b9e00000-30b9f4e000 r-xp 00000000 fd:00 648558                         
/lib64/libc-2.5.so
30b9f4e000-30ba14d000 ---p 0014e000 fd:00 648558                         
/lib64/libc-2.5.so
30ba14d000-30ba151000 r--p 0014d000 fd:00 648558                         
/lib64/libc-2.5.so
30ba151000-30ba152000 rw-p 00151000 fd:00 648558                         
/lib64/libc-2.5.so
30ba152000-30ba157000 rw-p 30ba152000 00:00 0 
30ba200000-30ba202000 r-xp 00000000 fd:00 648563                         
/lib64/libdl-2.5.so
30ba202000-30ba402000 ---p 00002000 fd:00 648563                         
/lib64/libdl-2.5.so
30ba402000-30ba403000 r--p 00002000 fd:00 648563                         
/lib64/libdl-2.5.so
30ba403000-30ba404000 rw-p 00003000 fd:00 648563                         
/lib64/libdl-2.5.so
30ba600000-30ba603000 r-xp 00000000 fd:00 648863                         
/lib64/libtermcap.so.2.0.8
30ba603000-30ba802000 ---p 00003000 fd:00 648863                         
/lib64/libtermcap.so.2.0.8
30ba802000-30ba803000 rw-p 00002000 fd:00 648863                         
/lib64/libtermcap.so.2.0.8
30baa00000-30baa82000 r-xp 00000000 fd:00 648560                         
/lib64/libm-2.5.so
30baa82000-30bac81000 ---p 00082000 fd:00 648560                         
/lib64/libm-2.5.so
30bac81000-30bac82000 r--p 00081000 fd:00 648560                         
/lib64/libm-2.5.so
30bac82000-30bac83000 rw-p 00082000 fd:00 648560                         
/lib64/libm-2.5.so
30bae00000-30bae14000 r-xp 00000000 fd:00 105208                         
/usr/lib64/libz.so.1.2.3
30bae14000-30bb013000 ---p 00014000 fd:00 105208                         
/usr/lib64/libz.so.1.2.3
30bb013000-30bb014000 rw-p 00013000 fd:00 105208                         
/usr/lib64/libz.so.1.2.3
30bb200000-30bb211000 r-xp 00000000 fd:00 116981                         
/usr/lib64/libexslt.so.0.8.13
30bb211000-30bb411000 ---p 00011000 fd:00 116981                         
/usr/lib64/libexslt.so.0.8.13
30bb411000-30bb412000 rw-p 00011000 fd:00 116981                         
/usr/lib64/libexslt.so.0.8.13
30bb600000-30bb63b000 r-xp 00000000 fd:00 648846                         
/lib64/libsepol.so.1
30bb63b000-30bb83b000 ---p 0003b000 fd:00 648846                         
/lib64/libsepol.so.1
30bb83b000-30bb83c000 rw-p 0003b000 fd:00 648846                         
/lib64/libsepol.so.1
30bb83c000-30bb846000 rw-p 30bb83c000 00:00 0 
30bba00000-30bba07000 r-xp 00000000 fd:00 648569                         
/lib64/librt-2.5.so
30bba07000-30bbc07000 ---p 00007000 fd:00 648569                         
/lib64/librt-2.5.so
30bbc07000-30bbc08000 r--p 00007000 fd:00 648569                         
/lib64/librt-2.5.so
30bbc08000-30bbc09000 rw-p 00008000 fd:00 648569                         
/lib64/librt-2.5.so
30bbe00000-30bbe15000 r-xp 00000000 fd:00 648843                         
/lib64/libnsl-2.5.so
30bbe15000-30bc014000 ---p 00015000 fd:00 648843                         
/lib64/libnsl-2.5.so
30bc014000-30bc015000 r--p 00014000 fd:00 648843                         
/lib64/libnsl-2.5.so
30bc015000-30bc016000 rw-p 00015000 fd:00 648843                         
/lib64/libnsl-2.5.so
30bc016000-30bc018000 rw-p 30bc016000 00:00 0 
30bc200000-30bc209000 r-xp 00000000 fd:00 648853                         
/lib64/libcrypt-2.5.so
30bc209000-30bc408000 ---p 00009000 fd:00 648853                         
/lib64/libcrypt-2.5.so
30bc408000-30bc409000 r--p 00008000 fd:00 648853                         
/lib64/libcrypt-2.5.so
30bc409000-30bc40a000 rw-p 00009000 fd:00 648853                         
/lib64/libcrypt-2.5.so
30bc40a000-30bc438000 rw-p 30bc40a000 00:00 0 
30bc600000-30bc611000 r-xp 00000000 fd:00 648844                         
/lib64/libresolv-2.5.so
30bc611000-30bc811000 ---p 00011000 fd:00 648844                         
/lib64/libresolv-2.5.so
30bc811000-30bc812000 r--p 00011000 fd:00 648844                         
/lib64/libresolv-2.5.so
30bc812000-30bc813000 rw-p 00012000 fd:00 648844                         
/lib64/libresolv-2.5.so
30bc813000-30bc815000 rw-p 30bc813000 00:00 0 
30bca00000-30bca0d000 r-xp 00000000 fd:00 648852                         
/lib64/libgcc_s-4.1.2-20080825.so.1
30bca0d000-30bcc0d000 ---p 0000d000 fd:00 648852                         
/lib64/libgcc_s-4.1.2-20080825.so.1
30bcc0d000-30bcc0e000 rw-p 0000d000 fd:00 648852                         
/lib64/libgcc_s-4.1.2-20080825.so.1
30bce00000-30bce02000 r-xp 00000000 fd:00 648845                         
/lib64/libkeyutils-1.2.so
30bce02000-30bd001000 ---p 00002000 fd:00 648845                         
/lib64/libkeyutils-1.2.so
30bd001000-30bd002000 rw-p 00001000 fd:00 648845                         
/lib64/libkeyutils-1.2.so
30bd600000-30bd635000 r-xp 00000000 fd:00 111593                         
/usr/lib64/libreadline.so.5.1
30bd635000-30bd834000 ---p 00035000 fd:00 111593                         
/usr/lib64/libreadline.so.5.1
30bd834000-30bd83c000 rw-p 00034000 fd:00 111593                         
/usr/lib64/libreadline.so.5.1
30bd83c000-30bd83d000 rw-p 30bd83c000 00:00 0 
30be200000-30be32d000 r-xp 00000000 fd:00 648849                         
/lib64/libcrypto.so.0.9.8e
30be32d000-30be52c000 ---p 0012d000 fd:00 648849                         
/lib64/libcrypto.so.0.9.8e
30be52c000-30be54d000 rw-p 0012c000 fd:00 648849                         
/lib64/libcrypto.so.0.9.8e
30be54d000-30be551000 rw-p 30be54d000 00:00 0 
30bea00000-30bea3b000 r-xp 00000000 fd:00 116951                         
/usr/lib64/libcurl.so.3.0.0
30bea3b000-30bec3b000 ---p 0003b000 fd:00 116951                         
/usr/lib64/libcurl.so.3.0.0
30bec3b000-30bec3d000 rw-p 0003b000 fd:00 116951                         
/usr/lib64/libcurl.so.3.0.0
30bee00000-30bee91000 r-xp 00000000 fd:00 116739                         
/usr/lib64/libkrb5.so.3.3
30bee91000-30bf091000 ---p 00091000 fd:00 116739                         
/usr/lib64/libkrb5.so.3.3
30bf091000-30bf095000 rw-p 00091000 fd:00 116739                         
/usr/lib64/libkrb5.so.3.3
30bf600000-30bf624000 r-xp 00000000 fd:00 116738                         
/usr/lib64/libk5crypto.so.3.1
30bf624000-30bf823000 ---p 00024000 fd:00 116738                         
/usr/lib64/libk5crypto.so.3.1
30bf823000-30bf825000 rw-p 00023000 fd:00 116738                         
/usr/lib64/libk5crypto.so.3.1
30bfa00000-30bfa08000 r-xp 00000000 fd:00 109749                         
/usr/lib64/libkrb5support.so.0.1
30bfa08000-30bfc07000 ---p 00008000 fd:00 109749                         
/usr/lib64/libkrb5support.so.0.1
30bfc07000-30bfc08000 rw-p 00007000 fd:00 109749                         
/usr/lib64/libkrb5support.so.0.1
30bfe00000-30bfe2c000 r-xp 00000000 fd:00 116740                         
/usr/lib64/libgssapi_krb5.so.2.2
30bfe2c000-30c002c000 ---p 0002c000 fd:00 116740                         
/usr/lib64/libgssapi_krb5.so.2.2
30c002c000-30c002e000 rw-p 0002c000 fd:00 116740                         
/usr/lib64/libgssapi_krb5.so.2.2
30c0600000-30c0646000 r-xp 00000000 fd:00 648850                         
/lib64/libssl.so.0.9.8e
30c0646000-30c0846000 ---p 00046000 fd:00 648850                         
/lib64/libssl.so.0.9.8e
30c0846000-30c084c000 rw-p 00046000 fd:00 648850                         
/lib64/libssl.so.0.9.8e
30c0a00000-30c0a18000 r-xp 00000000 fd:00 116968                         
/usr/lib64/libsasl2.so.2.0.22
30c0a18000-30c0c18000 ---p 00018000 fd:00 116968                         
/usr/lib64/libsasl2.so.2.0.22
30c0c18000-30c0c19000 rw-p 00018000 fd:00 116968                         
/usr/lib64/libsasl2.so.2.0.22
30c0e00000-30c0e21000 r-xp 00000000 fd:00 104757                         
/usr/lib64/libjpeg.so.62.0.0
30c0e21000-30c1020000 ---p 00021000 fd:00 104757                         
/usr/lib64/libjpeg.so.62.0.0
30c1020000-30c1021000 rw-p 00020000 fd:00 104757                         
/usr/lib64/libjpeg.so.62.0.0
30c1200000-30c1238000 r-xp 00000000 fd:00 116969                         
/usr/lib64/libldap-2.3.so.0.2.31
30c1238000-30c1438000 ---p 00038000 fd:00 116969                         
/usr/lib64/libldap-2.3.so.0.2.31
30c1438000-30c143a000 rw-p 00038000 fd:00 116969                         
/usr/lib64/libldap-2.3.so.0.2.31
30c1e00000-30c1e0d000 r-xp 00000000 fd:00 106766                         
/usr/lib64/liblber-2.3.so.0.2.31
30c1e0d000-30c200d000 ---p 0000d000 fd:00 106766                         
/usr/lib64/liblber-2.3.so.0.2.31
30c200d000-30c200e000 rw-p 0000d000 fd:00 106766                         
/usr/lib64/liblber-2.3.so.0.2.31
30c2200000-30c2223000 r-xp 00000000 fd:00 116744                         
/usr/lib64/libpng12.so.0.10.0
30c2223000-30c2423000 ---p 00023000 fd:00 116744                         
/usr/lib64/libpng12.so.0.10.0
30c2423000-30c2424000 rw-p 00023000 fd:00 116744                         
/usr/lib64/libpng12.so.0.10.0
30c2600000-30c2733000 r-xp 00000000 fd:00 116741                         
/usr/lib64/libxml2.so.2.6.26
30c2733000-30c2933000 ---p 00133000 fd:00 116741                         
/usr/lib64/libxml2.so.2.6.26
30c2933000-30c293c000 rw-p 00133000 fd:00 116741                         
/usr/lib64/libxml2.so.2.6.26
30c293c000-30c293d000 rw-p 30c293c000 00:00 0 
30c4600000-30c4606000 r-xp 00000000 fd:00 109187                         
/usr/lib64/libltdl.so.3.1.4
30c4606000-30c4806000 ---p 00006000 fd:00 109187                         
/usr/lib64/libltdl.so.3.1.4
30c4806000-30c4807000 rw-p 00006000 fd:00 109187                         
/usr/lib64/libltdl.so.3.1.4
2b7406e6f000-2b7406e70000 rw-p 2b7406e6f000 00:00 0 
2b7406e7e000-2b7406e81000 rw-p 2b7406e7e000 00:00 0 
2b7406e81000-2b7406eaa000 r-xp 00000000 fd:00 111573                     
/usr/lib64/libmcrypt.so.4.4.8
2b7406eaa000-2b74070a9000 ---p 00029000 fd:00 111573                     
/usr/lib64/libmcrypt.so.4.4.8
2b74070a9000-2b74070ac000 rw-p 00028000 fd:00 111573                     
/usr/lib64/libmcrypt.so.4.4.8
2b74070ac000-2b74070b6000 rw-p 2b74070ac000 00:00 0 
2b74070b6000-2b74070b8000 r-xp 00000000 fd:00 648848                     
/lib64/libcom_err.so.2.1
2b74070b8000-2b74072b7000 ---p 00002000 fd:00 648848                     
/lib64/libcom_err.so.2.1
2b74072b7000-2b74072b8000 rw-p 00001000 fd:00 648848                     
/lib64/libcom_err.so.2.1
2b74072b8000-2b74072b9000 rw-p 2b74072b8000 00:00 0 
2b74072b9000-2b74072ea000 r-xp 00000000 fd:00 111082                     
/usr/lib64/libidn.so.11.5.19
2b74072ea000-2b74074e9000 ---p 00031000 fd:00 111082                     
/usr/lib64/libidn.so.11.5.19
2b74074e9000-2b74074ea000 rw-p 00030000 fd:00 111082                     
/usr/lib64/libidn.so.11.5.19
2b74074ea000-2b740751e000 r-xp 00000000 fd:00 111375                     
/usr/lib64/libxslt.so.1.1.17
2b740751e000-2b740771d000 ---p 00034000 fd:00 111375                     
/usr/lib64/libxslt.so.1.1.17
2b740771d000-2b740771f000 rw-p 00033000 fd:00 111375                     
/usr/lib64/libxslt.so.1.1.17
2b740771f000-2b7407720000 rw-p 2b740771f000 00:00 0 
2b7407720000-2b740778f000 r-xp 00000000 fd:00 116963                     
/usr/lib64/libgcrypt.so.11.5.2
2b740778f000-2b740798e000 ---p 0006f000 fd:00 116963                     
/usr/lib64/libgcrypt.so.11.5.2
2b740798e000-2b7407992000 rw-p 0006e000 fd:00 116963                     
/usr/lib64/libgcrypt.so.11.5.2
2b7407992000-2b7407995000 r-xp 00000000 fd:00 105928                     
/usr/lib64/libgpg-error.so.0.3.0
2b7407995000-2b7407b94000 ---p 00003000 fd:00 105928                     
/usr/lib64/libgpg-error.so.0.3.0
2b7407b94000-2b7407b95000 rw-p 00002000 fd:00 105928                     
/usr/lib64/libgpg-error.so.0.3.0
2b7407b95000-2b7407b96000 rw-p 2b7407b95000 00:00 0 
2b7407b96000-2b7407bac000 r-xp 00000000 fd:00 648561                     
/lib64/libpthread-2.5.so
2b7407bac000-2b7407dab000 ---p 00016000 fd:00 648561                     
/lib64/libpthread-2.5.so
2b7407dab000-2b7407dac000 r--p 00015000 fd:00 648561                     
/lib64/libpthread-2.5.so
2b7407dac000-2b7407dad000 rw-p 00016000 fd:00 648561                     
/lib64/libpthread-2.5.so
2b7407dad000-2b7407db3000 rw-p 2b7407dad000 00:00 0 
2b7407db3000-2b7407dc8000 r-xp 00000000 fd:00 648847                     
/lib64/libselinux.so.1
2b7407dc8000-2b7407fc8000 ---p 00015000 fd:00 648847                     
/lib64/libselinux.so.1
2b7407fc8000-2b7407fca000 rw-p 00015000 fd:00 648847                     
/lib64/libselinux.so.1
2b7407fca000-2b7408110000 rw-p 2b7407fca000 00:00 0 
2b7408110000-2b740b6e0000 r--p 00000000 fd:00 106135                     
/usr/lib/locale/locale-archive
2b740b6e0000-2b740b72f000 rw-p 2b740b6e0000 00:00 0 
2b740b93d000-2b740b95e000 r-xp 00000000 fd:00 777447                     
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so
2b740b95e000-2b740bb5e000 ---p 00021000 fd:00 777447                     
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so
2b740bb5e000-2b740bb61000 rw-p 00021000 fd:00 777447                     
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so
2b740bb61000-2b740bb6a000 rw-p 2b740bb61000 00:00 0 
7fff52bac000-7fff52bc1000 rw-p 7ffffffe9000 00:00 0                      [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                  [vdso]
Aborted


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-28 09:46 UTC] crizin at gmail dot com
I have same issue on 5.4.0RC8 + APC 3.1.9. And same error messages with shutdown 
Apache.
 [2012-03-18 13:40 UTC] pajoye@php.net
Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2012-03-18 13:40 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-03-18 13:40 UTC] pajoye@php.net
and with 5.4.0 final please :)
 [2012-03-19 10:48 UTC] tim at digicol dot de
The problem also happens with PHP 5.4.0 final if I use the current APC version, 3.1.9.

If I use the latest APC code from trunk instead:

svn checkout https://svn.php.net/repository/pecl/apc/trunk apc-trunk

... the bug seems to be fixed.

It would be great if a new version of APC containing the bugfix could be released soon.

(By the way: I can reproduce the test case above only if I set "apc.enable_cli=1" in php.ini.)

Thanks,
Tim
 [2012-05-15 19:13 UTC] rianob at hotmail dot com
I was using PHP 5.3.10 and APC 3.1.9 and was working fine.
After I upgraded to PHP 5.4.3 which is working great alone, APC stopped working, 
so I decided to give a try to "pecl install apc" and I got the invalid pointer 
message explained above.
I'm using Linux kernel 3.2 (Chakra-Linux) + PHP-FPM 5.4.3.
I have no special or custom parameters.
If I disable pthreads when compiling I got a Fatal Error:
Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0
which makes sense, so I think pthreads questions should be removed because they 
are being used in the APC core.

Regardless the "invalid pointer" error, APC seems to be working and it is being 
listed when phpconfig() is executed.
 [2012-05-15 19:22 UTC] rianob at hotmail dot com
This bug seems to be fixed in APC 3.1.10 beta.
I installed it using: "pecl install apc-beta" and default compile params.
 [2013-02-18 00:35 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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 12:01:26 2024 UTC