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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 04:01:29 2024 UTC