php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27750 CLI script generates a "Please tell Microsoft about this problem".
Submitted: 2004-03-29 06:32 UTC Modified: 2004-03-30 10:08 UTC
Votes:2
Avg. Score:3.5 ± 1.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: richard dot quadling at carval dot co dot uk Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.5 OS: Windows XP Pro SP1
Private report: No CVE-ID: None
 [2004-03-29 06:32 UTC] richard dot quadling at carval dot co dot uk
Description:
------------
The following script (which is from a working script for V4.3.4) runs but does not close down properly.

<?php
function CloseScript()
{
global $asLog;
$asLog[] = 'Finished';
}

$asLog = array('Started');

CloseScript();
print_r($asLog);
?>

produces output of ...

Array
(
    [0] => Started
    [1] => Finished
)

The above script is from a program to download antivirus updates, store them on our server and inform all clients that a new update is available and track their compliance with upgrading.


The error signature is (available when you click "To see what data this error report contains, click here").

AppName: php.exe
AppVer: 4.3.5.5
ModName: unknown
ModVer: 0.0.0.0
Offset: 00bb41f0


An appcompat.txt file is also produced ...

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="php.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="php.exe" SIZE="24576" CHECKSUM="0xF7CC6784" BIN_FILE_VERSION="4.3.5.5" BIN_PRODUCT_VERSION="4.3.5.0" PRODUCT_VERSION="4.3.5" FILE_DESCRIPTION="PHP Script Interpreter" COMPANY_NAME="The PHP Group" PRODUCT_NAME="PHP Thread Safe Command Line Interface" FILE_VERSION="4.3.5.5" ORIGINAL_FILENAME="php.exe" INTERNAL_NAME="php-cli" LEGAL_COPYRIGHT="Copyright ? 2002 The PHP Group" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x40000" UPTO_BIN_FILE_VERSION="4.3.5.5" UPTO_BIN_PRODUCT_VERSION="4.3.5.0" LINK_DATE="03/25/2004 14:20:57" UPTO_LINK_DATE="03/25/2004 14:20:57" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="930304" CHECKSUM="0xCBCCF8A9" BIN_FILE_VERSION="5.1.2600.1106" BIN_PRODUCT_VERSION="5.1.2600.1106" PRODUCT_VERSION="5.1.2600.1106" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft? Windows? Operating System" FILE_VERSION="5.1.2600.1106 (xpsp1.020828-1920)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="? Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xE7ED3" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.1106" UPTO_BIN_PRODUCT_VERSION="5.1.2600.1106" LINK_DATE="08/29/2002 10:40:40" UPTO_LINK_DATE="08/29/2002 10:40:40" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>

I have restored V4.3.4 and the problem is not present.

It seems that this is ONLY with CLI version. I use Sambar Server and the ISAPI module. If I run the same script via the browser (all on the same pc), then no problems.

Regards,

Richard Quadling.

P.S. Is there a debug build available for the windows version. I do NOT have access to a Microsoft C compiler.

Reproduce code:
---------------
<?php
function CloseScript()
{
global $asLog;
$asLog[] = 'Finished';
}

$asLog = array('Started');

CloseScript();
print_r($asLog);
?>


Expected result:
----------------
Array
(
    [0] => Started
    [1] => Finished
)

without a crash.

Actual result:
--------------
Array
(
    [0] => Started
    [1] => Finished
)

with a crash.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-29 14:31 UTC] mike at microspread dot com
I got the error when running phpinfo.php.
Seems that I get a valid page back, but then get this "PHP Script Interpreter" error.

When I click on more info, it says...
szAppName: php.exe
szAppVer: 4.3.5.5
szModName: php4ts.dll
szModVer: 4.3.5.5
offset: 000c0674

There are also the same two attached files, if required I can reproduce and send them.

Hope this helps
 [2004-03-29 15:15 UTC] edink@php.net
I cannot reproduce this. Please make sure that you have removed traces of the old php install. Also do you have any extensions enabled in your php.ini? Try without any extensions.
 [2004-03-29 16:05 UTC] mike at microspread dot com
I used the windows installer to install on top of 4.3.3.  How would I "remove all traces?"

I use the windows installer default install extensions and DMITRI'S php_dbg.dll.

OK, using your suggestions, I have narrowed it to one extention causing the problem.  When I comment out the php_printer.dll extension, then I don't get the crash.

Any thoughts on what issue that dll might have?
 [2004-03-29 16:35 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

printer extension is not a standard PHP extension, it is 
part of the PECL repository. Please report the bug on 
http://pecl.php.net/bugs/ where all PECL bugs are 
addressed. 
 [2004-03-30 03:28 UTC] richard dot quadling at carval dot co dot uk
My CLI issue has nothing to do with the printer extension.

My PHP.INI has no extensions enabled.

;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zip.dll

All files in the c:\PHP directory are from the zip version of 4.3.5. (25/03/2004 3:33pm)

The following extensions were NOT updated as part of this release:

C:\PHP\extensions\php_iisfunc.dll
C:\PHP\extensions\php_printer.dll
C:\PHP\extensions\php_iconv.dll

These extensions are NOT enabled in PHP.INI and I have removed them from the extensions directory.

I am STILL getting this problem even with the following script.

<?php echo "Hello"; ?>

As this script is NOT using ANY extensions and I am NOT loading ANY extensions in my PHP.INI file, I can only conclude that this IS an issue with PHP and NOT any PECL extension.

The above script does generate a different offset.

AppName: php.exe
AppVer: 4.3.5.5
ModName: unknown
ModVer: 0.0.0.0
Offset: 00ac41f0

Even ...

<?php ?>

generates the same error.


I am executing the PHP files via the command line.

I have added PHP to PATHEXT (which allows PHP files to be executed like a BAT/COM/EXE file. I have removed all the windows scripting extensions (VBS/VBE/JS/JSE/WSF/WSH).

Using Windows Explorer|Tools|Folder Options|File Types|PHP, the default method of Run is set to run C:\PHP\CLI\PHP.EXE "%1"

This allows me to simply type the name of script at the command line and have the output (if any) appear on the console. The scripts I run in this way tend NOT to be used within a webserver and are normally scheduled using windows Tasks.

This worked prior to V4.3.5 and I have swapped to V4.3.4 (rename C:\PHP -> C:\PHP_435 and C:\PHP_434 -> C:\PHP) and all is well again. Change to 4.3.5 and the bug returns.

Regards,

Richard Quadling.
 [2004-03-30 04:09 UTC] richard dot quadling at carval dot co dot uk
By removing the ZEND Optimizer entries in the PHP.INI file, I have removed the problem.


I have copied my PHP.INI file from C:\WINDOWS to C:\PHP\CLI and removed the ZEND optimizer section from the new INI file.

Then, I've changed the "Open" command from ...

C:\PHP\CLI\PHP.EXE "%1"

to

C:\PHP\CLI\PHP.EXE -c C:\PHP\CLI\PHP.INI "%1"

I am no longer receiving any errors.

Regards,

Richard Quadling.
 [2004-03-30 04:13 UTC] edink@php.net
OK. So this is not a bug in php itself. Please see http://www.zend.com/support/ for zend support options.
 [2004-03-30 10:01 UTC] mike at microspread dot com
What kind of support is this?

The printer dll and Zend optimizer are part of the default install.  Therefore there should be better support than to tell us to go somewhere else and clasifing the status as BOGUS.

Telling me to go to the support page actually doesn't tell me where to where to look for support.  I don't know the internals of PHP.  I don't understand what PECL means.  How do you expect us to know that.  We've helped by narrowing the problem, but it is still a problem with PHP.  I did a quick search on the PECL site and can't find a reference to a print package.

Richard, I now see that my PHP bug is different than yours, and I'm sorry that I muddied up your bug submission.  I thought I was doing pretty good when I searched the bug database for 4.3.5 and found the same message as I was getting being "Please tell Microsoft about this problem".

P.S.  There is no way to enter a ZEND support ticket for the ZEND optimizer, so that suggestion also isn't very good.
 [2004-03-30 10:08 UTC] derick@php.net
The Zend Optimizer is NOT part of the default install.
 [2004-03-30 10:15 UTC] mike at microspread dot com
Yep, you got me on the optimizer.  Sorry
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 03:01:30 2024 UTC