php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62302 using sprintf causes APC to crash
Submitted: 2012-06-12 19:10 UTC Modified: 2012-07-19 21:45 UTC
From: dkozlowski at sevone dot com Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.4RC2 OS: Linux
Private report: No CVE-ID: None
 [2012-06-12 19:10 UTC] dkozlowski at sevone dot com
Description:
------------
Enabling APC in Apache and loading the following script causes Apache to SIGSEGV 

php5.4.4rc1 
Apache 2.4 
Linux 2.6.30 



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

	echo 1 == 1 ? sprintf("%s\n","This is me") : sprintf("%s\n","This is not me")  ;

?>

Expected result:
----------------
This is me 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-12 19:30 UTC] dkozlowski at sevone dot com
backtrace

#0  0x0000000008000000 in ?? ()
#1  0x00007f30223e4492 in execute () from /usr/lib64/apache2/modules/libphp5.so
#2  0x00007f30223a20c3 in zend_execute_scripts () from /usr/lib64/apache2/modules/libphp5.so
#3  0x00007f30223035e2 in php_execute_script () from /usr/lib64/apache2/modules/libphp5.so
#4  0x00007f302250e616 in ?? () from /usr/lib64/apache2/modules/libphp5.so
#5  0x0000000000459774 in ap_run_handler (r=0x195cfc0) at config.c:169
#6  0x000000000045a0bd in ap_invoke_handler (r=0x195cfc0) at config.c:432
#7  0x0000000000478c67 in ap_process_async_request (r=0x195cfc0) at http_request.c:317
#8  0x0000000000478d84 in ap_process_request (r=0x195cfc0) at http_request.c:363
#9  0x0000000000474a2f in ap_process_http_sync_connection (c=0x1957180) at http_core.c:190
#10 0x0000000000474b37 in ap_process_http_connection (c=0x1957180) at http_core.c:231
#11 0x00000000004683ad in ap_run_process_connection (c=0x1957180) at connection.c:41
#12 0x00000000004688b3 in ap_process_connection (c=0x1957180, csd=0x1956f90) at connection.c:202
#13 0x0000000000485d3b in child_main (child_num_arg=4) at prefork.c:697
#14 0x0000000000485f49 in make_child (s=0x14774c0, slot=4) at prefork.c:793
#15 0x0000000000485fad in startup_children (number_to_start=1) at prefork.c:811
#16 0x00000000004865a9 in prefork_run (_pconf=0x144e138, plog=0x14b1528, s=0x14774c0) at prefork.c:969
#17 0x00000000004336fb in ap_run_mpm (pconf=0x144e138, plog=0x14b1528, s=0x14774c0) at mpm_common.c:98
#18 0x000000000042b9aa in main (argc=23, argv=0x7fff6daf5d58) at main.c:777
 [2012-06-12 22:10 UTC] sixd@php.net
Perhaps try APC trunk?  http://svn.php.net/viewvc/pecl/apc/trunk/?view=log has a recent fix for interned strings.
 [2012-06-13 05:35 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2012-06-13 05:35 UTC] rasmus@php.net
Yes, I am not able to reproduce this with the current svn-trunk code.
 [2012-06-13 13:19 UTC] dkozlowski at sevone dot com
-Status: Feedback +Status: Open
 [2012-06-13 13:19 UTC] dkozlowski at sevone dot com
I am building the extensions from SVN to test now.
 [2012-06-14 17:19 UTC] dkozlowski at sevone dot com
After building from SVN and testing it a bit more I have found it also to involve the configuration directive 

apc.include_once_override=1 

If I enable this it crashes if I leave it off it works.
 [2012-06-22 10:06 UTC] dkozlowski at sevone dot com
-Summary: using sprintf causes APC to +Summary: using sprintf causes APC to crash
 [2012-06-22 10:06 UTC] dkozlowski at sevone dot com
Should probably add the results of this defect into the title.
 [2012-07-08 04:43 UTC] chx@php.net
I can confirm this bug with apc.include_once_override=1 and not without. PHP 
5.4.4, trunk r326089, Apache 2.2.22 apache2handler.
 [2012-07-19 21:45 UTC] rasmus@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rasmus
 [2012-07-20 21:17 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=326749
Log: added test for bug #62302
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 23:01:30 2024 UTC