php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27772 It crashes at the last of cgi_main.
Submitted: 2004-03-30 05:22 UTC Modified: 2004-03-31 09:42 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: khagiya1 at yahoo dot co dot jp Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.5 OS: Windows Xp Professional Ver2002
Private report: No CVE-ID: None
 [2004-03-30 05:22 UTC] khagiya1 at yahoo dot co dot jp
Description:
------------
Please let me know.

I downloaded "PHP 4.3.5 (tar.gz) [4,706Kb]-26 March 2004." from "http://www.php.net/downloads.php"
It is used building it personally.
It crash, although only built.

Reproduce code:
---------------
The example of a code to generate

[c:/hello.csp]
<?php
	echo 'hello!!';
?>

[php.ini]
zend_extension_ts = c:/ioncube_loader.dll

?EThe following is performed on a console.
c:/php.exe -f c:/hello.csp

It is displayed on a screen as "hello!!".
Crash occurs together with it.

This is generated only when module(zend_extension_ts) is loaded.
It does not generate in module(extension).

When the code was seen, it had generated in the following places.
The following change went into TSRM/TSRM.c by php-4.3.4 to php-4.3.5.

*** TSRM/TSRM.c	Tue Nov 11 14:17:17 2003 <-- 4.3.4
--- TSRM/TSRM.c	Wed Dec 17 04:59:58 2003 <-- 4.3.5
***************
*** 157,163 ****
  				int j;
  
  				next_p = p->next;
! 				for (j=0; j<id_count; j++) {
  					free(p->storage[j]);
  				}
  				free(p->storage);
--- 157,166 ----
  				int j;
  
  				next_p = p->next;
! 				for (j=0; j<p->count; j++) {
! 					if (resource_types_table && resource_types_table[j].dtor) {
! 						resource_types_table[j].dtor(p->storage[j], &p->storage);  <-- cause the problem!!
! 					}
  					free(p->storage[j]);
  				}
  				free(p->storage);


sapi/cgi/cgi_main.c: line 1787 - 1792
------------------------------------------------------------------
	php_module_shutdown(TSRMLS_C);
	HLOG_LOG( HLOG_NOTICE, "php_module_shutdown" );

#ifdef ZTS
	tsrm_shutdown();
#endif
------------------------------------------------------------------

show callstack.

1. php_module_shutdown
2. zend_shutdown
3. zend_shutdown_extensions
4. zend_llist_destroy
5. zend_extension_dtor
6. DL_UNLOAD <-- module(by zend_extension_ts) is unload here.
7. tsrm_shutdown <-- dtor can't be called.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-30 08:47 UTC] egarcia at egm dot as
Well, I report a similar error when this version was in beta testing.  The product can be used with Zend Optimizer, this carsh constantly.

If I disable the Zend Optimizer 2.1b or 2.5 the product works OK, even with the Zend Extensions enabled the product works OK.

The answer that I get about this incident not existent in the 4.3.4 was that this problem is related to Zend and not to the PHP itself.

But reading the report with the Ioncube extensions must be related to the Zend Engine or the PHP.

Regards,
 [2004-03-30 08:52 UTC] egarcia at egm dot as
You can get mor information from:
Bug #27141 PHP.exe crash on console.
 [2004-03-30 09:53 UTC] derick@php.net
Does it work when you disable the ioncube_loader?
 [2004-03-30 23:44 UTC] khagiya1 at yahoo dot co dot jp
I am sorry since the range of zend and the range of php are not known well.

Is it the same as this bug(Bug #27141)?
In my place, even if this problem is not a command line, it occurs.

> Does it work when you disable the ioncube_loader?
Yes, it operates satisfactory.

It will crash, if there is some zend_extension_ts.
For example, It crashes, even if it writes this.
[php.ini]
zend_extension_ts = C:\ZendOptimizer.dll

An extended module calls ZEND_INIT_MODULE_GLOBALS in PHP_MINIT_FUNCTION mostly.
In ZTS mode, this calls ts_allocate_id.
dtor and ctor(for module) are registered by this.
So, in zend_extension_ts which is not calling this function, it doesn't crash.
 [2004-03-31 07:06 UTC] egarcia at egm dot as
The problem is also reproducible in the Web, but I only get no data (blank screen) or one message related to PHP exception.

In the console I always get the error.  In the Web not always but is very unstable.

Without any zend_extension_ts, all is very stable.

Faulting application php.exe, version 4.3.5.5, faulting module unknown, version 0.0.0.0, fault address 0x00d74140.

zend_extension_ts="C:\Program Files\Zend\lib\ZendExtensionManager.dll"
zend_extension_manager.optimizer_ts="C:\Program Files\Zend\lib\Optimizer-2.5.0"
zend_extension_manager.debug_server_ts="C:\Program Files\Zend\lib\Debugger-3.0.1"

If I comment the optimizer_ts line and debuger_server_ts, all works OK even with the zend_extension_ts; but If I enable one of both then I get crash.
 [2004-03-31 09:42 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2004-03-31 19:54 UTC] egarcia at egm dot as
Hello, I test with the php4-win32-STABLE-200404010030.zip

And ALL WORKS FINE, with and without the Zend extensions (Optimizer & debugger) in the Web and the console.

Thanks, regards.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 13:01:32 2024 UTC