|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-29 12:38 UTC] thekid@php.net
Description:
------------
Multiple calls to a COM function result in crash / memory corruption / weird behaviour.
Test script:
---------------
$ php -r '$com= new com("winmgmts:"); foreach (explode(",", $argv[1]) as $pid) { $p= $com->get("//./root/cimv2:Win32_Process.Handle=$pid"); echo $pid, ": ", $p->executablePath, ": "; var_dump($p->commandLine); }' 3132,2760,3268
Expected result:
----------------
Something like:
3132: C:\...\GoogleToolbarNotifier.exe: string(74) ""C:\...\GoogleToolbarNotifier.exe" "
2760: F:\...\ONENOTEM.EXE: string(58) ""F:\...\ONENOTEM.EXE" /tsr"
3268: F:\...\XWin.exe: string(38) "F:\...\XWin.exe :0 -multiwindow"
Actual result:
--------------
Something like:
3132: C:\...\GoogleToolbarNotifier.exe: string(74) ""C:\...\GoogleToolbarNotifier.exe" "
3132: C:\...\GoogleToolbarNotifier.exe: string(74) ""C:\...\GoogleToolbarNotifier.exe" "
3132: C:\...\GoogleToolbarNotifier.exe: string(74) ""C:\...\GoogleToolbarNotifier.exe" "
Patchesbugfix-and-all-warnings-removal.diff (last revision 2011-11-23 14:35 UTC by thekid@php.net)bugfix-and-warnings-removal.diff (last revision 2011-11-23 14:17 UTC by php at thekid dot de) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 04:00:01 2025 UTC |
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){ $s=$x->Caption; } } print($s); ?>