http://bugs.winehq.org/show_bug.cgi?id=18705
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #10 from Anastasius Focht focht@gmx.net 2009-05-31 04:25:36 --- Hello,
although it's always welcome that people give as much information as possible in bug reports please don't overdo it - sometimes less is more ;-) Thanks anyway.
The programs try to determine the CPU load using a common pattern and due to bad programming they go into recursion, eating up all the stack.
There are many examples/snippet in various programming languages how to do this in Windows. One example snippet: http://cpansearch.perl.org/src/KXJ/Win32-SystemInfo-CpuUsage-0.02/CpuUsage.x...
The example code snippet doesn't resemble the app code exactly but it should give you an idea how it's done.
The problem is that Wine's SystemPerformanceInformation info class currently doesn't return useful values. The "idle time" (large integer) value will be ever zero on each retrieval.
To synchronize the "first time" calculation to sane values, the app uses a "while" loop, retrieving the values, calculating differences to previous ones. It checks the idle value and as long as it remains zero, it calls the "get cpu usage" function recursively which leads to infinite recursion until stack overflow.
Solution: Either provide "idle time" value from OS or non-zero "spike" the value at least once in a while.
Regards