[Webkit-unassigned] [Bug 53285] New: CSS styles are shared based on uninitialized property values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 28 00:38:06 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=53285

           Summary: CSS styles are shared based on uninitialized property
                    values
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eugenis at chromium.org


Running Chromium trunk (WebKit r75250) under Valgrind gives the following report:

==32232== Conditional jump or move depends on uninitialised value(s)
==32232==    at 0x4C2CF49: bcmp (mc_replace_strmem.c:567)
==32232==    by 0x1941835: WTF::VectorComparer<true, WebCore::CSSProperty>::compare(WebCore::CSSP
roperty const*, WebCore::CSSProperty const*, unsigned long) (Vector.h:236)
==32232==    by 0x1941845: WTF::VectorTypeOperations<WebCore::CSSProperty>::compare(WebCore::CSSP
roperty const*, WebCore::CSSProperty const*, unsigned long) (Vector.h:275)
==32232==    by 0x194189F: bool WTF::operator==<WebCore::CSSProperty, 4ul>(WTF::Vector<WebCore::C
SSProperty, 4ul> const&, WTF::Vector<WebCore::CSSProperty, 4ul> const&) (Vector.h:1136)
==32232==    by 0x19418BE: WebCore::CSSMutableStyleDeclaration::propertiesEqual(WebCore::CSSMutab
leStyleDeclaration const*) const (CSSMutableStyleDeclaration.h:139)
==32232==    by 0x1941970: WebCore::NamedNodeMap::mappedMapsEquivalent(WebCore::NamedNodeMap const*) const (NamedNodeMap.cpp:362)
==32232==    by 0x18EE75F: WebCore::CSSStyleSelector::canShareStyleWithElement(WebCore::Node*) const (CSSStyleSelector.cpp:1105)
==32232==    by 0x18EE86B: WebCore::CSSStyleSelector::findSiblingForStyleSharing(WebCore::Node*, unsigned int&) const (CSSStyleSelector.cpp:1124)
==32232==    by 0x18F0C6A: WebCore::CSSStyleSelector::styleForElement(WebCore::Element*, WebCore::RenderStyle*, bool, bool, bool) (CSSStyleSelector.cpp:1147)
==32232==    by 0x194F44B: WebCore::Node::styleForRenderer() (Node.cpp:1411)
==32232==    by 0x194F545: WebCore::Node::createRendererIfNeeded() (Node.cpp:1388)
==32232==    by 0x19361CC: WebCore::Element::attach() (Element.cpp:919)
==32232==  Uninitialised value was created by a heap allocation
==32232==    at 0x4C281FB: malloc (vg_replace_malloc.c:904)
==32232==    by 0x175AF7F: WTF::fastMalloc(unsigned long) (FastMalloc.cpp:250)
==32232==    by 0x15B5D08: WTF::RefCounted<WebCore::StyleBase>::operator new(unsigned long) (RefCounted.h:136)
==32232==    by 0x19681D1: WebCore::CSSMappedAttributeDeclaration::create() (CSSMappedAttributeDeclaration.h:38)
==32232==    by 0x19682A4: WebCore::StyledElement::createMappedDecl(WebCore::Attribute*) (StyledElement.cpp:403)
==32232==    by 0x19684B5: WebCore::StyledElement::addCSSProperty(WebCore::Attribute*, int, int) (StyledElement.cpp:281)
==32232==    by 0x15A4448: WebCore::HTMLElement::addHTMLAlignmentToStyledElement(WebCore::StyledElement*, WebCore::Attribute*) (HTMLElement.cpp:648)
==32232==    by 0x15A4478: WebCore::HTMLElement::addHTMLAlignment(WebCore::Attribute*) (HTMLElement.cpp:612)
==32232==    by 0x15FD0BB: WebCore::HTMLImageElement::parseMappedAttribute(WebCore::Attribute*) (HTMLImageElement.cpp:127)
==32232==    by 0x1969844: WebCore::StyledElement::attributeChanged(WebCore::Attribute*, bool) (StyledElement.cpp:187)
==32232==    by 0x19370FB: WebCore::Element::setAttributeMap(WTF::PassRefPtr<WebCore::NamedNodeMap>, WebCore::FragmentScriptingPermission) (Element.cpp:780)
==32232==    by 0x161FD67: WebCore::HTMLConstructionSite::createHTMLElement(WebCore::AtomicHTMLToken&) (HTMLConstructionSite.cpp:344)

It looks like CSSMutableStyleDeclaration::m_properties can sometimes be left uninitialized and later used to decide whether to share styles between elements.

This is also filed as a Chromium bug: http://code.google.com/p/chromium/issues/detail?id=70599

I don't have a simple reproducer, but I can test patches if needed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list