php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59197 Impossible PHP Fatal errors produced when APC is enabled
Submitted: 2010-05-07 15:44 UTC Modified: 2012-07-22 13:58 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:0 (0.0%)
From: dathan at rockyou dot com Assigned: ab
Status: Closed Package: APC (PECL)
PHP Version: 5.3.2 OS: Centos 5.3
Private report: No CVE-ID:
 [2010-05-07 15:44 UTC] dathan at rockyou dot com
Description:
------------
APC will cause a PHP fatal error on impossible conditions - this case is only reproducible with APC enabled in 5.3.2 and does not happen in 5.2.6

To duplicate set apache to use one process.
# This file is puppetized

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>

StartServers     1
MinSpareServers  1
MaxSpareServers  1
ServerLimit      1
MaxClients       1
MaxRequestsPerChild  1000

</IfModule>


Make requests to the class below

APC will produce INVALID Fatal ERRORS. When APC is turned off the code works as expected.

Reproduce code:
---------------
For example
Call to a member function get_container() on a non-object in RYCrossSiteJSONService.php on line 140


class RYRequest {
...
public function __construct(){

   $this->m_container = $_REQUEST[self::PARAM_CONTAINER];

}

...
public static function get_request()
{   
            return new RYRequest();
} 


        public function get_container()
        {   
            return $this->m_container;
        }   

}

class RYCrossSiteJSONService {

...
public function run_service() {
   $this->m_request = RYRequest::get_request();
   $this->m_request->get_container(); // produces the fatal error above

...
}

Expected result:
----------------
I expect to see no FATAL ERRORS.

I can't get a backtrace from a core file since there is no core file. APC is producing Incorrect results. Below is the call stack though.

Actual result:
--------------
#from poormansprofiler.org
#!/bin/bash
nsamples=100
sleeptime=0
pid=$1

for x in $(seq 1 $nsamples)
  do
    gdb -ex "set pagination 0" -ex "thread apply all bt" -batch -p $pid
    sleep $sleeptime
  done | \
awk '
  BEGIN { s = ""; }
  /Thread/ { print s; s = ""; }
  /^\#/ { if (s != "" ) { s = s "," $4} else { s = $4 } }
  END { print s }' | \
sort | uniq -c | sort -r -n -k 1,1

./gdb_trace.sh 26404
 201 
     22 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_advanced_command,mysql_select_db,php_mysql_select_db,zif_mysql_select_db,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
     20 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_read_query_result,mysql_real_query,php_mysql_do_query_general,zif_mysql_query,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
     12 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_advanced_command,mysql_ping,zif_mysql_ping,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      5 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_read_query_result,mysql_real_query,php_mysql_do_query_general,zif_mysql_query,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_call_user_func_array,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      2 ZEND_ASSIGN_SPEC_CV_VAR_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zval_scan_black,gc_collect_cycles,gc_zobj_possible_root,ZEND_ASSIGN_SPEC_CV_VAR_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zend_send_by_var_helper_SPEC_VAR,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_RETURN_SPEC_TMP_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zend_parse_va_args,zend_parse_parameters,zif_ord,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_free_int,_zval_ptr_dtor,zend_hash_destroy,_zval_dtor_func,_zval_ptr_dtor,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_free_int,zend_hash_clean,apc_free_class_entry_after_execution,apc_request_shutdown,zm_deactivate_apc,module_registry_cleanup,zend_hash_reverse_apply,zend_deactivate_modules,php_request_shutdown,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,zend_send_by_var_helper_SPEC_VAR,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,_zend_hash_index_update_or_next_insert,zif_func_get_args,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,_zend_hash_index_update_or_next_insert,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,zif_unserialize,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,_zend_hash_add_or_update,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,zif_unserialize,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,_zend_hash_add_or_update,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,mmc_postprocess_value,mmc_exec_retrieval_cmd,zif_memcache_get,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_mm_alloc_int,_estrndup,_zval_copy_ctor_func,ZEND_SEND_VAL_SPEC_CONST_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zend_lookup_class_ex,zend_fetch_class,ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_JMPZ_EX_SPEC_VAR_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zend_hash_find,zend_std_get_static_property,zend_fetch_var_address_helper_SPEC_CONST,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _zend_hash_add_or_update,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,process_nested_data,php_var_unserialize,zif_unserialize,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_FETCH_R_SPEC_CONST_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_FE_FETCH_SPEC_VAR_HANDLER,??,??,??,??
      1 ZEND_DO_FCALL_SPEC_CONST_HANDLER,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_CASE_SPEC_CONST_TMP_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_CASE_SPEC_CONST_TMP_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 zend_binary_strcmp,string_compare_function,php_array_data_compare,zend_qsort,php_array_diff,zif_array_diff,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 ZEND_ASSIGN_SPEC_CV_VAR_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 strlen,zif_addslashes,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_read_rows,mysql_store_result,php_mysql_do_query_general,zif_mysql_query,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 __read_nocancel,vio_read_buff,my_real_read,my_net_read,cli_safe_read,cli_advanced_command,mysql_select_db,php_mysql_select_db,zif_mysql_select_db,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_call_user_func_array,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 poll,php_sockop_read,php_openssl_sockop_read,php_stream_fill_read_buffer,_php_stream_get_line,mmc_readline,mmc_read_value,mmc_exec_retrieval_cmd,zif_memcache_get,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 poll,php_sockop_read,php_openssl_sockop_read,php_stream_fill_read_buffer,_php_stream_get_line,mmc_readline,mmc_pool_store,php_mmc_store,zif_memcache_set,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 poll,net_clear,cli_advanced_command,mysql_send_query,mysql_real_query,php_mysql_do_query_general,zif_mysql_query,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 poll,Curl_select,Curl_perform,zif_curl_exec,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 memset,zend_hash_clean,zend_leave_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 memset,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 memcpy@plt,php_var_serialize_intern,php_var_serialize_intern,php_var_serialize_intern,php_var_serialize,php_mmc_store,zif_memcache_set,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_call_user_func_array,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 make_subpats_table,php_pcre_match_impl,zif_preg_match,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _int_malloc,calloc,timelib_get_time_zone_info,timelib_update_ts,zif_strtotime,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 inflate_fast,inflate,uncompress,mmc_read_value,mmc_exec_retrieval_cmd,zif_memcache_get,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
      1 _efree,php_error_cb,soap_error_handler,zend_error_noreturn,ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main
        1 compare_function,ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_call_function,zif_array_map,zend_do_fcall_common_helper_SPEC,execute,zend_execute_scripts,php_execute_script,php_handler,ap_run_handler,ap_invoke_handler,ap_process_request,ap_process_http_connection,ap_run_process_connection,ap_process_connection,child_main,make_child,perform_idle_server_maintenance,ap_mpm_run,main


#0  my_fixup_function (p=0x7f1146e15010, src=0x7f1124b34448, dst=0x7f1146e13a58) at /usr/local/src/APC-3.1.3p1/apc_compile.c:1534
#1  0x00007f113bcd7ecc in my_fixup_hashtable (ht=0x7f1146e13a88, fixup=0x7f113bcd8900 <my_fixup_function>, src=0x7f1124b34448, dst=0
x7f1146e13a58) at /usr/local/src/APC-3.1.3p1/apc_compile.c:1612
#2  0x00007f113bcd8566 in apc_copy_class_entry_for_execution (src=0x7f1124b34448, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1
/apc_compile.c:1411
#3  0x00007f113bcdacfb in install_class (cl={name = 0x7f1124b34438 "genericevents", name_len = 13, parent_name = 0x7f1124b9d3d8 "Gen
ericShard", class_entry = 0x7f1124b34448}, ctxt=0x7fffaf8117f0, lazy=0) at /usr/local/src/APC-3.1.3p1/apc_main.c:167
#4  0x00007f113bcdb825 in my_compile_file (h=0x7fffaf811a30, type=8) at /usr/local/src/APC-3.1.3p1/apc_main.c:349
    at /usr/local/src/APC-3.1.3p1/apc_compile.c:243
#0  0x00007f113bcd8a95 in my_copy_zval (dst=0x7f1146bb9ff0, src=0x7f1123f47380, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1/a
pc_compile.c:243
#1  0x00007f113bcd9041 in my_copy_zval_ptr (dst=0x7f1146bb9fd0, src=0x7f1123f47378, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3
p1/apc_compile.c:182
#2  0x00007f113bcd8409 in my_copy_hashtable_ex (dst=0x7f1146bac6e0, src=<value optimized out>, copy_fn=0x7f113bcd8fc0 <my_copy_zval_
ptr>, holds_ptrs=1, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:784
#3  0x00007f113bcd85ca in apc_copy_class_entry_for_execution (src=0x7f1123f0da18, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1
/apc_compile.c:1431
#4  0x00007f113bcdacfb in install_class (cl={name = 0x7f1123f0da00 "ryopensocialapp2", name_len = 16, parent_name = 0x0, class_entry
 = 0x7f1123f0da18}, ctxt=0x7fffaf8117f0, lazy=0) at /usr/local/src/APC-3.1.3p1/apc_main.c:167
#5  0x00007f113bcdb825 in my_compile_file (h=0x7fffaf811a30, type=8) at /usr/local/src/APC-3.1.3p1/apc_main.c:349
#19 0x00007f113bcd813f in apc_free_class_entry_after_execution (src=0x7f1146d37150) at /usr/local/src/APC-3.1.3p1/apc_compile.c:1471
#20 0x00007f113bcdaa1f in apc_request_shutdown () at /usr/local/src/APC-3.1.3p1/apc_main.c:890
#21 0x00007f113bcd1e45 in zm_deactivate_apc (type=1175905936, module_number=0) at /usr/local/src/APC-3.1.3p1/php_apc.c:320
#14 0x00007f113bcd813f in apc_free_class_entry_after_execution (src=0x7f1146c5baa8) at /usr/local/src/APC-3.1.3p1/apc_compile.c:1471
#15 0x00007f113bcdaa1f in apc_request_shutdown () at /usr/local/src/APC-3.1.3p1/apc_main.c:890
#16 0x00007f113bcd1e45 in zm_deactivate_apc (type=1196636280, module_number=1196636184) at /usr/local/src/APC-3.1.3p1/php_apc.c:320
#1  0x00007f113bcde892 in apc_pmemcpy (p=0x7f11243f4e08, n=87, pool=<value optimized out>) at /usr/local/src/APC-3.1.3p1/apc_pool.c:
470
#2  0x00007f113bcd83ac in my_copy_hashtable_ex (dst=0x7f1146ea1598, src=<value optimized out>, copy_fn=0x7f113bcd9500 <apc_copy_func
tion_for_execution_ex>, holds_ptrs=0, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:767
#3  0x00007f113bcd8549 in apc_copy_class_entry_for_execution (src=0x7f11243bd700, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1
/apc_compile.c:1405
#4  0x00007f113bcdacfb in install_class (cl={name = 0x7f11243bd6e8 "facebookrestclient_base", name_len = 23, parent_name = 0x0, clas
s_entry = 0x7f11243bd700}, ctxt=0x7fffaf8117f0, lazy=0) at /usr/local/src/APC-3.1.3p1/apc_main.c:167
#5  0x00007f113bcdb825 in my_compile_file (h=0x7fffaf811a30, type=2) at /usr/local/src/APC-3.1.3p1/apc_main.c:349
#1  0x00007f113bcde892 in apc_pmemcpy (p=0x7f1125105b88, n=71, pool=<value optimized out>) at /usr/local/src/APC-3.1.3p1/apc_pool.c:
470
#2  0x00007f113bcd83ac in my_copy_hashtable_ex (dst=0x7f1146c79ff8, src=<value optimized out>, copy_fn=0x7f113bcd8fc0 <my_copy_zval_
ptr>, holds_ptrs=1, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:767
#3  0x00007f113bcd8c8a in my_copy_zval (dst=0x7f1146c79fc8, src=0x7f1125050fe0, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1/a
pc_compile.c:297
#4  0x00007f113bcd9041 in my_copy_zval_ptr (dst=0x7f1146c79fa8, src=0x7f1125050fd8, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3
p1/apc_compile.c:182
#5  0x00007f113bcd8409 in my_copy_hashtable_ex (dst=0x7f1146c782f8, src=<value optimized out>, copy_fn=0x7f113bcd8fc0 <my_copy_zval_
ptr>, holds_ptrs=1, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:784
#6  0x00007f113bcd85e9 in apc_copy_class_entry_for_execution (src=0x7f112504e960, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1
/apc_compile.c:1437
#7  0x00007f113bcdacfb in install_class (cl={name = 0x7f112504e950 "zooitemlist", name_len = 11, parent_name = 0x0, class_entry = 0x
7f112504e960}, ctxt=0x7fffaf8117f0, lazy=0) at /usr/local/src/APC-3.1.3p1/apc_main.c:167
#8  0x00007f113bcdb825 in my_compile_file (h=0x7fffaf811a30, type=8) at /usr/local/src/APC-3.1.3p1/apc_main.c:349
#6  0x00007f113bcd8170 in apc_free_class_entry_after_execution (src=0x7f11478ec1c8) at /usr/local/src/APC-3.1.3p1/apc_compile.c:1482
#7  0x00007f113bcdaa1f in apc_request_shutdown () at /usr/local/src/APC-3.1.3p1/apc_main.c:890
#8  0x00007f113bcd1e45 in zm_deactivate_apc (type=1175905936, module_number=1200515360) at /usr/local/src/APC-3.1.3p1/php_apc.c:320
#1  0x00007f113bcd84ac in my_copy_hashtable_ex (dst=0x0, src=0x7f1125208318, copy_fn=0x7f113bcd8fc0 <my_copy_zval_ptr>, holds_ptrs=1
, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:736
#2  0x00007f113bcd8c8a in my_copy_zval (dst=0x7f1146b7f608, src=0x7f1125207238, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1/a
pc_compile.c:297
#3  0x00007f113bcd9041 in my_copy_zval_ptr (dst=0x7f1146b7f5e8, src=0x7f11252082c0, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3
p1/apc_compile.c:182
#4  0x00007f113bcd8409 in my_copy_hashtable_ex (dst=0x7f1146b7f4e0, src=<value optimized out>, copy_fn=0x7f113bcd8fc0 <my_copy_zval_
ptr>, holds_ptrs=1, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:784
#5  0x00007f113bcd8c8a in my_copy_zval (dst=0x7f1146b7f4b0, src=0x7f11252081d0, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1/a
pc_compile.c:297
#6  0x00007f113bcd9041 in my_copy_zval_ptr (dst=0x7f1146b7f490, src=0x7f11252081c8, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3
p1/apc_compile.c:182
#7  0x00007f113bcd8409 in my_copy_hashtable_ex (dst=0x7f1146b1eb60, src=<value optimized out>, copy_fn=0x7f113bcd8fc0 <my_copy_zval_
ptr>, holds_ptrs=1, ctxt=0x7fffaf8117f0, check_fn=0) at /usr/local/src/APC-3.1.3p1/apc_compile.c:784
#8  0x00007f113bcd8c8a in my_copy_zval (dst=0x7f1146b1eb30, src=0x7f11251c27b8, ctxt=0x7fffaf8117f0) at /usr/local/src/APC-3.1.3p1/a
pc_compile.c:297

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-11 09:49 UTC] gopalv82 at yahoo dot com
I've been racking my head about how/why this would happen.

I'd love you to do a "gc" in gdb, which dumps a core for the memory. Break on zend_error and dump a core, so that I can ask you to debug more things.

I cannot think of anything off the top of my head. But once you have a core, I think we can really explore why this error happens.

I suspect I'm missing some magic OOP setting I need to do with 5.3.x. I've been off apc for quite a while, doing other things ... so I might have missed a change that sneaked in while I was away.
 [2010-05-12 19:44 UTC] chris at chrisstreeter dot com
Here are the backtraces when I collected the coredumps. How 
should I get them to you? They're 400+M files...

Breakpoint 1, zend_error (type=1, format=0x7fe1b9027730 
"Call to a member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
975     in /usr/local/src/php532/Zend/zend.c
(gdb) bt
#0  zend_error (type=1, format=0x7fe1b9027730 "Call to a 
member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
#1  0x00007fe1b8b69b5d in 
ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER 
(execute_data=0x7fe1bff2d1a8) at 
/usr/local/src/php532/Zend/zend_vm_execute.h:10368
#2  0x00007fe1b8b32b84 in execute (op_array=0x7fe1c0f262b8) 
at /usr/local/src/php532/Zend/zend_vm_execute.h:104
#3  0x00007fe1b8b004e4 in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) at 
/usr/local/src/php532/Zend/zend.c:1194
#4  0x00007fe1b8a80eea in php_execute_script 
(primary_file=0x7fff878f60d0) at 
/usr/local/src/php532/main/main.c:2260
#5  0x00007fe1b8bf1c02 in php_handler (r=0x7fe1c107b468) at 
/usr/local/src/php532/sapi/apache2handler/sapi_apache2.c:655
#6  0x00007fe1bf80d7c1 in ap_run_handler () from 
/usr/sbin/httpd
#7  0x00007fe1bf80e084 in ap_invoke_handler () from 
/usr/sbin/httpd
#8  0x00007fe1bf81fb7a in ap_process_request () from 
/usr/sbin/httpd
#9  0x00007fe1bf81c431 in ap_process_http_connection () from 
/usr/sbin/httpd
#10 0x00007fe1bf81722c in ap_run_process_connection () from 
/usr/sbin/httpd
#11 0x00007fe1bf817679 in ap_process_connection () from 
/usr/sbin/httpd
#12 0x00007fe1bf82697f in child_main () from /usr/sbin/httpd
#13 0x00007fe1bf826a6b in make_child () from /usr/sbin/httpd
#14 0x00007fe1bf827055 in ap_mpm_run () from /usr/sbin/httpd
#15 0x00007fe1bf7f37ef in main () from /usr/sbin/httpd
(gdb) gc
Saved corefile core.1

Breakpoint 1, zend_error (type=1, format=0x7fe1b9027730 
"Call to a member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
975     in /usr/local/src/php532/Zend/zend.c
(gdb) bt
#0  zend_error (type=1, format=0x7fe1b9027730 "Call to a 
member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
#1  0x00007fe1b8b69b5d in 
ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER 
(execute_data=0x7fe1c1003ea8) at 
/usr/local/src/php532/Zend/zend_vm_execute.h:10368
#2  0x00007fe1b8b32b84 in execute (op_array=0x7fe1c0f262b8) 
at /usr/local/src/php532/Zend/zend_vm_execute.h:104
#3  0x00007fe1b8b004e4 in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) at 
/usr/local/src/php532/Zend/zend.c:1194
#4  0x00007fe1b8a80eea in php_execute_script 
(primary_file=0x7fff878f60d0) at 
/usr/local/src/php532/main/main.c:2260
#5  0x00007fe1b8bf1c02 in php_handler (r=0x7fe1bfd37d38) at 
/usr/local/src/php532/sapi/apache2handler/sapi_apache2.c:655
#6  0x00007fe1bf80d7c1 in ap_run_handler () from 
/usr/sbin/httpd
#7  0x00007fe1bf80e084 in ap_invoke_handler () from 
/usr/sbin/httpd
#8  0x00007fe1bf81fb7a in ap_process_request () from 
/usr/sbin/httpd
#9  0x00007fe1bf81c431 in ap_process_http_connection () from 
/usr/sbin/httpd
#10 0x00007fe1bf81722c in ap_run_process_connection () from 
/usr/sbin/httpd
#11 0x00007fe1bf817679 in ap_process_connection () from 
/usr/sbin/httpd
#12 0x00007fe1bf82697f in child_main () from /usr/sbin/httpd
#13 0x00007fe1bf826a6b in make_child () from /usr/sbin/httpd
#14 0x00007fe1bf827055 in ap_mpm_run () from /usr/sbin/httpd
#15 0x00007fe1bf7f37ef in main () from /usr/sbin/httpd
(gdb) gc core.2
Saved corefile core.2


Breakpoint 1, zend_error (type=1, format=0x7fe1b9027730 
"Call to a member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
975     in /usr/local/src/php532/Zend/zend.c
(gdb) bt
#0  zend_error (type=1, format=0x7fe1b9027730 "Call to a 
member function %s() on a non-object") at 
/usr/local/src/php532/Zend/zend.c:975
#1  0x00007fe1b8b69b5d in 
ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER 
(execute_data=0x7fe1c1003ea8) at 
/usr/local/src/php532/Zend/zend_vm_execute.h:10368
#2  0x00007fe1b8b32b84 in execute (op_array=0x7fe1c0f262b8) 
at /usr/local/src/php532/Zend/zend_vm_execute.h:104
#3  0x00007fe1b8b004e4 in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) at 
/usr/local/src/php532/Zend/zend.c:1194
#4  0x00007fe1b8a80eea in php_execute_script 
(primary_file=0x7fff878f60d0) at 
/usr/local/src/php532/main/main.c:2260
#5  0x00007fe1b8bf1c02 in php_handler (r=0x7fe1c0338068) at 
/usr/local/src/php532/sapi/apache2handler/sapi_apache2.c:655
#6  0x00007fe1bf80d7c1 in ap_run_handler () from 
/usr/sbin/httpd
#7  0x00007fe1bf80e084 in ap_invoke_handler () from 
/usr/sbin/httpd
#8  0x00007fe1bf81fb7a in ap_process_request () from 
/usr/sbin/httpd
#9  0x00007fe1bf81c431 in ap_process_http_connection () from 
/usr/sbin/httpd
#10 0x00007fe1bf81722c in ap_run_process_connection () from 
/usr/sbin/httpd
#11 0x00007fe1bf817679 in ap_process_connection () from 
/usr/sbin/httpd
#12 0x00007fe1bf82697f in child_main () from /usr/sbin/httpd
#13 0x00007fe1bf826a6b in make_child () from /usr/sbin/httpd
#14 0x00007fe1bf827055 in ap_mpm_run () from /usr/sbin/httpd
#15 0x00007fe1bf7f37ef in main () from /usr/sbin/httpd
(gdb) gc core.3
Saved corefile core.3
 [2010-05-17 20:08 UTC] chris at chrisstreeter dot com
Er... I meant that they are large files, where each one is 400 
MB+.
 [2010-05-28 09:03 UTC] gopalv82 at yahoo dot com
I'm baffled, I cannot think of a good reason this would be a problem for APC.

is there a var $m_request = NULL; in the class definition of the second class?
 [2010-05-28 17:31 UTC] chris at chrisstreeter dot com
So the RYCrossSiteJSONService has a member variables like 
the following:

protected $m_text_return_data = false;
protected $m_request;
protected $m_version = "";
protected $mUseDirectJsonFormat = true;
protected $mResult = null;

(with a couple more like $m_request that aren't set to 
anything).

Also, there are two lines that Dathan left out that could 
potentially have an impact (though I don't see how). The 
code 
inside run_service() is this:

$this->m_request = RYRequest::get_request();
global $global_context;
$global_context = $this->get_request(); // get_request just 
returns $this->m_request
$container = $this->m_request->get_container(); // <-- This 
is the line that produces the fatal error.

The RYRequest class has several class constants and a few 
protected members, most of which are unset, and one that is 
set 
to a constant in the class.
 [2011-11-01 16:49 UTC] james at parchment dot com
I occasionally suffer from this same issue with APC 3.1.3p1 using PHP 5.3.8 on 
RHEL 6.2. Apache version is 2.2.15.

I don't have a simpler test, and unfortunately I cannot always reproduce it. To 
fix, I have to restart Apache. (More drastic approaches, such as deleting the 
entire web directory containing the PHP files and replacing them with a fresh 
copy without a restart, don't fix the issue.)

Apache, PHP, and APC support are all from RPMs, so there is nothing special 
about my setup from that perspective. The disk hosting the files is local to the 
VM.
 [2011-11-01 16:51 UTC] james at parchment dot com
I should have mentioned that I get errors in files that aren't even part of the 
workflow. For example, if I have a file that includes header.php, this bug will 
cause me to get errors in header.php. If I exit the other script before any file 
that includes header.php gets called, I might *still* get errors in header.php.
 [2011-12-29 00:55 UTC] xrstf-misc at yahoo dot com
I'm seeing a similar issue using APC 3.1.9 with PHP 5.4.0RC4 on Windows (Win7 
x64, Apache 2.2.17). I've built APC myself using VS2008 (shared, TS, x86, 
Release).

After enabling APC, my app crashes randomly with bogus error messages. Sometimes 
methods in subclasses are not detected:



/lib/Base.php
-------------

class Base {
   abstract protected function foo();
}



/lib/Sub.php
------------

class Sub extends Base {
   protected function foo() { print "world!"; }
}



After including both files, I get "Sub contains abstract methods and must 
therefore also be abstract (Base::foo())". When I restart Apache, the error goes 
away for one request. After that, I get "Call to undefined method 
Loader::addPath" (this method definitely exists, disabling APC makes it work 
again).

My APC config:

-----------------------
apc.enabled = On
apc.cache_by_default = On
apc.slam_defense = 0
apc.write_lock = 1
-----------------------
 [2012-07-21 21:16 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2012-07-21 21:16 UTC] ab@php.net
2012 is too far back, but regarding the newer comments fixed with APC 3.1.11 and 
PHP 5.4 anyway, see also bug #61219 and bug #61515.
 [2012-07-22 13:58 UTC] ab@php.net
err ... 2010 is too far back :)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC