Found in OWLNext 7.0.19.
TApplication::Condemn: The last condemned window is not checked for double condemnation.
Example
TWindow* toCondemn = 0xdeadbeef;
TApplication::Condemn(toCondemn);
TApplication::Condemn(toCondemn);
TApplication::DeleteCondemned(); // gets stuck in infinite loop
First call to Condemn just sets TApplication::CondemnedWindows. Second call loops through all siblings to CondemnedWindows, but since there aren't any, it never enters the loop body and never checks for the already condemned window. So it sets toCondemn as sibling to itself, and any further iterations through this list will loop infinitely.
Proposal for fix: Check eol != win before calling eol->SetNext(win). This won't trigger the CHECK macro though, but it will keep the CondemnedWindows list intact.
--- a/owlnext/7.0.19/source/owlcore/applicat.cpp
+++ b/owlnext/7.0.19/source/owlcore/applicat.cpp
@@ -1271,7 +1271,8 @@ TApplication::Condemn(TWindow* win)
CHECK(!"Double condemn is not nice!");
return; //already condemned
}
- eol->SetNext(win);
+ if(eol!=win)
+ eol->SetNext(win);
}
else{
CondemnedWindows = win;
Diff:
Diff:
This ticket is a duplicate of ticket [bugs:#368] "The same TWindow object can be condemned more than once". Unfortunately, the fix [r3773] was incomplete, in that the last entry in the CondemnedWindows list was not checked, as pointed out by this ticket.
On further code review, there is another issue: If a double condemnation is detected, the next-pointer of the window has already been cleared, thereby truncating the list.
I propose the following fix for both issues:
Note that the code now WARNX rather than CHECK for double condemnation, since the issue is safely handled.
Please review.
Related
Bugs:
#368Commit: [r3773]
My proposed fix has now been committed on the trunk [r8588] and merged into branches 6.36, 6.44, 7 and Owlet [r8589].
(Edit: A regression has been fixed on the trunk [r8590] and branches [r8591].)
Please review.
Related
Commit: [r8588]
Commit: [r8589]
Commit: [r8590]
Commit: [r8591]
Last edit: Vidar Hasfjord 4 days ago
I did some testdriving with r8588/r8859 and experienced intermitting crashes in TWindow::RemoveChild() while condemning TWindow-Instances.
r8590/r8591 seem to fix this, Test cases now run smoothly and without incident.
@jprenz wrote:
Super! Thanks for testing and feedback, and thanks for reporting this issue.
Upcoming updates will include the fix.