Bug 16414 - Valgrind: Conditional jump or move depends on uninitialised value(s)
Summary: Valgrind: Conditional jump or move depends on uninitialised value(s)
Status: RESOLVED DUPLICATE of bug 13864
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2007-12-12 12:55 PST by David Carson
Modified: 2007-12-12 23:50 PST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David Carson 2007-12-12 12:55:57 PST
Valgrind reports:

==3471== Conditional jump or move depends on uninitialised value(s)
==3471==    at 0x1074003D: WebCore::RenderBlock::calcInlinePrefWidths()
==3471==    by 0x107404C7: WebCore::RenderBlock::calcPrefWidths()
==3471==    by 0x10752D58: WebCore::RenderBox::minPrefWidth() const
==3471==    by 0x107577ED:
WebCore::RenderBox::calcWidthUsing(WebCore::WidthType, int)

The Codes:

               // Determine if we have a breakable character.  Pass in
               // whether or not we should ignore any spaces at the front
               // of the string.  If those are going to be stripped out,
               // then they shouldn't be considered in the breakable char
               // check.
               bool hasBreakableChar, hasBreak;
               int beginMin, endMin;
               bool beginWS, endWS;
               int beginMax, endMax;
               t->trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS,
                                    hasBreakableChar, hasBreak, beginMax, endMax,
                                    childMin, childMax, stripFrontSpaces);

               // This text object will not be rendered, but it may still provide a breaking opportunity.
               if (!hasBreak && childMax == 0) {
3755:                if (autoWrap && (beginWS || endWS)) {
                       m_minPrefWidth = max(inlineMin, m_minPrefWidth);
                       inlineMin = 0;

and trimmedPrefWidths.cpp, which is passed references to these bools:

   int len = textLength();
   if (!len || (stripFrontSpaces && m_text->containsOnlyWhitespace())) {
       maxW = 0;
       hasBreak = false;

   minW = m_minWidth;
   maxW = m_maxWidth;
   beginWS = !stripFrontSpaces && m_hasBeginWS;
   endWS = m_hasEndWS;

My guess is that trimmedPrefWidths is returning without setting the
beginWS and endWS bools.  These are then used on line 3755.  They should
probably be set to something before the call to trimmedPrefWidths.
Setting both to false seems to solve the problem.
Comment 1 mitz 2007-12-12 23:50:59 PST

*** This bug has been marked as a duplicate of 13864 ***