View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0021451||Lazarus||LCL||public||2012-03-09 20:57||2021-01-29 20:00|
|Reporter||Martin Friebe||Assigned To||Martin Friebe|
|Product Version||0.9.31 (SVN)|
|Fixed in Version||2.2|
|Summary||0021451: running at full CPU when it should be Idle (modal form + ReleaseComponents)|
|Description||Can be observed with the new Src-Win-Mgr. (but IMHO is not a fault of it)|
- open it via keyboard ctrl-shift-W
- tick the checkbox of the SynEdit, that was active (and therefore
handles the KeyDown)
- Close it (from within the mgr)
Now we have full CPU (1 core at 100%)
The reason is in
which runs at Idle, as well as at a queued async call
It checks if the componont is still ref counted:
if (Component is TLCLComponent)
and (TLCLComponent(Component).LCLRefCount>0) then begin
// add again to FComponentsToRelease
end else begin
// this might free some more components from FComponentsReleasing
In the given case, the "ShowModal" is called in the KeyDown handler.
Therefore as long as the Form is shown, the Componont can not be
destroyed and will be rescheduled.
Unfortunately the re-schedule runs immediately. Creating an endless loop.
|Tags||No tags attached.|
|Fixed in Revision||64435|
||I can confirm this bug. System: win32, Free Pascal trunk 2.7.1-r20476, Lazarus trunk 0.9.31-r35808.|
||@Martin, can you create example of problem. Maybe it's related to my changes of ShowModal (modal form does not destroy it's handle anymore when modal finished).|
I don't think it has anything to do with the destruction of the modal form. (I do not think that the issue is new ,either)
The problem should be easy to make out, simply by looking at
- knowing that both async and idle will run in ShowModal
- knowing what LclRefCount is for
ReleaseComponents will be executed in Idle/Async as soon as there are components waiting to be released.
Normally idle/async only happens after the end of any message to any component (KeyDown).
But with a ModalForm being called from inside a KeyHandler this leads to an endless loop (as modal form runs it's own message loop)
Please look at the example in the IDE.
||Yes, you're right.|
I cannot reproduce this issue, probably because the Source Window Manager isn't a modal dialog anymore.
Martin, if you can create an example application to reproduce the issue, you can create a new issue so we can look into the problem.
Just happened again. Opening a project that is set to a target (OS/cpu) not supported by the installed fpc.
SourceNotebook is in an event / has refcount.
Modal dlg is called to inform about "target not supported" => endless attempts to free sourcenotebook in the modals event loop.
|2012-03-09 20:57||Martin Friebe||New Issue|
|2012-03-09 20:57||Martin Friebe||LazTarget||=> -|
|2012-03-09 22:10||Cyrax||Note Added: 0057453|
|2012-03-10 08:54||Zeljan Rikalo||Note Added: 0057456|
|2012-03-10 08:54||Zeljan Rikalo||Status||new => feedback|
|2012-03-10 11:58||Martin Friebe||Note Added: 0057457|
|2012-03-10 11:59||Martin Friebe||Note Edited: 0057457|
|2012-03-10 12:26||Zeljan Rikalo||Note Added: 0057460|
|2014-10-02 10:46||Vincent Snijders||Note Added: 0077879|
|2014-10-02 10:46||Vincent Snijders||Status||feedback => resolved|
|2014-10-02 10:46||Vincent Snijders||Resolution||open => unable to reproduce|
|2014-10-02 10:46||Vincent Snijders||Assigned To||=> Vincent Snijders|
|2019-04-22 19:33||Martin Friebe||Status||resolved => closed|
|2021-01-28 22:45||Martin Friebe||Assigned To||Vincent Snijders => Martin Friebe|
|2021-01-28 22:47||Martin Friebe||Status||closed => assigned|
|2021-01-28 22:47||Martin Friebe||Resolution||unable to reproduce => open|
|2021-01-28 22:47||Martin Friebe||Note Added: 0128647|
|2021-01-29 20:00||Martin Friebe||Status||assigned => resolved|
|2021-01-29 20:00||Martin Friebe||Resolution||open => fixed|
|2021-01-29 20:00||Martin Friebe||Fixed in Version||=> 2.2|
|2021-01-29 20:00||Martin Friebe||Fixed in Revision||=> 64435|
|2021-01-29 20:00||Martin Friebe||LazTarget||- => 2.2|