nsRect::SaturatingUnionEdges() warnings about height and width exceeding nscoord_MAX (with gcc 4.6)

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
7 years ago
6 years ago

People

(Reporter: cpeterson, Unassigned)

Tracking

18 Branch
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
Starting today, I see tons of logcat warnings from nsRect::SaturatingUnionEdges() that an nsRect's height and width exceed nscoord_MAX (i.e. NS_IEEEPositiveInfinity()) when visiting https://support.mozilla.org/en-US/mobile

I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord width: file ../../dist/include/nsRect.h, line 128
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord height: file ../../dist/include/nsRect.h, line 141
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord height: file ../../dist/include/nsRect.h, line 141
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord width: file ../../dist/include/nsRect.h, line 128
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord height: file ../../dist/include/nsRect.h, line 141
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord width: file ../../dist/include/nsRect.h, line 128
I/Gecko   ( 4423): WARNING: Overflowed nscoord_MAX in conversion to nscoord height: file ../../dist/include/nsRect.h, line 141

I run optimized debug builds all the time and often use this website for testing. I have never seen these warnings before. I installed some debug builds from mozilla-inbound's tinderbox, but they did not log these warnings. I suspect the problem is that I just updated from Android NDK r5c (with gcc 4.4.3) to Mozilla's repackaged NDK r7c (with gcc 4.6.3).

Here is the stack trace from gdb. I could not get reliable values for the nsRect's overflowing values (because my build is optimized), but gdb claimed the nsRect's x, y, height, and width are all 0 (which seems unlikely).

(gdb) bt
#0  nsRect::SaturatingUnionEdges (this=0x5d5dcd00, aRect=...) at ../../dist/include/nsRect.h:128
#1  0x635d0204 in UnionEdges (aRect=<optimized out>, this=<optimized out>) at ../../dist/include/nsRect.h:158
#2  nsRect::UnionRectEdges (this=0x5d5dcd00, aRect1=<optimized out>, aRect2=<optimized out>) at ../../dist/include/nsRect.h:162
#3  0x635dd000 in nsIFrame::FinishAndStoreOverflow (this=0x659a9878, aOverflowAreas=..., aNewSize=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsFrame.cpp:6952
#4  0x635fa660 in nsLineLayout::RelativePositionFrames (this=0x5d5dd078, psd=0x60e560d0, aOverflowAreas=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsLineLayout.cpp:2
671
#5  0x635fa5f8 in nsLineLayout::RelativePositionFrames (this=0x5d5dd078, psd=0x60e56010, aOverflowAreas=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsLineLayout.cpp:2
658
#6  0x635bebbc in nsBlockFrame::PlaceLine (this=0x659a86a0, aState=..., aLineLayout=..., aLine=..., aFloatStateBeforeLine=0x5d5dd130, aFloatAvailableSpace=..., aAvailableSpaceHeight=@
0x5d5dd144, aKeepReflowGoing=0x5d5dd36f) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:4286
#7  0x635c098c in nsBlockFrame::DoReflowInlineFrames (this=0x659a86a0, aState=..., aLineLayout=..., aLine=..., aFloatAvailableSpace=..., aAvailableSpaceHeight=@0x5d5dd144, aFloatState
BeforeLine=0x5d5dd130, aKeepReflowGoing=0x5d5dd36f, aLineReflowStatus=0x5d5dd140, aAllowPullUp=true) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:3768
#8  0x635c0c42 in nsBlockFrame::ReflowInlineFrames (this=0x659a86a0, aState=..., aLine=..., aKeepReflowGoing=0x5d5dd36f) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBloc
kFrame.cpp:3487
#9  0x635c19a6 in nsBlockFrame::ReflowLine (this=0x659a86a0, aState=..., aLine=..., aKeepReflowGoing=0x5d5dd36f) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.c
pp:2571
#10 0x635c2018 in nsBlockFrame::ReflowDirtyLines (this=0x659a86a0, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:2021
#11 0x635c3ff2 in nsBlockFrame::Reflow (this=0x659a86a0, aPresContext=0x616d1400, aMetrics=..., aReflowState=<optimized out>, aStatus=@0x5d5dda58) at /Users/cpeterson/Code/mozilla/cen
tral/layout/generic/nsBlockFrame.cpp:1070
#12 0x635c4d1a in nsBlockReflowContext::ReflowBlock (this=0x5d5dd918, aSpace=<optimized out>, aApplyTopMargin=<optimized out>, aPrevMargin=<optimized out>, aClearance=0, aIsAdjacentWi
thTop=true, aLine=0x659a9ea8, aFrameRS=..., aFrameReflowStatus=@0x5d5dda58, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockReflowContext.cpp:268
#13 0x635c11ca in nsBlockFrame::ReflowBlockFrame (this=0x659a8350, aState=..., aLine=..., aKeepReflowGoing=0x5d5ddc87) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockF
rame.cpp:3208
#14 0x635c18e6 in nsBlockFrame::ReflowLine (this=0x659a8350, aState=..., aLine=..., aKeepReflowGoing=0x5d5ddc87) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.c
pp:2515
#15 0x635c2018 in nsBlockFrame::ReflowDirtyLines (this=0x659a8350, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:2021
#16 0x635c3ff2 in nsBlockFrame::Reflow (this=0x659a8350, aPresContext=0x616d1400, aMetrics=..., aReflowState=<optimized out>, aStatus=@0x5d5de370) at /Users/cpeterson/Code/mozilla/cen
tral/layout/generic/nsBlockFrame.cpp:1070
#17 0x635c4d1a in nsBlockReflowContext::ReflowBlock (this=0x5d5de230, aSpace=<optimized out>, aApplyTopMargin=<optimized out>, aPrevMargin=<optimized out>, aClearance=0, aIsAdjacentWi
thTop=false, aLine=0x659ad880, aFrameRS=..., aFrameReflowStatus=@0x5d5de370, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockReflowContext.cpp:268
#18 0x635c11ca in nsBlockFrame::ReflowBlockFrame (this=0x6594bbc8, aState=..., aLine=..., aKeepReflowGoing=0x5d5de59f) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockF
rame.cpp:3208
#19 0x635c18e6 in nsBlockFrame::ReflowLine (this=0x6594bbc8, aState=..., aLine=..., aKeepReflowGoing=0x5d5de59f) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.c
pp:2515
#20 0x635c2018 in nsBlockFrame::ReflowDirtyLines (this=0x6594bbc8, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:2021
#21 0x635c3ff2 in nsBlockFrame::Reflow (this=0x6594bbc8, aPresContext=0x616d1400, aMetrics=..., aReflowState=<optimized out>, aStatus=@0x5d5dec88) at /Users/cpeterson/Code/mozilla/cen
tral/layout/generic/nsBlockFrame.cpp:1070
#22 0x635c4d1a in nsBlockReflowContext::ReflowBlock (this=0x5d5deb48, aSpace=<optimized out>, aApplyTopMargin=<optimized out>, aPrevMargin=<optimized out>, aClearance=0, aIsAdjacentWi
thTop=true, aLine=0x65c31900, aFrameRS=..., aFrameReflowStatus=@0x5d5dec88, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockReflowContext.cpp:268
#23 0x635c11ca in nsBlockFrame::ReflowBlockFrame (this=0x6594b4b0, aState=..., aLine=..., aKeepReflowGoing=0x5d5deeb7) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockF
rame.cpp:3208
#24 0x635c18e6 in nsBlockFrame::ReflowLine (this=0x6594b4b0, aState=..., aLine=..., aKeepReflowGoing=0x5d5deeb7) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.c
pp:2515
#25 0x635c2018 in nsBlockFrame::ReflowDirtyLines (this=0x6594b4b0, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:2021
#26 0x635c3ff2 in nsBlockFrame::Reflow (this=0x6594b4b0, aPresContext=0x616d1400, aMetrics=..., aReflowState=<optimized out>, aStatus=@0x5d5df5a0) at /Users/cpeterson/Code/mozilla/cen
tral/layout/generic/nsBlockFrame.cpp:1070
#27 0x635c4d1a in nsBlockReflowContext::ReflowBlock (this=0x5d5df460, aSpace=<optimized out>, aApplyTopMargin=<optimized out>, aPrevMargin=<optimized out>, aClearance=0, aIsAdjacentWi
thTop=true, aLine=0x65c31990, aFrameRS=..., aFrameReflowStatus=@0x5d5df5a0, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockReflowContext.cpp:268
#28 0x635c11ca in nsBlockFrame::ReflowBlockFrame (this=0x62fa1e28, aState=..., aLine=..., aKeepReflowGoing=0x5d5df7cf) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockF
rame.cpp:3208
#29 0x635c18e6 in nsBlockFrame::ReflowLine (this=0x62fa1e28, aState=..., aLine=..., aKeepReflowGoing=0x5d5df7cf) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.c
pp:2515
#30 0x635c2018 in nsBlockFrame::ReflowDirtyLines (this=0x62fa1e28, aState=...) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsBlockFrame.cpp:2021
#31 0x635c3ff2 in nsBlockFrame::Reflow (this=0x62fa1e28, aPresContext=0x616d1400, aMetrics=..., aReflowState=<optimized out>, aStatus=@0x5d5dff1c) at /Users/cpeterson/Code/mozilla/cen
tral/layout/generic/nsBlockFrame.cpp:1070
#32 0x635caeba in nsContainerFrame::ReflowChild (this=<optimized out>, aKidFrame=0x62fa1e28, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aX=0, aY=0, aFlags=0, aStatus
=@0x5d5dff1c, aTracker=0x0) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsContainerFrame.cpp:947
#33 0x635ec2be in nsCanvasFrame::Reflow (this=0x62fa0f48, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aStatus=@0x5d5dff1c) at /Users/cpeterson/Code/mozilla/central/la
yout/generic/nsCanvasFrame.cpp:473
#34 0x635caeba in nsContainerFrame::ReflowChild (this=<optimized out>, aKidFrame=0x62fa0f48, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aX=0, aY=0, aFlags=3, aStatus
=@0x5d5dff1c, aTracker=0x0) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsContainerFrame.cpp:947
#35 0x635e399a in nsHTMLScrollFrame::ReflowScrolledFrame (this=0x62fa1118, aState=0x5d5e0024, aAssumeHScroll=<optimized out>, aAssumeVScroll=<optimized out>, aMetrics=0x5d5dff58, aFir
stPass=true) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsGfxScrollFrame.cpp:526
#36 0x635e50ea in nsHTMLScrollFrame::ReflowContents (this=0x62fa1118, aState=0x5d5e0024, aDesiredSize=<optimized out>) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsGfxScr
ollFrame.cpp:624
#37 0x635e8188 in nsHTMLScrollFrame::Reflow (this=0x62fa1118, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aStatus=@0x5d5e05dc) at /Users/cpeterson/Code/mozilla/centra
l/layout/generic/nsGfxScrollFrame.cpp:865
#38 0x635caeba in nsContainerFrame::ReflowChild (this=<optimized out>, aKidFrame=0x62fa1118, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aX=0, aY=0, aFlags=0, aStatus
=@0x5d5e05dc, aTracker=0x0) at /Users/cpeterson/Code/mozilla/central/layout/generic/nsContainerFrame.cpp:947
#39 0x6361fcd4 in ViewportFrame::Reflow (this=0x62fa07f8, aPresContext=0x616d1400, aDesiredSize=..., aReflowState=..., aStatus=@0x5d5e05dc) at /Users/cpeterson/Code/mozilla/central/la
yout/generic/nsViewportFrame.cpp:201
#40 0x6359565e in PresShell::DoReflow (this=0x60498780, target=0x62fa07f8, aInterruptible=<optimized out>) at /Users/cpeterson/Code/mozilla/central/layout/base/nsPresShell.cpp:7353
#41 0x635975d6 in PresShell::ProcessReflowCommands (this=0x60498780, aInterruptible=<optimized out>) at /Users/cpeterson/Code/mozilla/central/layout/base/nsPresShell.cpp:7499
#42 0x6359794a in PresShell::FlushPendingNotifications (this=0x60498780, aType=Flush_InterruptibleLayout) at /Users/cpeterson/Code/mozilla/central/layout/base/nsPresShell.cpp:3829
#43 0x6359d6aa in nsRefreshDriver::Notify (this=0x60498660, aTimer=<optimized out>) at /Users/cpeterson/Code/mozilla/central/layout/base/nsRefreshDriver.cpp:398
#44 0x63ff035a in nsTimerImpl::Fire (this=0x65946060) at /Users/cpeterson/Code/mozilla/central/xpcom/threads/nsTimerImpl.cpp:476
#45 0x63ff0508 in nsTimerEvent::Run (this=0x5e789080) at /Users/cpeterson/Code/mozilla/central/xpcom/threads/nsTimerImpl.cpp:556
#46 0x63fec54a in nsThread::ProcessNextEvent (this=0x5e7511d0, mayWait=<optimized out>, result=0x5d5e08b7) at /Users/cpeterson/Code/mozilla/central/xpcom/threads/nsThread.cpp:612
#47 0x63fb7f6e in NS_ProcessNextEvent_P (thread=0x5e7511d0, mayWait=<optimized out>) at /Users/cpeterson/Code/mozilla/central/OBJDIR-ANDROID/xpcom/build/nsThreadUtils.cpp:220
#48 0x63e8c502 in mozilla::ipc::MessagePump::Run (this=0x5e7532b0, aDelegate=0x5e77f0e0) at /Users/cpeterson/Code/mozilla/central/ipc/glue/MessagePump.cpp:82
#49 0x6401aeb2 in MessageLoop::RunInternal (this=0x5e77f0e0) at /Users/cpeterson/Code/mozilla/central/ipc/chromium/src/base/message_loop.cc:208
#50 0x6401af10 in RunHandler (this=0x5e77f0e0) at /Users/cpeterson/Code/mozilla/central/ipc/chromium/src/base/message_loop.cc:201
#51 MessageLoop::Run (this=0x5e77f0e0) at /Users/cpeterson/Code/mozilla/central/ipc/chromium/src/base/message_loop.cc:175
#52 0x63de190a in nsBaseAppShell::Run (this=0x5e762700) at /Users/cpeterson/Code/mozilla/central/widget/xpwidgets/nsBaseAppShell.cpp:163
#53 0x63cac5d8 in nsAppStartup::Run (this=0x604c9970) at /Users/cpeterson/Code/mozilla/central/toolkit/components/startup/nsAppStartup.cpp:290
#54 0x633eff1a in XREMain::XRE_mainRun (this=0x5d5e0ae4) at /Users/cpeterson/Code/mozilla/central/toolkit/xre/nsAppRunner.cpp:3782
#55 0x633f1636 in XREMain::XRE_main (this=0x5d5e0ae4, argc=<optimized out>, argv=0x5e76b048, aAppData=<optimized out>) at /Users/cpeterson/Code/mozilla/central/toolkit/xre/nsAppRunner
.cpp:3848
#56 0x633f1792 in XRE_main (argc=7, argv=0x5e76b048, aAppData=0x5ab9eca4, aFlags=<optimized out>) at /Users/cpeterson/Code/mozilla/central/toolkit/xre/nsAppRunner.cpp:3923
#57 0x633f7210 in GeckoStart (data=0x59c73b70, appData=0x5ab9eca4) at /Users/cpeterson/Code/mozilla/central/toolkit/xre/nsAndroidStartup.cpp:73
#58 0x5ab84fec in Java_org_mozilla_gecko_GeckoAppShell_nativeRun (jenv=0x5bfcaea0, jc=<optimized out>, jargs=0x25e00005) at /Users/cpeterson/Code/mozilla/central/mozglue/android/APKOp
en.cpp:983
#59 0x4074ee34 in dvmPlatformInvoke () from /Users/cpeterson/Code/mozilla/jimdb/lib/014691061901701A/system/lib/libdvm.so
#60 0x4077e086 in dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/cpeterson/Code/mozilla/jimdb/lib/014691061901701A/system/lib/libdvm.so
#61 0x407801a0 in dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/cpeterson/Code/mozilla/jimdb/lib/014691061901701A/system/lib/libdvm.so
#62 0x40758264 in dvmJitToInterpNoChain () from /Users/cpeterson/Code/mozilla/jimdb/lib/014691061901701A/system/lib/libdvm.so
#63 0x40758264 in dvmJitToInterpNoChain () from /Users/cpeterson/Code/mozilla/jimdb/lib/014691061901701A/system/lib/libdvm.so
(Reporter)

Comment 1

7 years ago
I rebuilt with NDK r5c's gcc 4.4.3 and these nscoord_MAX warnings went away. gcc 4.6 seems to be optimizing this floating point code differently.
Summary: nsRect::SaturatingUnionEdges() warnings about height and width exceeding nscoord_MAX (with gcc 4.6?) → nsRect::SaturatingUnionEdges() warnings about height and width exceeding nscoord_MAX (with gcc 4.6)
I see this all the time too, it's been happening for a few weeks. I similarly tried bisecting debug builds from inbound but didn't see it there. It didn't occur to me that it would related to the GCC version but that makes sense because I'm also using gcc 4.6.3 in the mozilla-repackaged NDK.

Also bug 782182 is a duplicate of this.
Can someone check this again? I used a recent debug/non-optimized build (built with gcc 4.6) and haven't seen this warning.
True, I also have not been seeing it since I switched to the stock r8c NDK, but I think I was still seeing it when I used the mozilla-repackaged NDK a couple of weeks ago. WFMing, and I will update the wiki page to no longer recommend the mozilla-repackaged NDK. See also my last few comments on bug 769099.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.