From:             jlim at natsoft dot com
Operating system: Windows XP
PHP version:      4.3.10
PHP Bug Type:     COM related
Bug description:  COM crash when calling WinMgmts

Description:
------------
Previously the following script to monitor CPU usage on Windows was
working with PHP 4.3.8.

The following script also fails with PHP 5.0.3.

Thanks for looking into it. John Lim.

Reproduce code:
---------------
<?php

error_reporting(E_ALL);

$c = new
COM("WinMgmts:{impersonationLevel=impersonate}!Win32_PerfRawData_PerfOS_Processor.Name='_Total'");
if (!$c) return false;

$info[0] = $c->PercentProcessorTime;
$info[1] = $c->TimeStamp_Sys100NS;
print_r($info);

?>

Expected result:
----------------
TESTED ON PHP 4.3.8 works fine:

C:\php4\php438>php -n c:\com.php  
Content-type: text/html
X-Powered-By: PHP/4.3.8

Array
(
    [0] => 363738299988;
    [1] => 127513714771937472
)

Actual result:
--------------
Crash with no output and windows crash manager dialog box appears. 

-- 
Edit bug report at http://bugs.php.net/?id=31737&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31737&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31737&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31737&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31737&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31737&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31737&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31737&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31737&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31737&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31737&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31737&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31737&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31737&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31737&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31737&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31737&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31737&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31737&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31737&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31737&r=mysqlcfg

Reply via email to