#152 closed Bug (Fixed)
StdoutRead maxes CPU on process (when not run from SciTe).
Reported by: | Saunders <admin@…> | Owned by: | Valik |
---|---|---|---|
Milestone: | 3.2.11.2 | Component: | AutoIt |
Version: | 3.2.11.1 | Severity: | |
Keywords: | Cc: |
Description
There appears to be a bug with StdoutRead that causes the spawned process to max out the CPU. I've provided two scripts, because this was the cleanest and simplest way I could discern to demonstrate the bug, I believe my code should work properly, although if there are errors with the code itself, feel free to ream me out for borking it.
Anyway, this first piece of code is the Child script, save it in a folder as TestChild.au3.
; Very simple script that should NOT max out the CPU Do ConsoleWrite('Loop') Until MsgBox(4, '', 'Continue?') = 7
This second piece of code is the Parent script, save it in the same folder as TestChild.au3.
#include <Constants.au3> Global $sOutput, $sStdoutRead Global $iScriptPID = Run(FileGetShortName(@AutoItExe) & ' ' & FileGetShortName(@ScriptDir & '\TestChild.au3'), @ScriptDir, @SW_HIDE, $STDOUT_CHILD) While 1 If $iScriptPID Then $sStdoutRead = StdoutRead($iScriptPID) If Not @error Then If @extended Then $sOutput &= $sStdoutRead & @LF ToolTip('Parent PID: ' & @AutoItPID & @LF & 'Child PID: ' & $iScriptPID & @LF & $sOutput) EndIf Else $iScriptPID = False EndIf Sleep(100) Else MsgBox(0, '', 'Parent exiting') ExitLoop EndIf WEnd
Now, this is important, run the Parent script, but not through SciTe. I found that for whatever reason, running this code through SciTe doesn't give me any problems.
Now, while it's running have a look at your Task Manager, you should see that the child process is maxing out the CPU, and considering that it should be stopped on a MsgBox(), I really don't think it should be doing that.
Attachments (0)
Change History (3)
comment:1 Changed 17 years ago by Jpm
comment:2 Changed 17 years ago by Valik
- Milestone set to 3.2.11.2
- Owner set to Valik
- Resolution set to Fixed
- Status changed from new to closed
Fixed in version: 3.2.11.2
comment:3 Changed 17 years ago by Valik
That was a rather strange bug. Actually seems to be a bug in how the Windows API works in a certain obscure scenario. Anyway, as noted by the auto-message, it's fixed in the next beta.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Valik should have a look at it as the beta StdOutRead has been redesigned
The Official release does experience such problem