RESOLVED FIXED98629
[Chromium]Android x86 content shell debug build warning for uninitialized value used as error with gcc 4.6
https://bugs.webkit.org/show_bug.cgi?id=98629
Summary [Chromium]Android x86 content shell debug build warning for uninitialized val...
Wei James (wistoch)
Reported 2012-10-07 22:33:47 PDT
[Chromium]Debug build warning for uninitialized value used
Attachments
Patch (1.47 KB, patch)
2012-10-07 22:36 PDT, Wei James (wistoch)
no flags
Patch (1.46 KB, patch)
2012-10-07 22:47 PDT, Wei James (wistoch)
no flags
Patch (1.52 KB, patch)
2012-10-09 20:25 PDT, Wei James (wistoch)
no flags
Patch (1.53 KB, patch)
2012-10-09 22:16 PDT, Wei James (wistoch)
no flags
Wei James (wistoch)
Comment 1 2012-10-07 22:36:31 PDT
Wei James (wistoch)
Comment 2 2012-10-07 22:39:39 PDT
In file included from ../../third_party/WebKit/Source/WTF/wtf/HashSet.h:25:0, from ../../third_party/WebKit/Source/WTF/wtf/ListHashSet.h:25, from ../../third_party/WebKit/Source/WebCore/dom/DocumentStyleSheetCollection.h:32, from ../../third_party/WebKit/Source/WebCore/rendering/RenderObject.h:30, from ../../third_party/WebKit/Source/WebCore/rendering/RenderLayerModelObject.h:26, from ../../third_party/WebKit/Source/WebCore/rendering/RenderBoxModelObject.h:28, 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/WTF/wtf/HashFunctions.h: In member function 'void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ch pTranslator<WTF::HashMapValueTraits<WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >, WTF::HashTraits<WebCore::CollapsedBorderValue> >, WTF: T = std::pair<const WebCore::RenderTableCell*, int>, Key = std::pair<const WebCore::RenderTableCell*, int>, Value = WTF::KeyValuePair<std::pair<const WebCore alue>, Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<std::pair<const WebCore::RenderTableCell*, int>, WebCore::CollapsedBorderValue> >, HashFun ll*, int>, Traits = WTF::HashMapValueTraits<WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >, WTF::HashTraits<WebCore::CollapsedBorderValue> Core::RenderTableCell*, int> >]': ../../third_party/WebKit/Source/WTF/wtf/HashFunctions.h:158:115: error: 'deletedValueBuffer.WTF::KeyValuePair<std::pair<const WebCore::RenderTableCell*, int> onst WebCore::RenderTableCell*, int>::second' may be used uninitialized in this function [-Werror=uninitialized] ../../third_party/WebKit/Source/WTF/wtf/HashTable.h:589:67: note: 'deletedValueBuffer.WTF::KeyValuePair<std::pair<const WebCore::RenderTableCell*, int>, WebC ebCore::RenderTableCell*, int>::second' was declared here ../../third_party/WebKit/Source/WTF/wtf/HashFunctions.h: In member function 'void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::ch tyHashTranslator<WTF::PairHash<const WebCore::RenderTableCell*, int> >, T = std::pair<const WebCore::RenderTableCell*, int>, Key = std::pair<const WebCore::R d::pair<const WebCore::RenderTableCell*, int>, WebCore::CollapsedBorderValue>, Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<std::pair<const We rderValue> >, HashFunctions = WTF::PairHash<const WebCore::RenderTableCell*, int>, Traits = WTF::HashMapValueTraits<WTF::HashTraits<std::pair<const WebCore:: CollapsedBorderValue> >, KeyTraits = WTF::HashTraits<std::pair<const WebCore::RenderTableCell*, int> >]': ../../third_party/WebKit/Source/WTF/wtf/HashFunctions.h:158:115: error: 'deletedValueBuffer.WTF::KeyValuePair<std::pair<const WebCore::RenderTableCell*, int> onst WebCore::RenderTableCell*, int>::second' may be used uninitialized in this function [-Werror=uninitialized] ../../third_party/WebKit/Source/WTF/wtf/HashTable.h:589:67: note: 'deletedValueBuffer.WTF::KeyValuePair<std::pair<const WebCore::RenderTableCell*, int>, WebC ebCore::RenderTableCell*, int>::second' was declared here cc1plus: all warnings being treated as errors
Wei James (wistoch)
Comment 3 2012-10-07 22:47:44 PDT
Benjamin Poulain
Comment 4 2012-10-07 23:03:13 PDT
Comment on attachment 167509 [details] Patch memset is a bad idea performance wise for small data structures. I also don't see why this needs to be initialized outside it's trait's constructDeletedValue. Zeroing memory is not free.
Wei James (wistoch)
Comment 5 2012-10-09 20:21:40 PDT
(In reply to comment #4) > (From update of attachment 167509 [details]) > memset is a bad idea performance wise for small data structures. > > I also don't see why this needs to be initialized outside it's trait's constructDeletedValue. Zeroing memory is not free. benjamin, thanks for the review. further investigation shows that this building warning only appears in android x86 gcc 4.6 debug build. I can build it successfully with x86 gcc 4.4.3 and gcc 4.6 works well for arm platform. So i suspect it is an issue of x86 gcc instead of chromium code. So i added -Wno-uninitialized into cflags for webcore_rendering for andorid x86 with gcc 4.6. is it ok? thanks
Wei James (wistoch)
Comment 6 2012-10-09 20:25:02 PDT
Benjamin Poulain
Comment 7 2012-10-09 22:12:04 PDT
> So i suspect it is an issue of x86 gcc instead of chromium code. > > So i added -Wno-uninitialized into cflags for webcore_rendering for andorid x86 with gcc 4.6. > > is it ok? thanks Yes, it is ok. It is not the first time we have to workaround compiler bugs. You probably need to mention it is a compiler bug in the comment, otherwise it looks like you disable a warning instead of fixing the bug. This becomes a Chromium-Android fix, I am not the right person to accept this in the tree.
Wei James (wistoch)
Comment 8 2012-10-09 22:16:22 PDT
Wei James (wistoch)
Comment 9 2012-10-09 22:18:26 PDT
(In reply to comment #7) > > So i suspect it is an issue of x86 gcc instead of chromium code. > > > > So i added -Wno-uninitialized into cflags for webcore_rendering for andorid x86 with gcc 4.6. > > > > is it ok? thanks > > Yes, it is ok. > It is not the first time we have to workaround compiler bugs. You probably need to mention it is a compiler bug in the comment, otherwise it looks like you disable a warning instead of fixing the bug. > > This becomes a Chromium-Android fix, I am not the right person to accept this in the tree. thanks! abarth, peter, could you help to review it? it blocks the building of chromium android x86. thanks
Adam Barth
Comment 10 2012-10-10 10:35:30 PDT
Comment on attachment 167924 [details] Patch This seems fine to me.
WebKit Review Bot
Comment 11 2012-10-10 10:42:50 PDT
Comment on attachment 167924 [details] Patch Clearing flags on attachment: 167924 Committed r130925: <http://trac.webkit.org/changeset/130925>
WebKit Review Bot
Comment 12 2012-10-10 10:42:54 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.