Closed Bug 11674 Opened 25 years ago Closed 25 years ago

[infinite loop] bugs - nsViewManager.cpp

Categories

(Core :: Web Painting, defect, P3)

x86
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jay, Assigned: kmcclusk)

References

Details

Analysis of the code has determined possible infinite loop or problem in the code below. See bug http://bugzilla.mozilla.org/show_bug.cgi?id=11588 for more information nsViewManager.cpp:138: warning: unsigned value < 0 is always 0
Blocks: 11588
Assignee: michaelp → kipp
michealp -> kipp, cc hyatt and warren.
124 hyatt 3.103 nsViewManager :: ~nsViewManager() 125 kipp 1.1 { 126 michaelp 3.7 if (nsnull != mTimer) 127 { 128 mTimer->Cancel(); //XXX this should not be necessary. MMP 129 NS_RELEASE(mTimer); 130 } 131 132 kipp 1.1 NS_IF_RELEASE(mRootWindow); 133 134 michaelp 3.72 mRootScrollable = nsnull; 135 136 michaelp 3.33 --mVMCount; 137 138 NS_ASSERTION(!(mVMCount < 0), "underflow of viewmanagers"); 139 140 michaelp 3.72 if ((0 == mVMCount) && 141 ((nsnull != mDrawingSurface) || (nsnull != gOffScreen) || 142 (nsnull != gRed) || (nsnull != gBlue))) 143 kipp 1.1 { 144 nsIRenderingContext *rc; 145 146 warren 3.77 nsresult rv = nsComponentManager::CreateInstance(kRenderingContextCID, 147 kipp 1.1 nsnull, 148 kIRenderingContextIID, 149 (void **)&rc); 150
who can own this one?...
Assignee: kipp → beard
Patrick is now the owner of the view-manager code since michael left.
Status: NEW → ASSIGNED
No loop here, so assertion is harmless.
Severity: normal → trivial
Target Milestone: M15
beard...so is this Resolved/invalid?
I'm now seeing infinite loop on test #8, linux, apprunner & viewer. Break: at file nsViewManager.cpp, line 970 Assertion: "underflow" (!((PRInt32)pushcnt < 0)) at file nsViewManager.cpp, line 970 Break: at file nsViewManager.cpp, line 970 Assertion: "underflow" (!((PRInt32)pushcnt < 0)) at file nsViewManager.cpp, line 970 ...
This one is easy to fix. All we need to do is change static PRUint32 mVMCount; //number of viewmanagers in nsViewManager.h to static PRInt32 mVMCount; //number of viewmanagers We don't need the larger maximum value that PRUInt gives us.
Old bug - petersen, does this still occur for you?
QA Contact: leger → petersen
Reassigning all view bugs to kevin.
Assignee: beard → kmcclusk
Status: ASSIGNED → NEW
Component: Browser-General → Views
There really isn't an infinite loop here. I have a fix which will get rid of the warning.
Status: NEW → ASSIGNED
Fixed in 3/17/2000 build. Changed mVMCount from PRUint32 to PRInt32 to make ASSERTION checking for a negative value in mWMCount valid
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Marking verified per last comments.
Status: RESOLVED → VERIFIED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.