Leak nsLineList with -moz-column

RESOLVED FIXED in mozilla1.9.3a1

Status

()

RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: jruderman, Assigned: tnikkel)

Tracking

({memory-leak, testcase, valgrind})

Trunk
mozilla1.9.3a1
x86
Mac OS X
memory-leak, testcase, valgrind
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
Created attachment 384338 [details]
testcase

This testcase might just be a reduction of layout/base/crashtests/423107-1.xhtml.

valgrind 
    --leak-check=full
    --auto-run-dsymutil=yes
    --track-origins=yes 
    ~/central/debug-obj/dist/MinefieldDebug.app/Contents/MacOS/firefox-bin 
    -P vgrind b1.html 

8 bytes in 1 blocks are definitely lost in loss record 118 of 1,965
   at 0x12B7F: operator new(unsigned long) (vg_replace_malloc.c:218)
   by 0x21B97429: nsBlockFrame::PushLines(nsBlockReflowState&, nsLineList_iterator) (nsBlockFrame.cpp:4292)
   by 0x21B97D9C: nsBlockFrame::PlaceLine(nsBlockReflowState&, nsLineLayout&, nsLineList_iterator, nsFloatManager::SavedState*, nsRect&, int&, int*) (nsBlockFrame.cpp:4192)
   by 0x21B9A703: nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState&, nsLineLayout&, nsLineList_iterator, nsFlowAreaRect&, int&, nsFloatManager::SavedState*, int*, LineReflowStatus*, int) (nsBlockFrame.cpp:3663)
   by 0x21B9A923: nsBlockFrame::ReflowInlineFrames(nsBlockReflowState&, nsLineList_iterator, int*) (nsBlockFrame.cpp:3378)
   by 0x21B9AEE9: nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, int*) (nsBlockFrame.cpp:2422)
   by 0x21B9B73F: nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) (nsBlockFrame.cpp:1919)
   by 0x21B9EB50: nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) (nsBlockFrame.cpp:958)
   by 0x21BADE3C: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) (nsContainerFrame.cpp:825)
   by 0x21BAAFF9: nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, int, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) (nsColumnSetFrame.cpp:669)
   by 0x21BABEBD: nsColumnSetFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) (nsColumnSetFrame.cpp:1030)
   by 0x21BA2914: nsBlockReflowContext::ReflowBlock(nsRect const&, int, nsCollapsingMargin&, int, int, nsLineBox*, nsHTMLReflowState&, unsigned int&, nsBlockReflowState&) (nsBlockReflowContext.cpp:310)
(Reporter)

Updated

10 years ago
Blocks: 499611
(Reporter)

Comment 1

10 years ago
The patch in bug 499611 lets trace-refcnt detect this leak, in case you don't want to use valgrind ;)
(Assignee)

Comment 2

9 years ago
Created attachment 398911 [details] [diff] [review]
patch

This is based on top of the patch in bug 514634, not because they are related, but because they coincidentally change code right next to each other.
Assignee: nobody → tnikkel
Attachment #398911 - Flags: review?(fantasai.bugs)

Comment 3

9 years ago
Comment on attachment 398911 [details] [diff] [review]
patch

I'd like dbaron to do an sr here, to make sure this is the right approach to the problem and some kind of api refactoring isn't wanted. Looks good otherwise.
Attachment #398911 - Flags: superreview?(dbaron)
Attachment #398911 - Flags: review?(fantasai.bugs)
Attachment #398911 - Flags: review+
Comment on attachment 398911 [details] [diff] [review]
patch

sr=dbaron

In theory (and to match the C++ standard library's list<T>, after which it is modeled) nsLineList::erase should call the line box's destructor (as should pop_front, pop_back, and clear).  However, nsLineBox doesn't have a useful destructor; it has a destroy method that takes a pres shell argument, which makes that a good bit harder.  So this is ok, at least for now.
Attachment #398911 - Flags: superreview?(dbaron) → superreview+
(Assignee)

Comment 5

9 years ago
http://hg.mozilla.org/mozilla-central/rev/21d443acefc5
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
(Assignee)

Comment 6

9 years ago
(In reply to comment #4)
> In theory (and to match the C++ standard library's list<T>, after which it is
> modeled) nsLineList::erase should call the line box's destructor ...

I'm confused, this bug is about leaking nsLineList itself, not any of the nodes it contains. So I don't understand how your comment applies here.
You need to log in before you can comment on or make changes to this bug.