Bug 81502 - x86 GCC bug triggers a compilation error in generated copy constructor of CollapsedBorderValue
Summary: x86 GCC bug triggers a compilation error in generated copy constructor of Col...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://build.chromium.org/p/chromium....
Keywords:
: 81498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-19 01:40 PDT by Levi Weintraub
Modified: 2012-03-19 11:22 PDT (History)
3 users (show)

See Also:


Attachments
A speculative fix (1.47 KB, patch)
2012-03-19 02:19 PDT, Hironori Bono
morrita: review+
morrita: commit-queue-
Details | Formatted Diff | Diff
A speculative fix 2 (added a comment) (1.61 KB, patch)
2012-03-19 02:43 PDT, Hironori Bono
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***