Bug #49532 [Com]: php5ts.dll access violation exception php5ts!_zend_mm_free_int

From: Date: Fri, 02 Sep 2011 14:12:38 +0000
Subject: Bug #49532 [Com]: php5ts.dll access violation exception php5ts!_zend_mm_free_int
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163256@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=49532&edit=1

 ID:                 49532
 Comment by:         skys dot dragooon dot adsss at gmail dot com
 Reported by:        matroy at investpsp dot ca
 Summary:            php5ts.dll access violation exception 
                     php5ts!_zend_mm_free_int
 Status:             Feedback
 Type:               Bug
 Package:            *General Issues
 Operating System:   win32 only - Windows 2003 SP2
 PHP Version:        5.2.11
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

I solved my problem.
This error occured with php.exe, php-cgi.exe and php-win.exe, and apache's launch..
In my case, it was due to a co-exist of PHP5.2.x and PHP5.3.x version and the bad use by my PHP5.3.x
of the PHP5.2.x INI file. (PHPRC environment variable pointing to PHP5.2.x INI that I missed)


Previous Comments:
------------------------------------------------------------------------
[2011-09-02 13:45:07] skys dot dragooon dot adsss at gmail dot com

Always the same error.. with 5.3.6 and 5.3.8... :/

------------------------------------------------------------------------
[2011-03-16 13:39:59] mdurovic at gmail dot com

It looks like httpd crashes after this error msg in the event viewer.

PHP Fatal error:  Maximum execution time of 30 seconds exceeded in
C:\ftproot\LocalUser\linkmarket\framework\common\php\session.class.php on line 71.

That is public function write($id, $data) from the code below:

<?php

class Session
{	
	
	/**
	 * a database connection resource
	 * @var resource
	 */
	private $_sess_db;
	
	/**
	 * Open the session
	 * @return bool
	 */
	public function open() {
		
		if ($this->_sess_db = mysql_connect('server:port',
					'user',
					'pw')) {
			return mysql_select_db('db', $this->_sess_db);
		}
		return false;
		
	}
	
	/**
	 * Close the session
	 * @return bool
	 */
	public function close() {
		
		if(is_resource($this->_sess_db))
		{
			return mysql_close($this->_sess_db);
		}
		
		return false;
	}
	
	/**
	 * Read the session
	 * @param int session id
	 * @return string string of the sessoin
	 */
	public function read($id) {
		
		$id = mysql_real_escape_string($id);
		$sql = sprintf("SELECT data FROM sessions WHERE id = '%s'", $id);
		if ($result = mysql_query($sql, $this->_sess_db))
		{
			if (mysql_num_rows($result))
			{
				$record = mysql_fetch_assoc($result);
				
				//free mysql result
				mysql_free_result($result);
				
				return $record['data'];
			}
		}
		return '';
		
	}
	
	/**
	 * Write the session
	 * @param int session id
	 * @param string data of the session
	 */
	public function write($id, $data) {
		
		$sql = sprintf("REPLACE INTO sessions (id,data,timestamp,ip,url) VALUES('%s',
'%s', '%s','%s','%s')",
				mysql_real_escape_string($id),
				mysql_real_escape_string($data),
				mysql_real_escape_string(time()),
				mysql_real_escape_string($_SERVER['REMOTE_ADDR']),
				mysql_real_escape_string("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']));
				
		return mysql_query($sql, $this->_sess_db);
		
	}
	
	/**
	 * Destoroy the session
	 * @param int session id
	 * @return bool
	 */
	public function destroy($id) {
		
		$sql = sprintf("DELETE FROM sessions WHERE id = '%s'", $id);
		return mysql_query($sql, $this->_sess_db);
		
	}
	
	/**
	 * Garbage Collector
	 * @param int life time (sec.)
	 * @return bool
	 * @see session.gc_divisor      100
	 * @see session.gc_maxlifetime 1440
	 * @see session.gc_probability    1
	 * @usage execution rate 1/100
	 *        (session.gc_probability/session.gc_divisor)
	 */
	public function gc($max) {
		
		$sql = sprintf("DELETE FROM sessions WHERE timestamp < '%s'",
				mysql_real_escape_string(time() - $max));
		return mysql_query($sql, $this->_sess_db);
		
	}
	
}

//ini_set('session.gc_probability', 50);
ini_set('session.save_handler', 'user');

$session = new Session();
session_set_save_handler(array($session, 'open'),
		array($session, 'close'),
		array($session, 'read'),
		array($session, 'write'),
		array($session, 'destroy'),
		array($session, 'gc'));

?>

------------------------------------------------------------------------
[2011-03-11 00:28:46] pajoye@php.net

Without a script to reproduce your problem we will have no chance to fix it.

------------------------------------------------------------------------
[2011-03-10 21:18:26] mdurovic at gmail dot com

I don't know if this helps but here some more info:

----------------------------------------------------

FAULTING_IP: 
php5ts!_zend_mm_free_int+139 [Zend\zend_alloc.c @ 2019]
006ac699 395f0c          cmp     dword ptr [edi+0Ch],ebx

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 006ac699 (php5ts!_zend_mm_free_int+0x00000139)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 0000000c
Attempt to read from address 0000000c

PROCESS_NAME:  httpd.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at
"0x%08lx". The memory could not be "%s".

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at
"0x%08lx". The memory could not be "%s".

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  0000000c

READ_ADDRESS:  0000000c 

FOLLOWUP_IP: 
php5ts!_zend_mm_free_int+139 [Zend\zend_alloc.c @ 2019]
006ac699 395f0c          cmp     dword ptr [edi+0Ch],ebx

MOD_LIST: <ANALYSIS/>

FAULTING_THREAD:  00001624

BUGCHECK_STR:  APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_READ

PRIMARY_PROBLEM_CLASS:  NULL_CLASS_PTR_DEREFERENCE

DEFAULT_BUCKET_ID:  NULL_CLASS_PTR_DEREFERENCE

LAST_CONTROL_TRANSFER:  from 006ad6c6 to 006ac699

STACK_TEXT:  
05bafa38 006ad6c6 01997ba0 00001008 00773a64 php5ts!_zend_mm_free_int+0x139 [Zend\zend_alloc.c @
2019]
05bafa44 00773a64 05f9b1c8 019967d0 0089f395 php5ts!_efree+0x36 [Zend\zend_alloc.c @ 2351]
05bafa50 0089f395 0085a0a7 00000001 00000013 php5ts!closelog+0x54 [win32\wsyslog.c @ 71]
05bafa54 0085a0a7 00000001 00000013 019967d0 php5ts!zm_deactivate_syslog+0x5 [ext\standard\syslog.c
@ 122]
05bafa80 006a851c 00000001 00000013 019967d0 php5ts!zm_deactivate_basic+0xe7
[ext\standard\basic_functions.c @ 3789]
05bafa90 00726b72 01063558 019967d0 05bafb08 php5ts!module_registry_cleanup+0x1c [Zend\zend_API.c @
2150]
05bafaac 006a2732 00bff680 006a8500 019967d0 php5ts!zend_hash_reverse_apply+0x42 [Zend\zend_hash.c @
758]
05bafad4 006a2718 05baffa8 00000000 56433230 php5ts!zend_deactivate_modules+0x62 [Zend\zend.c @ 866]
05bafaec 0073f49b 01a0da84 019967d0 0075d1fb php5ts!zend_deactivate_modules+0x48 [Zend\zend.c @ 865]
05bafaf8 0075d1fb 01a0da84 00000000 05bafdd4 php5ts!zend_llist_clean+0xb [Zend\zend_llist.c @ 125]
05bafb20 0075971d 05fab840 0000003c 019967d0 php5ts!php_deactivate_ticks+0x1b [main\php_ticks.c @
31]
05bafb30 00756699 05fab840 0000003c 77bcac67 php5ts!php_body_write+0x1d [main\output.c @ 118]
05bafb58 00756869 05bafe78 05bafddc 77bcac67 php5ts!php_body_write_wrapper+0x19 [main\main.c @ 1687]
05bafdd4 10003378 00000000 10002ff6 062a3fb8 php5ts!php_execute_script+0xa9 [main\main.c @ 2201]
05bafddc 10002ff6 062a3fb8 019967d0 00000004 php5apache2_2!php_apache_request_dtor+0x8
[sapi\apache2handler\sapi_apache2.c @ 508]
05bafee4 6ff020e1 062a3fb8 010112d8 062a3fb8 php5apache2_2!php_handler+0x646
[sapi\apache2handler\sapi_apache2.c @ 681]
WARNING: Stack unwind information not available. Following frames may be wrong.
05bafefc 6ff02470 062a3fb8 062a3fb8 062a3fb8 libhttpd!ap_run_handler+0x21
05baff14 6ff0eaee 00000000 062a2fd8 05baff3c libhttpd!ap_invoke_handler+0xb0
05baff24 6ff0a96c 062a3fb8 00000000 005bc0c8 libhttpd!ap_die+0x29e
05baff3c 6ff04d61 062a2fd8 062a2fd8 062a2fd8 libhttpd!ap_get_request_note+0x1d0c
05baff54 6ff05023 062a2fd8 0062f400 05baff84 libhttpd!ap_run_process_connection+0x21
05baff64 6ff1d81c 062a2fd8 01bbcda0 00000000 libhttpd!ap_process_connection+0x33
05baff84 77bcb530 062a2fd0 00000000 00000000 libhttpd!ap_regkey_value_remove+0xc7c
05baffb8 77e6482f 017dfbf0 00000000 00000000 msvcrt!_endthreadex+0xa3
05baffec 00000000 77bcb4bc 017dfbf0 00000000 kernel32!BaseThreadStart+0x34


SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  php5ts!_zend_mm_free_int+139

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: php5ts

IMAGE_NAME:  php5ts.dll

DEBUG_FLR_IMAGE_TIMESTAMP:  4d26013e

STACK_COMMAND:  ~255s; .ecxr ; kb

FAILURE_BUCKET_ID:  NULL_CLASS_PTR_DEREFERENCE_c0000005_php5ts.dll!_zend_mm_free_int

BUCKET_ID: 
APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_READ_php5ts!_zend_mm_free_int+139

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/httpd_exe/2_2_17_0/4cbbe9e8/php5ts_dll/5_3_5_0/4d26013e/c0000005/0000c699.htm?Retriage=1

Followup: MachineOwner

------------------------------------------------------------------------
[2011-03-10 20:52:07] mdurovic at gmail dot com

Maybe this will help:

----------------------

httpd__PID__2316__Date__03_10_2011__Time_02_37_59PM__890__Second_Chance_Exception_C0000005.dmp
Type of Analysis Performed   Crash Analysis 
Machine Name   P2134261 
Operating System   Windows Server 2003 Service Pack 2 
Number Of Processors   4 
Process ID   2316 
Process Image   C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe 
System Up-Time   02:03:45 
Process Up-Time   00:10:58 


Thread 100 - System ID 3012
Entry point   msvcrt!endthreadex+2f 
Create time   3/10/2011 2:27:02 PM 
Time spent in user mode   0 Days 0:0:0.765 
Time spent in kernel mode   0 Days 0:0:0.109 






Function     Arg 1     Arg 2     Arg 3   Source 
php5ts!_zend_mm_free_int+66     117f1028     15bb6a38     00773a64   Zend\zend_alloc.c @ 2018 
php5ts!_efree+36     15bb6a48     117e7710     0089f395   Zend\zend_alloc.c @ 2351 + b 
php5ts!closelog+54     0085a0a7     00000001     00000013   win32\wsyslog.c @ 71 
php5ts!zm_deactivate_syslog+5     00000001     00000013     117e7710   ext\standard\syslog.c @ 122 
php5ts!zm_deactivate_basic+e7     00000001     00000013     117e7710  
ext\standard\basic_functions.c @ 3789 
php5ts!module_registry_cleanup+1c     01063558     117e7710     0352faac   Zend\zend_API.c @ 2150 +
11 
php5ts!zend_hash_reverse_apply+42     00bff680     006a8500     117e7710   Zend\zend_hash.c @ 758 +
7 
php5ts!zend_deactivate_modules+62     0352ffa8     00000000     56433230   Zend\zend.c @ 866 + 10 
php5ts!zend_deactivate_modules+48     0ab7b601     00000000     00000005   Zend\zend.c @ 865 + 38 
php5ts!php_end_ob_buffers+26     15bba878     00000b80     117e7710   main\output.c @ 333 + 9 
php5ts!zend_print_zval_ex+50     00756680     00000000     00000000   Zend\zend.c @ 311 
php5ts!zend_print_zval+16     00000005     15bb1bf0     00000001   Zend\zend.c @ 290 + 16 
php5ts!zend_print_variable+c     0352ffa8     00000000     56433230   Zend\zend_variables.c @ 149 +
c 
php5ts!php_request_shutdown+13d     00000000     10002ff6     0ab7b620   main\main.c @ 1591 + 3a 
php5apache2_2!php_apache_request_dtor+8     0ab7b620     117e7710     00000004  
sapi\apache2handler\sapi_apache2.c @ 508 + 8 
php5apache2_2!php_handler+646     0ab7b620     010112d8     0ab7b620  
sapi\apache2handler\sapi_apache2.c @ 681 + 7 
libhttpd!ap_run_handler+21     0ab7b620     6fe7b881     0ab7b620    
libhttpd!ap_invoke_handler+b0     00000000     6fe7b881     0352fee4    
libhttpd!ap_internal_redirect+37     0ab7b5f8     103c9040     00000001    
mod_rewrite+74fb     103c9040     103c9040     103c9040    
libhttpd!ap_run_handler+21     103c9040     103c9040     103c9040    
libhttpd!ap_invoke_handler+b0     6fe7b870     0aad5b68     0352ff3c    
libhttpd!ap_die+29e     103c9040     00000000     005bc0c8    
libhttpd!ap_get_request_note+1d0c     0aad5b68     0aad5b68     0aad5b68    
libhttpd!ap_run_process_connection+21     0aad5b68     006304b0     0352ff84    
libhttpd!ap_process_connection+33     0aad5b68     0aacab30     00000000    
libhttpd!ap_regkey_value_remove+c7c     0aad5b60     00000000     00000000    
msvcrt!endthreadex+a3     017dfa28     00000000     00000000    
kernel32!GetModuleHandleA+df     77bcb4bc     017dfa28     00000000    




PHP5TS!_ZEND_MM_FREE_INT+66In
httpd__PID__2316__Date__03_10_2011__Time_02_37_59PM__890__Second_Chance_Exception_C0000005.dmp the
assembly instruction at php5ts!_zend_mm_free_int+66 in C:\php\php5ts.dll from The PHP Group has
caused an access violation exception (0xC0000005) when trying to read from memory location
0x2b76d478 on thread 100

Module Information 
Image Name: C:\php\php5ts.dll   Symbol Type:  PDB 
Base address: 0x006a0000   Time Stamp:  Thu Jan 06 12:51:58 2011  
Checksum: 0x00000000   Comments:   
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  PHP Script Interpreter 
ISAPIFilter: False   File Version:  5.3.5 
Managed DLL: False   Internal Name:  PHP Script Interpreter 
VB DLL: False   Legal Copyright:  Copyright © 1997-2010 The PHP Group 
Loaded Image Name:  php5ts.dll   Legal Trademarks:  PHP 
Mapped Image Name:  C:\php\php5ts.dll   Original filename:  php5ts.dll 
Module name:  php5ts   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  5.57 MBytes   Product Version:  5.3.5 
Symbol File Name:  C:\Documents and Settings\mdurovic\My
Documents\Download\php-debug-pack-5.3.5-Win32-VC6-x86\php5ts.pdb   Special Build:  &

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=49532


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=49532&edit=1


Thread (21 messages)

« previous php.bugs (#163256) next »