|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37984 CLI sometimes crashes on Shell.Application
Submitted: 2006-07-01 19:57 UTC Modified: 2006-07-10 01:00 UTC
From: csaba at alum dot mit dot edu Assigned:
Status: No Feedback Package: COM related
PHP Version: 5CVS-2006-07-01 (snap) OS: Win XP Pro
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.
Block user comment
Status: Assign to:
Bug Type:
From: csaba at alum dot mit dot edu
New email:
PHP Version: OS:


 [2006-07-01 19:57 UTC] csaba at alum dot mit dot edu
Sorry I cannot reliably reproduce this but...

php-win.exe often errors, giving me one of those "would you like to report this to Microsoft dialogs" on account of the $ox=new COM("Shell.Application"); line.  This happens in version 5.1.1 (from about Dec. 2005) and today's 5.2  Note that it only happens:
1. with php-win.exe
2. in the php-win -a form and not the -r form
3. when the Shell.Application line is present
4. when the execScript line is present

The last two lines and the opener="me" line are not required for the bug to be shown.  They are there so that when you go to the new IE, you can make it go away by pressing any key.

Also, despite the bug, the new IE appears and the execScript functionality is present.

// to see the bug, have DOSKEY active, and
// call the file below (named inc.php) a few
// times from a (wrapped) command line with:

// echo ^^^<?php include('inc.php');ieStuff("<strong>Whoever</strong>"); ?^^^> | php-win -a

// or

// echo ^^^<?php ieStuff("<strong>Whoever</strong>"); ?^^^> | php-win -d auto_prepend_file=inc.php -a

Reproduce code:
function ieStuff($html) {
  // Without this line, the bug does not happen
  $ox = new COM("Shell.Application");

  // new instance of IE
  $ie = new COM("InternetExplorer.Application");
  // next line creates a DOM
  // allow for settling
  while ($ie->ReadyState!=4) usleep(10000);
  $ie->Visible = true;
  // next line allows self.close()

  // escape handler definition
  // proof of access to IE
  $ie->document->body->innerHTML = $html;
  // so escape handler listens
  $ie->document->body->focus(); }

Expected result:
I don't expect to see any CLI error message

Actual result:
Every so often, sometimes consistently every time, I get a CLI error dialog box on account of the Shell.Application line, which is not even used (in the example).

The more windows you have open (IE and otherwise), the more likely the bug is to show itself.  Under 25 windows open, and it doesn't fail much.  Also, the problem tends to surface more readily if you go do your thing and then come back to the Cmd window 10 or 20 minutes later and then try it again.

Sorry, I can't be more specific.  I'm probably as unhappy reporting on an intermittent bug as you are reading about it.

Csaba Gabor from Vienna


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-02 18:56 UTC]
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 for *NIX and 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-07-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 20:01:29 2024 UTC