php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61364 invalid read in tests/apc_bin_001.phpt
Submitted: 2012-03-12 21:38 UTC Modified: 2012-08-15 14:03 UTC
From: ab@php.net Assigned: ab (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.0 OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 + 46 = ?
Subscribe to this entry?

 
 [2012-03-12 21:38 UTC] ab@php.net
Description:
------------
the test is currently marked as leaked and the valgrind says:

==3424== Invalid write of size 4
==3424==    at 0x46A11ED: sma_allocate (apc_sma.c:258)
==3424==    by 0x46A17C4: apc_sma_malloc_ex (apc_sma.c:453)
==3424==    by 0x46A1C52: apc_sma_malloc (apc_sma.c:517)
==3424==    by 0x46A4A7D: apc_realpool_create (apc_pool.c:435)
==3424==    by 0x46A453F: apc_pool_create (apc_pool.c:57)
==3424==    by 0x4692B0E: _apc_store (php_apc.c:589)
==3424==    by 0x46AA208: apc_bin_load (apc_bin.c:958)
==3424==    by 0x46958E7: zif_apc_bin_load (php_apc.c:1482)
==3424==    by 0x82F668F: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:642)
==3424==    by 0x82FCF33: ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(zend_vm_execute.h:2219)
==3424==    by 0x82F5127: execute (zend_vm_execute.h:410)
==3424==    by 0x82BB8EE: zend_execute_scripts (zend.c:1272)
==3424==  Address 0x4abc400 is 8 bytes after a block of size 584 alloc'd
==3424==    at 0x46A193E: apc_sma_malloc_ex (apc_sma.c:467)
==3424==    by 0x46A1C52: apc_sma_malloc (apc_sma.c:517)
==3424==    by 0x46A4A7D: apc_realpool_create (apc_pool.c:435)
==3424==    by 0x46A453F: apc_pool_create (apc_pool.c:57)
==3424==    by 0x46A9BD4: apc_bin_load (apc_bin.c:852)
==3424==    by 0x46958E7: zif_apc_bin_load (php_apc.c:1482)
==3424==    by 0x82F668F: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:642)
==3424==    by 0x82FCF33: ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(zend_vm_execute.h:2219)
==3424==    by 0x82F5127: execute (zend_vm_execute.h:410)
==3424==    by 0x82BB8EE: zend_execute_scripts (zend.c:1272)
==3424==    by 0x82315BA: php_execute_script (main.c:2473)
==3424==    by 0x83DFEBD: do_cli (php_cli.c:983)
==3424== Invalid read of size 4
==3424==    at 0x46A11FD: sma_allocate (apc_sma.c:261)
==3424==    by 0x46A17C4: apc_sma_malloc_ex (apc_sma.c:453)
==3424==    by 0x46A1C52: apc_sma_malloc (apc_sma.c:517)
==3424==    by 0x46A4A7D: apc_realpool_create (apc_pool.c:435)
==3424==    by 0x46A453F: apc_pool_create (apc_pool.c:57)
==3424==    by 0x4692B0E: _apc_store (php_apc.c:589)
==3424==    by 0x46AA208: apc_bin_load (apc_bin.c:958)
==3424==    by 0x46958E7: zif_apc_bin_load (php_apc.c:1482)
==3424==    by 0x82F668F: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:642)
==3424==    by 0x82FCF33: ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(zend_vm_execute.h:2219)
==3424==    by 0x82F5127: execute (zend_vm_execute.h:410)
==3424==    by 0x82BB8EE: zend_execute_scripts (zend.c:1272)
==3424==  Address 0x4abc3f8 is 0 bytes after a block of size 584 alloc'd
==3424==    at 0x46A193E: apc_sma_malloc_ex (apc_sma.c:467)
==3424==    by 0x46A1C52: apc_sma_malloc (apc_sma.c:517)
==3424==    by 0x46A4A7D: apc_realpool_create (apc_pool.c:435)
==3424==    by 0x46A453F: apc_pool_create (apc_pool.c:57)
==3424==    by 0x46A9BD4: apc_bin_load (apc_bin.c:852)
==3424==    by 0x46958E7: zif_apc_bin_load (php_apc.c:1482)
==3424==    by 0x82F668F: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:642)
==3424==    by 0x82FCF33: ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(zend_vm_execute.h:2219)
==3424==    by 0x82F5127: execute (zend_vm_execute.h:410)
==3424==    by 0x82BB8EE: zend_execute_scripts (zend.c:1272)
==3424==    by 0x82315BA: php_execute_script (main.c:2473)
==3424==    by 0x83DFEBD: do_cli (php_cli.c:983)

==3424== 
==3424== Invalid write of size 4
==3424==    at 0x46A120A: sma_allocate (apc_sma.c:266)
==3424==    by 0x46A17C4: apc_sma_malloc_ex (apc_sma.c:453)
==3424==    by 0x46A1C52: apc_sma_malloc (apc_sma.c:517)
==3424==    by 0x46A4A7D: apc_realpool_create (apc_pool.c:435)
==3424==    by 0x46A453F: apc_pool_create (apc_pool.c:57)
==3424==    by 0x4692B0E: _apc_store (php_apc.c:589)
==3424==    by 0x46AA208: apc_bin_load (apc_bin.c:958)
==3424==    by 0x46958E7: zif_apc_bin_load (php_apc.c:1482)
==3424==    by 0x82F668F: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:642)
==3424==    by 0x82FCF33: ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(zend_vm_execute.h:2219)
==3424==    by 0x82F5127: execute (zend_vm_execute.h:410)
==3424==    by 0x82BB8EE: zend_execute_scripts (zend.c:1272)
==3424==  Address 0x4abc408 is not stack'd, malloc'd or (recently) free'd
==3424==

NOTE this test was marked as leaked since PHP 5.3 and APC 3.1.9


Test script:
---------------
<?php

apc_compile_file('file.php');
$it = new APCIterator('file');
apc_delete_file($it);

Expected result:
----------------
clean testrun

Actual result:
--------------
test is reported as leaked

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-15 14:03 UTC] ab@php.net
No more to reproduce. Other leaks present, but that's another topic.
 [2012-08-15 14:03 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 11:01:30 2024 UTC