Bug 81502

Summary: x86 GCC bug triggers a compilation error in generated copy constructor of CollapsedBorderValue
Product: WebKit Reporter: Levi Weintraub <leviw>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jamesr, ossy, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20ChromeOS/builds/27027/steps/compile/logs/stdio
Attachments:
Description Flags
A speculative fix
morrita: review+, morrita: commit-queue-
A speculative fix 2 (added a comment) none

Description Levi Weintraub 2012-03-19 01:40:58 PDT
When WebCore is built with the set of compilation flags used in the Google Chrome official builds, x86 gcc generates a broken copy constructor which results in the following failure:



In file included from third_party/WebKit/Source/JavaScriptCore/wtf/HashMap.h:24,
                 from third_party/WebKit/Source/WebCore/platform/KURL.h:31,
                 from third_party/WebKit/Source/WebCore/platform/network/BlobData.h:34,
                 from third_party/WebKit/Source/WebCore/fileapi/Blob.h:34,
                 from third_party/WebKit/Source/WebCore/fileapi/File.h:29,
                 from third_party/WebKit/Source/WebCore/platform/network/chromium/ResourceResponse.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/AuthenticationChallengeBase.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/chromium/AuthenticationChallenge.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/ResourceHandle.h:29,
                 from third_party/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:34,
                 from third_party/WebKit/Source/WebCore/loader/cache/CachedResource.h:30,
                 from third_party/WebKit/Source/WebCore/loader/cache/CachedImage.h:26,
                 from third_party/WebKit/Source/WebCore/rendering/RenderObject.h:29,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBoxModelObject.h:27,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBox.h:26,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBlock.h:29,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTable.h:30,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTableSection.h:28,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTableSection.cpp:27:
third_party/WebKit/Source/JavaScriptCore/wtf/HashTraits.h: In member function 'void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::rehash(int) [with Key = std::pair<const WebCore::RenderTableCell*, int>, Value = std::pair<std::pair<const WebCore::RenderTableCell*, int>, WebCore::CollapsedBorderValue>, Extractor = WTF::PairFirstExtractor<std::pair<std::pair<const WebCore::RenderTableCell*, int>, WebCore::CollapsedBorderValue> >, HashFunctions = WTF::PairHash<const WebCore::RenderTableCell*, int>, Traits = WTF::PairHashTraits<WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >, WTF::HashTraits<WebCore::CollapsedBorderValue> >, KeyTraits = WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >]':
third_party/WebKit/Source/JavaScriptCore/wtf/HashTraits.h:153: error: '__y' may be used uninitialized in this function
third_party/WebKit/Source/JavaScriptCore/wtf/HashTraits.h:153: note: '__y' was declared here
In file included from third_party/WebKit/Source/WebCore/platform/KURL.h:31,
                 from third_party/WebKit/Source/WebCore/platform/network/BlobData.h:34,
                 from third_party/WebKit/Source/WebCore/fileapi/Blob.h:34,
                 from third_party/WebKit/Source/WebCore/fileapi/File.h:29,
                 from third_party/WebKit/Source/WebCore/platform/network/chromium/ResourceResponse.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/AuthenticationChallengeBase.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/chromium/AuthenticationChallenge.h:30,
                 from third_party/WebKit/Source/WebCore/platform/network/ResourceHandle.h:29,
                 from third_party/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:34,
                 from third_party/WebKit/Source/WebCore/loader/cache/CachedResource.h:30,
                 from third_party/WebKit/Source/WebCore/loader/cache/CachedImage.h:26,
                 from third_party/WebKit/Source/WebCore/rendering/RenderObject.h:29,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBoxModelObject.h:27,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBox.h:26,
                 from third_party/WebKit/Source/WebCore/rendering/RenderBlock.h:29,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTable.h:30,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTableSection.h:28,
                 from third_party/WebKit/Source/WebCore/rendering/RenderTableSection.cpp:27:
third_party/WebKit/Source/WebCore/rendering/RenderTableSection.cpp: In member function 'std::pair<typename WTF::HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>::iterator, bool> WTF::HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>::set(const typename KeyTraitsArg::TraitType&, typename MappedTraitsArg::PassInType) [with KeyArg = std::pair<const WebCore::RenderTableCell*, int>, MappedArg = WebCore::CollapsedBorderValue, HashArg = WTF::PairHash<const WebCore::RenderTableCell*, int>, KeyTraitsArg = WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >, MappedTraitsArg = WTF::HashTraits<WebCore::CollapsedBorderValue>]':
third_party/WebKit/Source/WebCore/rendering/RenderTableSection.cpp:1424: error: '__y' may be used uninitialized in this function
third_party/WebKit/Source/JavaScriptCore/wtf/HashTraits.h:153: note: '__y' was declared here
make: *** [out/Release/obj.target/webcore_rendering/third_party/WebKit/Source/WebCore/rendering/RenderTableSection.o] Error 1
Comment 1 Hironori Bono 2012-03-19 02:19:30 PDT
Created attachment 132559 [details]
A speculative fix

Greetings,

It seems gcc (x86) somehow creates a broken copy constructor (used by HashSet<> in the RenderTableSection class) because the CollapsedBorderValue class does not have a copy constructor. This change adds a copy constructor to the CollapsedBorderValue class so GCC can use it. (The "Google Chrome Linux" bot can compile RenderTableSelection.cpp without errors when I locally applied this change: <ttp://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Linux/builds/18598>.)

Regards,

Hironori Bono
Comment 2 Hajime Morrita 2012-03-19 02:34:27 PDT
Comment on attachment 132559 [details]
A speculative fix

r=me. Having a link to this bug in the code will prevent this from accidental future removal.
Comment 3 Hironori Bono 2012-03-19 02:43:09 PDT
Created attachment 132563 [details]
A speculative fix 2 (added a comment)

Greetings Morita-san,

Thanks for your review and a comment. I have added a comment to the constructor.

Regards,

Hironori Bono
Comment 4 WebKit Review Bot 2012-03-19 03:34:46 PDT
Comment on attachment 132563 [details]
A speculative fix 2 (added a comment)

Clearing flags on attachment: 132563

Committed r111171: <http://trac.webkit.org/changeset/111171>
Comment 5 WebKit Review Bot 2012-03-19 03:34:50 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Tony Chang 2012-03-19 11:22:51 PDT
*** Bug 81498 has been marked as a duplicate of this bug. ***