Closed Bug 387414 Opened 18 years ago Closed 17 years ago

Firefox hangs with 100% CPU on View Page Source / Wrap Long Lines

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: mak, Assigned: roc)

References

Details

(Keywords: hang)

Attachments

(2 files)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a7pre) Gecko/2007070912 Minefield/3.0a7pre Browser hangs on unchecking Wrap Long Lines in View Source 1. Navigate to a website (http://www.mozilla.org/projects/minefield/) 2. From context menu choose View Page Source 3. In The source window menu check View / Wrap Long Lines 4. long lines are wrapped 5. Again: In The source window menu uncheck View / Wrap Long Lines 6. cpu goes to 100% and browser hangs i can reproduce this every time
I can confirm, but ONLY with syntax highlighting off.
i can reproduce with sintax hilighting on or off, does not make difference on my system
yes, i can only reproduce the hang when i turn off syntax highlighting.
Flags: blocking-firefox3?
Keywords: hang
(In reply to comment #2) > i can reproduce with sintax hilighting on or off, does not make difference on > my system > The same here.
Happens with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a7pre) Gecko/200707110202 SeaMonkey/2.0a1pre, too.
Flags: blocking-firefox3? → blocking-firefox3+
Target Milestone: --- → Firefox 3 M9
I am not 100% sure it is useful but as the symptoms are the same in SeaMonkey on OS/2 I think this is relevant. I ran a SeaMonkey OS/2 debug build of the current trunk and got the following three assertions _many_ times, after a while it ends in an NS_ABORT: ###!!! ASSERTION: Invalid offset: 'aOffset <= mSkipChars->mCharCount', file <path>/gfx/thebes/src/gfxSkipChars.cpp, line 92 ###!!! ASSERTION: redo line on totally empty line: 'aState.IsImpactedByFloat()', file <path>/layout/generic/nsBlockFrame.cpp, line 3428 ###!!! ASSERTION: unconstrained height on totally empty line: 'NS_UNCONSTRAINEDSIZE != aState.mAvailSpaceRect.height', file <path>/layout/generic/nsBlockFrame.cpp, line 3430 [...] ###!!! ASSERTION: Invalid offset: 'aOffset <= mSkipChars->mCharCount', file <path>/gfx/thebes/src/gfxSkipChars.cpp, line 92 ###!!! ASSERTION: redo line on totally empty line: 'aState.IsImpactedByFloat()', file <path>/layout/generic/nsBlockFrame.cpp, line 3428 ###!!! ASSERTION: unconstrained height on totally empty line: 'NS_UNCONSTRAINEDSIZE != aState.mAvailSpaceRect.height', file <path>/layout/generic/nsBlockFrame.cpp, line 3430 Block(pre)(0)@0x221325f4: yikes! spinning on a line over 1000 times! ###!!! ABORT: file <path>/layout/generic/nsBlockFrame.cpp, line 3211
I see this on Linux as well, this is likely caused by the textframe changes in bug 367177 (need to check regression range to be sure). See also bug 387058, which is about some of the same assertions.
Blocks: 367177
OS: Windows XP → All
Hardware: PC → All
Assignee: nobody → roc
Component: View Source → Layout: Fonts and Text
Flags: blocking-firefox3+
Product: Firefox → Core
Target Milestone: Firefox 3 M9 → ---
marking blocking-1.9 because it was blocking firefox3
Flags: blocking1.9+
QA Contact: view.source → layout.fonts-and-text
Attached file simplified testcase
Here's what happens: -- we reflow the text with -moz-pre-wrap first. This produces three frames: "Hello", "\n", "Kitty" -- the style changes to pre. We reconstruct text runs, and assign one run to the first line "Hello\n", and another run to the second line "Kitty". -- we reflow the first frame. It gets the text "Hello\n". -- we reflow the second frame. It gets no text at all because its text run has no text left in it. This is incorrect and eventually leads to assertions and an abort. We could try to make textrun construction avoid stopping at preformatted \n when there are more frames than necessary mapping the text up to the \n, but that's expensive to check --- it could require checking of all the text in a large plain text page. So it's probably better to detect situations where a text frame's text run is insufficiently long to reflow the text in the frame, and reconstruct the text run in that case.
Attached patch fixSplinter Review
As described in the above comment. We detect when we're at the end of the textrun and recover by recreating our textrun.
Attachment #283286 - Flags: review?(smontagu)
Attachment #283286 - Flags: review?(smontagu) → review+
Checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
Verified fixed in Minefield/3.0a9pre ID:2007101214
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: