php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39472 CLI has encountered a problem : ModName:php5ts.dll
Submitted: 2006-11-11 16:50 UTC Modified: 2006-11-17 08:22 UTC
From: jitudavda at hotmail dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 5.2.0 OS: WinXP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jitudavda at hotmail dot com
New email:
PHP Version: OS:

 

 [2006-11-11 16:50 UTC] jitudavda at hotmail dot com
Description:
------------
Steps Done by me: [more than one time :-( ] 

Step 1] Install PHP with windows installer.
Step 2] Run index.php with only code <?php phpinfo();
        Behaviour: No output in browser, it's loading... for long time.
Step 3] open cmd and run "php -i"
        Behaviour: After long output of .ini config, at last it gives the windows dialog with information "'CLI has encountered a problem and needs to close' and on details part, ModName:php5ts.dll"

Event Log: Dr.Watson, information as below.
===========================================
The application, D:\PHP\php.exe, generated an application error The error occurred on 11/11/2006 @ 21:24:31.089 The exception generated was c0000005 at address 100974CD (php5ts!zend_hash_destroy)
===========================================




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-11 16:58 UTC] jitudavda at hotmail dot com
While executed by IIS, php.exe remians in Tasklist with CPU usage 0. The browser output is nothing for long long time. No timeout even!!

I've provided all required permissions to root php folder and child object.
 [2006-11-11 17:31 UTC] jitudavda at hotmail dot com
I switched to using php5isapi.dll. (I reinstalled without 'CLI Executable' option.)

It works fine only for phpinfo(); Running the application gave one more issue.
==============================================
Out of process application '/LM/W3SVC/1/Root/drupal' terminated unexpectedly. 
==============================================

Every request gives Internal Server 500 error and then on second try it returns resulted page or empty output.

Thanks Help is needed urgently.
 [2006-11-12 18:54 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-11-15 16:38 UTC] jitudavda at hotmail dot com
Hi,

Can you help me get the debug information as per your requirement?

Steps done by me.
1] Installed the VS (Also VS.NET 2003)
2] Initiated request to php page.
3] waited long time, but no reply.
4] Opened Tasklist, Right clicked "php.exe" and clicked Debug.
5] MSVC opens. 
6] Problem is the debug code is not getting attached to the php.exe.
I'm getting "'D:\php\php.exe' does not contain debugging information."

I'm stuck here.
==========================================
I've few screenshots, how can I send them to you?
Screenshots shows message stating "The process appears to be deadlocked (or is not running any user-mode code). All threads have been stopped." 
Steps to regenerate.
1] Start VS.NET 2003
2] Request the php page on IIS.
3] Attach php.exe for debugging in VS.NET
4] click on Break button.
==========================================


Below is the copy of call stack taken using VS.NET.
================================================= 	ntdll.dll!7c90eb94() 	
 	ntdll.dll!7c90e288() 	
 	kernel32.dll!7c801875() 	
 	kernel32.dll!7c8399f3() 	
 	msvcrt.dll!77c2f941() 	
 	msvcrt.dll!77c2fafa() 	
 	msvcrt.dll!77c411a0() 	
 	msvcrt.dll!77c41225() 	
 	php5ts.dll!100b0297() 	
 	php5ts.dll!100b0334() 	
 	php5ts.dll!100a40ab() 	
 	php5ts.dll!100a0587() 	
 	php5ts.dll!10017c9f() 	
 	php5ts.dll!1009cb93() 	
 	ntdll.dll!7c9105c8() 	
 	ntdll.dll!7c910551() 	
 	ntdll.dll!7c914c99() 	
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c914bba() 	
 	ntdll.dll!7c914bc7() 	
 	ntdll.dll!7c911538() 	
 	ntdll.dll!7c911538() 	
 	ntdll.dll!7c911596() 	
 	ntdll.dll!7c9106eb() 	
 	uxtheme.dll!5ad8ee21() 	
 	uxtheme.dll!5ad8ee6c() 	
 	uxtheme.dll!5ad8ee79() 	
 	ntdll.dll!7c9155c9() 	
 	ntdll.dll!7c90fb6c() 	
 	ntdll.dll!7c90fb71() 	
 	ntdll.dll!7c90e20a() 	
 	ntdll.dll!7c90fb71() 	
 	advapi32.dll!77dd6fb4() 	
 	advapi32.dll!77dd6fbf() 	
 	ntdll.dll!7c914d8f() 	
 	ntdll.dll!7c90fb6c() 	
 	ntdll.dll!7c90fb71() 	
 	ntdll.dll!7c915041() 	
 	ntdll.dll!7c915233() 	
 	ntdll.dll!7c9155c9() 	
 	ntdll.dll!7c915d7d() 	
 	ntdll.dll!7c915db4() 	
 	ntdll.dll!7c9153f5() 	
 	ntdll.dll!7c915af1() 	
 	ntdll.dll!7c915b4f() 	
 	ntdll.dll!7c9153f5() 	
 	ntdll.dll!7c915707() 	
 	ntdll.dll!7c915a00() 	
 	ntdll.dll!7c915a65() 	
 	ntdll.dll!7c9169a5() 	
 	ntdll.dll!7c90efe3() 	
 	ntdll.dll!7c91691d() 	
 	ntdll.dll!7c916924() 	
 	ntdll.dll!7c910833() 	
 	ntdll.dll!7c9169a5() 	
 	ntdll.dll!7c90efe3() 	
 	ntdll.dll!7c91691d() 	
 	ntdll.dll!7c916924() 	
 	ntdll.dll!7c9169a5() 	
 	ntdll.dll!7c90efe3() 	
 	ntdll.dll!7c91691d() 	
 	ntdll.dll!7c916924() 	
 	ntdll.dll!7c91554a() 	
 	ntdll.dll!7c9169a5() 	
 	ntdll.dll!7c90efe3() 	
 	ntdll.dll!7c91691d() 	
 	ntdll.dll!7c916924() 	
 	ntdll.dll!7c910732() 	
 	ntdll.dll!7c910732() 	
 	ntdll.dll!7c9106ab() 	
 	ntdll.dll!7c9106eb() 	
 	ntdll.dll!7c916924() 	
 	ntdll.dll!7c9168a6() 	
 	ntdll.dll!7c9168ae() 	
 	ntdll.dll!7c911b09() 	
 	ntdll.dll!7c911b09() 	
 	ntdll.dll!7c9106eb() 	
 	ntdll.dll!7c9119e6() 	
 	ntdll.dll!7c911a24() 	
 	ntdll.dll!7c9119fa() 	
 	ntdll.dll!7c910945() 	
 	ntdll.dll!7c91094e() 	
 	ntdll.dll!7c914190() 	
 	ntdll.dll!7c910970() 	
 	ntdll.dll!7c913e6f() 	
 	ntdll.dll!7c913e62() 	
 	kernel32.dll!7c80b6c6() 	
 	ntdll.dll!7c910945() 	
 	ntdll.dll!7c91094e() 	
 	ntdll.dll!7c9103be() 	
 	ntdll.dll!7c910970() 	
 	ntdll.dll!7c9140ef() 	
 	ntdll.dll!7c9140bb() 	
 	ntdll.dll!7c915db4() 	
 	ntdll.dll!7c910732() 	
=================================================
 [2006-11-16 10:57 UTC] jitudavda at hotmail dot com
Here is the Stack:

1] zend_hash_destroy(_hashtable * 0x100076cc) line 517 + 7 bytes
2] module_registry_cleanup(_zend_module_entry * 0x013b7788, void * * * 0x00282900) line 1945 + 17 bytes
3] zend_hash_apply(_hashtable * 0x10002562, int (void *, void * * *)* 0x102cc8a0 _module_registry, void * * * 0x100076b0 module_registry_cleanup(_zend_module_entry *, void * * *)) line 668 + 9 bytes
4] zend_deactivate_modules(void * * * 0x0000078c) line 819 + 16 bytes



Below is the "Locals" values
=======================================
- ht->pListHead	0x04244c8b
  h	CXX0030: Error: expression cannot be evaluated
  nKeyLength	CXX0030: Error: expression cannot be evaluated
  pData	CXX0030: Error: expression cannot be evaluated
  pDataPtr	CXX0030: Error: expression cannot be evaluated
  pListNext	CXX0030: Error: expression cannot be evaluated
  pListLast	CXX0030: Error: expression cannot be evaluated
  pNext	CXX0030: Error: expression cannot be evaluated
  pLast	CXX0030: Error: expression cannot be evaluated
  -  arKey	0x04244cab ""
      [0]	CXX0030: Error: expression cannot be evaluated

If you need anymore information, please let me know. I've setup to build from source of PHP, using "php5.2-200611160730.tar.gz"

Thank you.
Jitendra
 [2006-11-16 11:04 UTC] tony2001@php.net
Which modules and extensions do you have enabled?
Do you have any zend_extension's installed?
 [2006-11-16 11:56 UTC] jitudavda at hotmail dot com
Please review three points below.

==1] =================================
The problem is raised while executing the following function as start point.
File: sapi\cli\php_cli.c
LINE: 1258
CODE-SNAP:
=========================================================
	if (request_started) {
		php_request_shutdown((void *) 0);
	}
=========================================================


==2] ==================================
Deadlock situation is created in the code as detailed below.
File Name: \Zend\zend_hash.c
Function: ZEND_API void zend_hash_destroy(HashTable *ht)
Place: while(p != NULL)
Exception: Access Denied.
======================================

==3] ====================================
Below is the content of "Auto" of the module_registry_cleanup function call.
======================================================
-	module	0x013b7788
	size	88
	zend_api	20060613
	zend_debug	0 ''
	zts	1 ''
+	ini_entry	0x00000000
+	deps	0x00000000
+	name	0x01b22100 "threads"
-	functions	0x01b23010
+	fname	0x01b22188 "thread_start"
	handler	0x01b21670
+	arg_info	0x00000000
	num_args	4294967295
	flags	0
	module_startup_func	0x01b21240
	module_shutdown_func	0x01b21270
	request_startup_func	0x01b21280
	request_shutdown_func	0x01b212f0
	info_func	0x01b21350
+	version	0x01b220fc "0.1"
	globals_size	0
+	globals_id_ptr	0x00000000
	globals_ctor	0x00000000
	globals_dtor	0x00000000
	post_deactivate_func	0x00000000
	module_started	1
	type	1 ''
	handle	0x01b20000
	module_number	41
	module->module_number	41
+	module->name	0x01b22100 "threads"
	module->request_shutdown_func	0x01b212f0
	module->type	1 ''
	zend_printf	0x100b4bb0 php_printf(const char *, <no type>)
======================================================
 [2006-11-16 12:05 UTC] tony2001@php.net
Please report problems related to PECL extensions using PECL bug tracking system.
It's not PHP problem, but a problem of particular PECL module, which has been unsupported for years.
 [2006-11-16 12:06 UTC] jitudavda at hotmail dot com
Code is compiled with the following options.

cscript /nologo configure.js --enable-debug-pack --with-php-build=D:\php_build\ --without-libxml

I started the debug of php.exe in MSVC. Argument given was a file with content "<?php phpinfo();"
 [2006-11-16 12:07 UTC] jitudavda at hotmail dot com
I've not installed any of PELC options.
 [2006-11-16 12:14 UTC] jitudavda at hotmail dot com
1] Request php page from browser.
2] wait for sometime for any output.
3] Open TaskList.
4] Right click Php.exe and Debug.
5] In MSVC, Break the execution.

Above are the steps to get the output as below in the call stack.
==============================

NTDLL! 7c90eb94()
MSVCRT! 77c2f941()
MSVCRT! 77c2fafa()
MSVCRT! 77c411a0()
MSVCRT! 77c41225()
zend_stream_stdio_reader(void * 0x77c5fc80, char * 0x011638a0, unsigned int 8192, void * * * 0x00283c80) line 28 + 23 bytes
zend_stream_read(_zend_file_handle * 0x100a0587, char * 0x00283c80, unsigned int 2636928, void * * * 0x0000004e) line 121 + 22 bytes
lex_scan(_zval_struct * 0x1009cc7a, void * * * 0x00c0e51c) line 5249 + 6 bytes
zendparse(void * 0x1009fd40) line 2975 + 11 bytes
compile_file(_zend_file_handle * 0x10002d85, int 12648140, void * * * 0x00000008) line 3084
zend_execute_scripts(int 269185869, void * * * 0x00000008, _zval_struct * * 0x00283c80, int 0) line 1090 + 16 bytes
php_execute_script(_zend_file_handle * 0x00285050, void * * * 0x00fa7ce8) line 1758 + 18 bytes
_efree(void * 0x00fa7ce8) line 1660 + 24 bytes
_zval_ptr_dtor(_zval_struct * * 0x00fa7d0c) line 415 + 37 bytes
_zend_hash_add_or_update(_hashtable * 0x100bc77f, char * 0x00fa7278, unsigned int 4207956, void * 0x0000000e, unsigned int 12647804, void * * 0x00000004, int 13) line 229 + 6 bytes
php_register_variable_ex(char * 0x1000a501, _zval_struct * 0x00c0fe14, _zval_struct * 0x00000000, void * * * 0x00000000) line 208 + 128 bytes
_emalloc(unsigned int 43) line 1647 + 24 bytes
_zend_hash_add_or_update(_hashtable * 0x0040214d, char * 0x00c0fecc, unsigned int 2636928, void * 0x009bffdc, unsigned int 2009291924, void * * 0x7ffd7000, int 12648268) line 242 + 9 bytes
main(int 0, char * * 0x00000000) line 1109
002850ec()

==============================
 [2006-11-16 12:15 UTC] tony2001@php.net
Oh, yes you do:
+	name	0x01b22100 "threads"
-	functions	0x01b23010
+	fname	0x01b22188 "thread_start"

This is PECL/threads, which has never been officially released.
 [2006-11-16 12:40 UTC] jitudavda at hotmail dot com
The above reply at "[16 Nov 12:14pm UTC] jitudavda at hotmail dot com" is done after chanding installation without any extension & extras.
 [2006-11-16 12:56 UTC] jitudavda at hotmail dot com
CHANDING THE STATUS TO BOGUS HURTS.
PHP version has bug with WinXp, this is a fact.
I expect the bug manager/moderators to help in finding the place, instead of making the issue as bogus. 

If you need further help, please write here for the step you need me to perform. 

Below is the current installation of php on WinXP.

OS: WinXP
PHP: php 5.2.0
INSTALLATION OPTIONS: 
   1] \PHP\Program\CLI Executable
   2] \PHP\Web Server Setup\IIS 4+ ISAPI module
   Note: All other options are not installed or marked "donot install"

PERMISSION: IUSER_DEV has Read/Execute permision on all object of "D:\PHP" <-installed folder.

PROBLEM: Request to any php page hangs the php.exe

Goodluck.
 [2006-11-16 13:09 UTC] tony2001@php.net
Please find & delete all php.ini's in your system.
After that make sure you don't have any .dlls from the previous PHP version installed, delete them if you find any.
Then grab the latest snapshot, install it and run `php.exe -v` and `php.exe -m`.
If you're still able to reproduce the problem with this two simple commands - please post *REAL* backtrace (the one that doesn't mention modules which are not installed).
Thank in advance.
 [2006-11-16 13:59 UTC] fmk@php.net
If php.exe hangs when you request a page through ISS you are configuring IIS wrong!

php.exe => CLI version of PHP
php-cgi.exe => CGI/FastCGI version
php5isapi.dll => ISAPI version.

php.exe should only be used for command line execution of PHP scripts.
 [2006-11-16 14:42 UTC] jitudavda at hotmail dot com
==1] ==========================================
- php.ini files from windows folder and D drive are removed.
- uninstalled php
- remove all the folders and files from the folder D:\PHP
- reinstalled the php with only two options selected.
- IIS Restarted.

Output of the commands you asked to execute.
-----------------------------------------------
D:\PHP>php -v
PHP 5.2.0 (cli) (built: Nov  2 2006 11:57:36)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

D:\PHP>php -m
[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
filter
ftp
hash
iconv
json
libxml
odbc
pcre
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zlib

[Zend Modules]


D:\PHP>
--------------------------------------------------
==================================================

==2] =============================================

1] Request php page from browser.
2] wait for sometime for any output.
3] Open TaskList.
4] Right click Php.exe and Debug.
5] In MSVC, Break the execution.

OUTPUT: Debug display disassembled code and following items in stack.
----------------------------------------------
NTDLL! 7c90eb94()
PHP5TS! 10095a48()

--------------------------------------------
BELOW IS DISASSEMBLY CODE
--------------------------------------------
7C90EB89   nop
7C90EB8A   nop
7C90EB8B   mov         edx,esp
7C90EB8D   sysenter
7C90EB8F   nop
7C90EB90   nop
7C90EB91   nop
7C90EB92   nop
7C90EB93   nop
7C90EB94   ret
7C90EB95   lea         esp,[esp]
7C90EB9C   lea         esp,[esp]
7C90EBA0   nop
7C90EBA1   nop
7C90EBA2   nop
7C90EBA3   nop
7C90EBA4   nop
7C90EBA5   lea         edx,[esp+8]
7C90EBA9   int         2Eh
--------------------------------------------

==3] =============================================
- Copied the php build versions to the D:\php\
- Following files copied
 php.exe
 php5ts.dll
 php.pdb
 php5ts.pdb

- IIS Reset done.
1] Request php page from browser.
2] wait for sometime for any output.
3] Open TaskList.
4] Right click Php.exe and Debug.
5] In MSVC, Break the execution.

--------------------------------------------------
NTDLL! 7c90eb94()
MSVCRT! 77c2f941()
MSVCRT! 77c2fafa()
MSVCRT! 77c411a0()
MSVCRT! 77c41225()
zend_stream_stdio_reader(void * 0x77c5fc80, char * 0x01162858, unsigned int 8192, void * * * 0x00283c80) line 28 + 23 bytes
zend_stream_read(_zend_file_handle * 0x100a0587, char * 0x00283c80, unsigned int 2636928, void * * * 0x0000004e) line 121 + 22 bytes
lex_scan(_zval_struct * 0x1009cc7a, void * * * 0x00c0e51c) line 5249 + 6 bytes
zendparse(void * 0x1009fd40) line 2975 + 11 bytes
compile_file(_zend_file_handle * 0x10002d85, int 12648140, void * * * 0x00000008) line 3084
zend_execute_scripts(int 269185869, void * * * 0x00000008, _zval_struct * * 0x00283c80, int 0) line 1090 + 16 bytes
php_execute_script(_zend_file_handle * 0x00285050, void * * * 0x00fa7ce8) line 1758 + 18 bytes
_efree(void * 0x00fa7ce8) line 1660 + 24 bytes
_zval_ptr_dtor(_zval_struct * * 0x00fa7d0c) line 415 + 37 bytes
_zend_hash_add_or_update(_hashtable * 0x100bc77f, char * 0x00fa7278, unsigned int 4207956, void * 0x0000000e, unsigned int 12647804, void * * 0x00000004, int 13) line 229 + 6 bytes
php_register_variable_ex(char * 0x1000a501, _zval_struct * 0x00c0fe14, _zval_struct * 0x00000000, void * * * 0x00000000) line 208 + 128 bytes
_emalloc(unsigned int 43) line 1647 + 24 bytes
_zend_hash_add_or_update(_hashtable * 0x0040214d, char * 0x00c0fecc, unsigned int 2636928, void * 0x00011970, unsigned int 2089883889, void * * 0x7ffd5000, int 12648268) line 242 + 9 bytes
main(int 0, char * * 0x00000000) line 1109
002850ec()

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

==4] ================================================
POINT 2 AND 3 HAS THE SAME BEHAVIOUR.

Point 2 has the installer versions of php.exe and php5ts.dll
Point 3 has the local compiled versions of php.exe and php5ts.dll. 

Note: 
- Compilation is done with all instructions from PHP team. No edit at any places.
- Compilation of php.exe gives the same size of php.exe
- Compilation of php5ts.dll is reduced size. 
----Installer version php5ts.dll [4589 KB]
----Compiled version php5ts.dll [2693 KB]
----Compiled version of php5ts.pdb [4169 KB]


Please ask for any further help from me.

Thank  you.
Jitendra
 [2006-11-16 14:44 UTC] tony2001@php.net
How did you configure IIS to use php.exe instead of php-cgi.exe and why?
 [2006-11-16 14:56 UTC] jitudavda at hotmail dot com
I've not done any configuration of php with IIS. It's done by the installer itself.

I'm now testing with the IIS configuration as noted above.
- Use ISAPI version.

Though it had the similar issue earler. I will get back soon with the results.

Thanks
 [2006-11-16 15:14 UTC] jitudavda at hotmail dot com
-Uninstalled PHP.
-Removed configuration from IIS
-Installed PHP
-Added configuration for ISAPI dll.
-IIS reset
1] Done request for php page.
2] Got the output as expected.

I feel the wrong configuration of IIS is the issue here. But see correct configuration was done by me and I'd the same issue. Check the second post at "[11 Nov 4:58pm UTC] "

Now I will install the ext modules and perform the same test. May be the problem caused by ext modules only.

I will reply here after testing with ext modules.

Please give me the ext module bug reporting url.

Thank you for all help.
 [2006-11-16 15:42 UTC] jitudavda at hotmail dot com
Yes, it works with ext modules. I installed on mysql, mssql, pop and smtp.

It works fine right now. Threads module is not installed.
 [2006-11-17 08:22 UTC] fmk@php.net
Not a PHP problem in the first place.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC