Closed
Bug 1447405
Opened 7 years ago
Closed 7 years ago
Valgrind cries at nsFrame::ComputeSize in stylo-only builds.
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: emilio, Assigned: jseward)
References
Details
Attachments
(2 files)
1.82 KB,
patch
|
Details | Diff | Splinter Review | |
3.08 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
It's likely a false positive from the unconditional branches that get removed (it's likely to be optimized differently).
I'm going to land an expectation change pending further investigation sin Julian told me that he was working on updating Valgrind in the tree to catch more cases like these.
Reporter | ||
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Assignee: nobody → emilio
Attachment #8960723 -
Flags: review?(jseward)
Reporter | ||
Updated•7 years ago
|
Assignee: emilio → nobody
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e289c669eea2
Add a valgrind suppression on a CLOSED TREE. rpending=jseward
Reporter | ||
Comment 4•7 years ago
|
||
Comment on attachment 8960723 [details] [diff] [review]
Patch for the suppression.
Per IRC discussion this was indeed a false-positive, but the better fix is to initialize the relevant boolean in nsFrame::ComputeSize. Julian said he was looking into it.
Attachment #8960723 -
Flags: review?(jseward)
Assignee | ||
Comment 5•7 years ago
|
||
I believe this is happening because, in nsFrame::ComputeSize(), at the
following two places
5731
if (maxISizeCoord.GetUnit() != eStyleUnit_None &&
!(isFlexItem && usingFlexBasisForISize)) {
5742
if (minISizeCoord.GetUnit() != eStyleUnit_Auto &&
!(isFlexItem && usingFlexBasisForISize)) {
the subterm
(isFlexItem && usingFlexBasisForISize)
is compiled as
(usingFlexBasisForISize && isFlexItem)
This is correct (ignoring the performance effects) because the compiler can
see that isFlexItem is false when usingFlexBasisForISize is undefined. The
code preceding the conditionals has the structure
bool isFlexItem = parentFrame && parentFrame->IsFlexContainerFrame() &&
!parentFrame->HasAnyStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX) &&
!HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
..
bool usingFlexBasisForISize;
if (isFlexItem) {
..
usingFlexBasisForISize =
(flexContainerIsRowOriented == inlineAxisSameAsParent);
..
}
So after this point, either
isFlexItem is true and usingFlexBasisForISize is defined
or
isFlexItem is false and usingFlexBasisForISize is undefined.
Unfortunately the transformation causes a false warning from Memcheck,
because it assumes that every conditional branch in a program is
"important".
A simple "fix" is to initialise usingFlexBasisForISize to false so as to
keep Valgrind happy. We've added similar initialisations in Gecko a few
times in the past.
Assignee | ||
Comment 6•7 years ago
|
||
A simple fix.
Assignee | ||
Updated•7 years ago
|
Attachment #8960909 -
Flags: review?(emilio)
Comment 7•7 years ago
|
||
bugherder |
Reporter | ||
Comment 8•7 years ago
|
||
Comment on attachment 8960909 [details] [diff] [review]
bug1447405-nsFrame-inits-1.diff
Review of attachment 8960909 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, with the valgrind suppression removed from the tree too.
Thanks for looking into this!
Attachment #8960909 -
Flags: review?(emilio) → review+
Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed12db196ee9
Valgrind cries at nsFrame::ComputeSize in stylo-only builds. r=emilio.
Comment 10•7 years ago
|
||
bugherder |
Reporter | ||
Comment 13•7 years ago
|
||
Yeah, probably.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(nerli)
Keywords: leave-open
Resolution: --- → FIXED
Updated•7 years ago
|
Assignee: nobody → jseward
You need to log in
before you can comment on or make changes to this bug.
Description
•