php.net |  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-07-01 19:57 UTC] csaba at alum dot mit dot edu
Description:
------------
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:
---------------
<?php
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
  $ie->Navigate2("about:blank");
  // allow for settling
  while ($ie->ReadyState!=4) usleep(10000);
  $ie->Visible = true;
  // next line allows self.close()
  $ie->Document->ParentWindow->opener="me";

  // escape handler definition
  $ie->document->parentWindow->execScript(
    "document.onkeypress=function(){window.close();}");
  // 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-02 18:56 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-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-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 13:03:35 2022 UTC