Bug #53070 [Opn]: Calling enchant_broker_get_dict_path before set_path crashes php

From: Date: Thu, 14 Oct 2010 22:01:24 +0000
Subject: Bug #53070 [Opn]: Calling enchant_broker_get_dict_path before set_path crashes php
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155186@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53070&edit=1

 ID:                 53070
 User updated by:    iwanluijks at gmail dot com
 Reported by:        iwanluijks at gmail dot com
 Summary:            Calling enchant_broker_get_dict_path before set_path
                     crashes php
 Status:             Open
 Type:               Bug
 Package:            *Spelling functions
 Operating System:   Windows 7 Home Premium
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

I just generated an extended backtrace:

Report for
php__PID__2596__Date__10_14_2010__Time_11_56_44PM__699__Second_Chance_Exception_C0000005.dmp

Report for
php__PID__2596__Date__10_14_2010__Time_11_56_44PM__699__Second_Chance_Exception_C0000005.dmp
Type of Analysis Performed   Crash Analysis 
Machine Name   IWANLUIJKS-PC 
Operating System   Unexpected  
Number Of Processors   4 
Process ID   2596 
Process Image   C:\PHP\php.exe 
System Up-Time   04:46:49 
Process Up-Time   00:00:01 

Thread 0 - System ID 1496
Entry point   php!mainCRTStartup 
Create time   14-10-2010 23:56:43 
Time spent in user mode   0 Days 0:0:0.452 
Time spent in kernel mode   0 Days 0:0:0.140 

Function     Arg 1     Arg 2     Arg 3   Source 
php_enchant!zif_enchant_broker_get_dict_path+b0     00000002    
0249e2a8     00000000    
php5!execute+cdf     024d0080     0249dc80     024d0080    
php5!execute+4c25     00c0ebe8     00c0fe9c     00c0fc84    
php5!execute+1f0     0249dc80     00c0fe9c     00000000    
php5!zend_execute_scripts+be     00000008     00000000     00000003    
php5!php_execute_script+1e2     00c0fe9c     0040642c     00000001    
php!main+a9a     00000003     025f1b10     025f1eb8    
php!memcpy+160     7efde000     00c0ffd4     776f9d72    
kernel32!BaseThreadInitThunk+e     7efde000     76ba527b     00000000   

ntdll!__RtlUserThreadStart+70     00402dda     7efde000     00000000   

ntdll!_RtlUserThreadStart+1b     00402dda     7efde000     00000000    

PHP_ENCHANT!ZIF_ENCHANT_BROKER_GET_DICT_PATH+B0In
php__PID__2596__Date__10_14_2010__Time_11_56_44PM__699__Second_Chance_Exception_C0000005.dmp
the assembly instruction at
php_enchant!zif_enchant_broker_get_dict_path+b0 in
C:\PHP\ext\php_enchant.dll from The PHP Group has caused an access
violation exception (0xC0000005) when trying to read from memory
location 0x00000000 on thread 0

Module Information 
Image Name: C:\PHP\ext\php_enchant.dll   Symbol Type:  PDB 
Base address: 0x02440000   Time Stamp:  Wed Jul 21 21:35:15 2010  
Checksum: 0x00012284   Comments:  Thanks to Pierre-Alain Joye, Ilia
Alshanetsky 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  enchant 
ISAPIFilter: False   File Version:  5.3.3 
Managed DLL: False   Internal Name:  ENCHANT extension 
VB DLL: False   Legal Copyright:  Copyright © 1997-2009 The PHP Group 
Loaded Image Name:  php_enchant.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php_enchant.dll 
Module name:  php_enchant   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  32,00 KBytes   Product Version:  5.3.3 
Symbol File Name:  C:\PHP\ext\php_enchant.pdb   Special Build:  &


Previous Comments:
------------------------------------------------------------------------
[2010-10-14 23:43:56] iwanluijks at gmail dot com

Replaced the file as you requested, restarted Apache and running the
file from CLI and Apache still crashed PHP. I was able to generate the
following backtrace, seems to be different from the others (run 3 others
before it to compare all and this is the only different one, as
expected):

Report for
php__PID__3232__Date__10_14_2010__Time_11_37_32PM__970__Second_Chance_Exception_C0000005.dmp

Report for
php__PID__3232__Date__10_14_2010__Time_11_37_32PM__970__Second_Chance_Exception_C0000005.dmp
Type of Analysis Performed   Crash Analysis 
Machine Name   IWANLUIJKS-PC 
Operating System   Unexpected  
Number Of Processors   4 
Process ID   3232 
Process Image   C:\PHP\php.exe 
System Up-Time   04:27:38 
Process Up-Time   00:00:01 

Thread 0 - System ID 4164
Entry point   php+2dda 
Create time   14-10-2010 23:37:32 
Time spent in user mode   0 Days 0:0:0.546 
Time spent in kernel mode   0 Days 0:0:0.78 

Function     Arg 1     Arg 2     Arg 3   Source 
php_enchant!get_module+6f0     00000001     695f0001     00000000    
0x00c0fb30     695f0001     00000000     6e20736e    

PHP_ENCHANT!GET_MODULE+6F0WARNING - DebugDiag was not able to locate
debug symbols for php_enchant.dll, so the information below may be
incomplete.

In
php__PID__3232__Date__10_14_2010__Time_11_37_32PM__970__Second_Chance_Exception_C0000005.dmp
the assembly instruction at php_enchant!get_module+6f0 in
C:\PHP\ext\php_enchant.dll from The PHP Group has caused an access
violation exception (0xC0000005) when trying to read from memory
location 0x00000000 on thread 0

Module Information 
Image Name: C:\PHP\ext\php_enchant.dll   Symbol Type:  Export 
Base address: 0x00d50000   Time Stamp:  Wed Jul 21 21:35:15 2010  
Checksum: 0x00012284   Comments:  Thanks to Pierre-Alain Joye, Ilia
Alshanetsky 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  enchant 
ISAPIFilter: False   File Version:  5.3.3 
Managed DLL: False   Internal Name:  ENCHANT extension 
VB DLL: False   Legal Copyright:  Copyright © 1997-2009 The PHP Group 
Loaded Image Name:  php_enchant.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php_enchant.dll 
Module name:  php_enchant   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  32,00 KBytes   Product Version:  5.3.3 
Symbol File Name:  php_enchant.dll   Special Build:  &

------------------------------------------------------------------------
[2010-10-14 23:32:40] pajoye@php.net

Can you replace the libenchant.dll with libenchant_52841.zip, restart
apache and try again please?


http://windows.php.net/downloads/qa/test/libenchant_52841.zip

Also please try using the CLI as well.

------------------------------------------------------------------------
[2010-10-14 23:15:30] felipe@php.net

I can't reproduce it on linux.

------------------------------------------------------------------------
[2010-10-14 22:53:13] iwanluijks at gmail dot com

Description:
------------
Whenever I try to call (the undocumented function)
enchant_broker_get_dict_path before enchant_broker_set_dict_path my PHP
instance crashes.

My php.ini contains the following entries:
enchant support	enabled
Version 	1.1.0
Libenchant Version 	1.5.0 or later
Revision 	$Revision: 298870 $

ispell    Ispell Provider 	C:\PHP\libenchant_ispell.dll
myspell   Myspell Provider 	C:\PHP\libenchant_myspell.dll 

Test script:
---------------
<?php
$broker = enchant_broker_init();

enchant_broker_get_dict_path($broker, ENCHANT_ISPELL);
?>

Expected result:
----------------
Either false because no dictionary path is set yet or an empty string or
some kind.

Actual result:
--------------
Report for
php__PID__892__Date__10_14_2010__Time_10_40_17PM__834__Second_Chance_Exception_C0000005.dmp

Report for
php__PID__892__Date__10_14_2010__Time_10_40_17PM__834__Second_Chance_Exception_C0000005.dmp
Type of Analysis Performed   Crash Analysis 
Machine Name   IWANLUIJKS-PC 
Operating System   Unexpected  
Number Of Processors   4 
Process ID   892 
Process Image   C:\PHP\php.exe 
System Up-Time   03:30:23 
Process Up-Time   00:00:31 

Thread 0 - System ID 5160
Entry point   php+2dda 
Create time   14-10-2010 22:39:46 
Time spent in user mode   0 Days 0:0:0.717 
Time spent in kernel mode   0 Days 0:0:0.93 

Function     Arg 1     Arg 2     Arg 3   Source 
php_enchant!get_module+6f0     00000002     027ce2b0     00000000    
php5!execute+cdf     02800080     027cdc80     02800080    
php5!execute+4c25     00c0ebe8     00c0fe9c     00c0fc84    
php5!execute+1f0     00000000     00000000     00000000    

PHP_ENCHANT!GET_MODULE+6F0WARNING - DebugDiag was not able to locate
debug symbols for php_enchant.dll, so the information below may be
incomplete.

In
php__PID__892__Date__10_14_2010__Time_10_40_17PM__834__Second_Chance_Exception_C0000005.dmp
the assembly instruction at php_enchant!get_module+6f0 in
C:\PHP\ext\php_enchant.dll from The PHP Group has caused an access
violation exception (0xC0000005) when trying to read from memory
location 0x00000000 on thread 0

Module Information 
Image Name: C:\PHP\ext\php_enchant.dll   Symbol Type:  Export 
Base address: 0x003d0000   Time Stamp:  Wed Jul 21 21:35:15 2010  
Checksum: 0x00012284   Comments:  Thanks to Pierre-Alain Joye, Ilia
Alshanetsky 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  enchant 
ISAPIFilter: False   File Version:  5.3.3 
Managed DLL: False   Internal Name:  ENCHANT extension 
VB DLL: False   Legal Copyright:  Copyright © 1997-2009 The PHP Group 
Loaded Image Name:  php_enchant.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php_enchant.dll 
Module name:  php_enchant   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  32,00 KBytes   Product Version:  5.3.3 
Symbol File Name:  php_enchant.dll   Special Build:  & 



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



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


Thread (8 messages)

« previous php.bugs (#155186) next »