php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56885 APC crash on caching code containing $x->y = "z"
Submitted: 2006-03-09 05:18 UTC Modified: 2006-03-09 18:29 UTC
From: me at contents dot nl Assigned:
Status: Closed Package: apc (PECL)
PHP Version: 5.1.2 OS: Win 32
Private report: No CVE-ID: None
 [2006-03-09 05:18 UTC] me at contents dot nl
Description:
------------
APC crashes APC when the code includes a line $x->y = "z", but only if this codeline is withing a class method. No crash occurs when its in a function. It also doesn't crash when assigning through another variable:
$q = "z";
$x->y = $q;


On the first request the code executes just fine, on any subsequent request it crashes apache (1.3.33). APC 3.0.9-dev from pecl4win, php 5.1.2

Reproduce code:
---------------
<?php
class A {
  public $y;
}
class B {
  function doit() {
    $x = new A();
    $x->y = "z";
  }
}
echo "hello world";
?>

Expected result:
----------------
hello world

Actual result:
--------------
crash

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-09 05:25 UTC] me at contents dot nl
updated php version
 [2006-03-09 11:32 UTC] gopalv82 at yahoo dot com
Any backtraces ?.

Because this seems to work for me on php 5.1.2 on Freebsd 4. Of course, I'm using the latest CVS of APC.
 [2006-03-09 13:12 UTC] me at contents dot nl
I don't think its very usefull, since I don't have a symbols file for php_apc:

	php5ts.dll!zend_is_auto_global(char * name=0x013b2f84, unsigned int name_len=1, void * * * tsrm_ls=0x00b87d30)  Line 3955 + 0x1d bytes	C
 	php_apc.dll!00b8486e() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for php_apc.dll]	
 	php_apc.dll!00b8491b() 	
 	php_apc.dll!00b8494b() 	
 	php_apc.dll!00b82e4c() 	
 	php_apc.dll!00b849e7() 	
 	php_apc.dll!00b85e98() 	
 	php_apc.dll!00b85df3() 	
 	php_apc.dll!00b85a00() 	
 	php5ts.dll!zend_execute_scripts(int type=8, void * * * tsrm_ls=0x00f6a148, _zval_struct * * retval=0x00000000, int file_count=3, ...)  Line 1101 + 0xa bytes	C
 	php5ts.dll!php_execute_script(_zend_file_handle * primary_file=0x0126fdcc, void * * * tsrm_ls=0x00f6a148)  Line 1719 + 0x12 bytes	C
 	php5apache.dll!apache_php_module_main(request_rec * r=0x00ffc3b0, int display_source_mode=0, void * * * tsrm_ls=0x00f6a148)  Line 53 + 0x1b bytes	C
 	php5apache.dll!send_php(request_rec * r=0x00ffc3b0, int display_source_mode=0, char * filename=0x00ffcf40)  Line 662 + 0xb bytes	C
 	php5apache.dll!send_parsed_php(request_rec * r=0x00ffc3b0)  Line 676 + 0xe bytes	C
 	ApacheCore.dll!6ff64bc7() 	
 	ApacheCore.dll!6ff74a73() 	
 	ApacheCore.dll!6ff74746() 	
 	ApacheCore.dll!6ff6be0f() 	
 	ws2_32.dll!71a33a91() 	
 	ApacheCore.dll!6ff6bc5a() 	
 	msvcrt.dll!77c0a3b0() 	
 	ws2_32.dll!71a33a91() 	
 	ws2_32.dll!71a387a9() 	
 	kernel32.dll!7c80b50b() 	
 	ws2_32.dll!71a33a91() 	
 	ws2_32.dll!71a387a9() 	
 	kernel32.dll!7c8399f3()
 [2006-03-09 14:19 UTC] me at contents dot nl
a new backtrace with php_apc symbols:

	php5ts.dll!zend_is_auto_global(char * name=0x013b2f84, unsigned int name_len=1, void * * * tsrm_ls=0x00d5b3f6)  Line 3955 + 0x21 bytes	C
 	php_apc.dll!my_fetch_global_vars(_zend_op_array * src=0x066bbe88, void * * * tsrm_ls=0x00d5b3f6)  Line 1802 + 0x1a bytes	C
 	php_apc.dll!apc_copy_function_for_execution(_zend_function * src=0x013b2b0c, void * * * tsrm_ls=0x00d5b3f6)  Line 1830 + 0xd bytes	C
 	php_apc.dll!apc_copy_function_for_execution_ex(void * dummy=0x00000000, _zend_function * src=0x013b2b0c, void * * * tsrm_ls=0x00d5b3f6)  Line 1841 + 0xd bytes	C
 	php_apc.dll!my_copy_hashtable_ex(_hashtable * dst=0x066bbc5c, _hashtable * src=0x013b2950, void * (void *, void *, void * (unsigned int)*, void (void *)*)* copy_fn=0x00d5a294, void (void *, void (void *)*)* free_fn=0x00000000, int holds_ptrs=0, void * (unsigned int)* allocate=0x00d5b3f6, void (void *)* deallocate=0x00d5ae88, int (bucket *, char *)* check_fn=0x00000000, ...)  Line 931 + 0x16 bytes	C
 	php_apc.dll!apc_copy_class_entry_for_execution(_zend_class_entry * src=0x013b2934, int is_derived=0)  Line 1875 + 0x28 bytes	C
 	php_apc.dll!install_class(apc_class_t cl={...}, void * * * tsrm_ls=0x0114f370)  Line 109 + 0xd bytes	C
 	php_apc.dll!cached_compile(void * * * tsrm_ls=0x0114f370)  Line 190 + 0x38 bytes	C
 	php_apc.dll!my_compile_file(_zend_file_handle * h=0x034afdcc, int type=2, void * * * tsrm_ls=0x0114f370)  Line 253 + 0x9 bytes	C
 	php5ts.dll!zend_execute_scripts(int type=8, void * * * tsrm_ls=0x0114f370, _zval_struct * * retval=0x00000000, int file_count=3, ...)  Line 1101 + 0xa bytes	C
 	php5ts.dll!php_execute_script(_zend_file_handle * primary_file=0x034afdcc, void * * * tsrm_ls=0x0114f370)  Line 1719 + 0x12 bytes	C
 	php5apache.dll!apache_php_module_main(request_rec * r=0x01151620, int display_source_mode=0, void * * * tsrm_ls=0x0114f370)  Line 53 + 0x1b bytes	C
 	php5apache.dll!send_php(request_rec * r=0x01151620, int display_source_mode=0, char * filename=0x01152190)  Line 662 + 0xb bytes	C
 	php5apache.dll!send_parsed_php(request_rec * r=0x01151620)  Line 676 + 0xe bytes	C
 	ApacheCore.dll!6ff64bc7() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for ApacheCore.dll]
 [2006-03-09 16:46 UTC] edink at emini dot dk
Having auto_globals_jit = off in php.ini and commenting out calls to my_fetch_global_vars() in apc_compile.c makes this problem disappear on Windows.
 [2006-03-09 18:29 UTC] edink at emini dot dk
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 21:01:26 2019 UTC