php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60265 'new COM' crash
Submitted: 2011-11-11 11:51 UTC Modified: 2011-11-25 14:06 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: bugzilla33 at gmail dot com Assigned:
Status: Closed Package: COM related
PHP Version: 5.4.0RC1 OS: Windows 7 32bit
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: bugzilla33 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-11 11:51 UTC] bugzilla33 at gmail dot com
Description:
------------
Calls to 'new COM' and methods from its object crash PHP!

This bug is introduced in PHP 5.4
PHP 5.3.9RC1 works perfect.

Tested on Windows 7 32 bit + Apache 2.2.21 VC9 from apache longuq + PHP 5.4.0RC1 VC9 Thread Safe.


Expected result:
----------------
no crash


Actual result:
--------------
crash


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-11 22:13 UTC] felipe@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2011-11-11 22:13 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2011-11-12 09:34 UTC] bugzilla33 at gmail dot com
Here you are:

Expected result:
----------------
PHP 5.3.9RC1 prints: Microsoft Windows


Actual result:
--------------
PHP 5.4.0RC1 crash


<?php
 $z=50;while($z--){

  $o=new COM('WinMgmts:',null,CP_UTF8);
  foreach($o->ExecQuery('SELECT * FROM Win32_OperatingSystem') as $x){
   $o=$x->Caption;
  }

 }

 print($o);
?>
 [2011-11-12 09:34 UTC] bugzilla33 at gmail dot com
-Status: Feedback +Status: Open
 [2011-11-12 09:35 UTC] bugzilla33 at gmail dot com
corrected version:

<?php
 $z=50;while($z--){

  $o=new COM('WinMgmts:',null,CP_UTF8);
  foreach($o->ExecQuery('SELECT * FROM Win32_OperatingSystem') as $x){
   $s=$x->Caption;
  }

 }

 print($s);
?>
 [2011-11-25 14:06 UTC] bugzilla33 at gmail dot com
-Status: Open +Status: Closed
 [2011-11-25 14:06 UTC] bugzilla33 at gmail dot com
FIXED, testes on PHP 5.4 Revision 319806
I close this bug.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 20:03:35 2022 UTC