<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>188893</bug_id>
          
          <creation_ts>2018-08-23 11:32:08 -0700</creation_ts>
          <short_desc>REGRESSION(r234879): Hundreds of layout tests are timing out in WinCairo Debug</short_desc>
          <delta_ts>2018-09-10 17:57:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=188582</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Kirsling">ross.kirsling</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>fujii</cc>
    
    <cc>saam</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1453140</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2018-08-23 11:32:08 -0700</bug_when>
    <thetext>Hundreds of layout tests are timing out in WinCairo Debug since Bug 188582.

Not sure of the root cause yet, but reverting HashTable.h:840 does make the timeouts go away:
https://github.com/WebKit/webkit/commit/c17c5e21de940574a5ed795c9a9b7431680fdb14#diff-09bcabb3919151180e9d2bfc7f97dc56</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453316</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2018-08-23 16:51:15 -0700</bug_when>
    <thetext>Still digging, but two more points for now...

Commenting out this function also makes the problem go away.
https://github.com/WebKit/webkit/blob/master/Source/WTF/wtf/HashTraits.h#L317-L322
&gt; template &lt;typename&gt;
&gt; static void constructEmptyValue(TraitType&amp; slot)
&gt; {
&gt;    KeyTraits::template constructEmptyValue&lt;KeyTraits&gt;(slot.key);
&gt;    ValueTraits::template constructEmptyValue&lt;ValueTraits&gt;(slot.value);
&gt; }

The failing tests don&apos;t seem to be random, but calling DRT directly doesn&apos;t seem to repro(?).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453393</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-23 22:36:14 -0700</bug_when>
    <thetext>I can reproduce with a following command.

&gt; python ./Tools/Scripts/run-webkit-tests --debug --wincairo --dump-render-tree --no-new-test-results --no-retry-failures --no-timeout  css1/basic/class_as_selector.html

It never exit this loop.

https://github.com/WebKit/webkit/blob/c17c5e21de940574a5ed795c9a9b7431680fdb14/Source/WTF/wtf/HashTable.h#L892

Callstack:

&gt; WebKit.dll!WTF::HashTable&lt;WebCore::Color,WTF::KeyValuePair&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt;,WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt; &gt;,WTF::ColorHash,WTF::HashMap&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt;,WTF::ColorHash,WTF::HashTraits&lt;WebCore::Color&gt;,WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt; &gt;::KeyValuePairTraits,WTF::HashTraits&lt;WebCore::Color&gt; &gt;::add&lt;WTF::HashMapEnsureTranslator&lt;WTF::HashMap&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt;,WTF::ColorHash,WTF::HashTraits&lt;WebCore::Color&gt;,WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt; &gt;::KeyValuePairTraits,WTF::ColorHash&gt;,WebCore::Color const &amp;,WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &gt;(const WebCore::Color &amp; key, WebCore::CSSValuePool::createColorValue::__l2::WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &amp;&amp; extra) Line 892	C++
&gt; WebKit.dll!WTF::HashMap&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt;,WTF::ColorHash,WTF::HashTraits&lt;WebCore::Color&gt;,WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt; &gt;::inlineEnsure&lt;WebCore::Color const &amp;,WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &gt;(const WebCore::Color &amp; key, WebCore::CSSValuePool::createColorValue::__l2::WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &amp;&amp; functor) Line 353	C++
&gt; WebKit.dll!WTF::HashMap&lt;WebCore::Color,WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt;,WTF::ColorHash,WTF::HashTraits&lt;WebCore::Color&gt;,WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &gt; &gt;::ensure&lt;WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &gt;(const WebCore::Color &amp; key, WebCore::CSSValuePool::createColorValue::__l2::WTF::Ref&lt;WebCore::CSSPrimitiveValue,WTF::DumbPtrTraits&lt;WebCore::CSSPrimitiveValue&gt; &gt; &lt;lambda&gt;(void) &amp;&amp; functor) Line 409	C++
&gt; WebKit.dll!WebCore::CSSValuePool::createColorValue(const WebCore::Color &amp; color) Line 92	C++
&gt; WebKit.dll!WebCore::HTMLElement::addHTMLColorToStyle(WebCore::MutableStyleProperties &amp; style, WebCore::CSSPropertyID propertyID, const WTF::String &amp; attributeValue) Line 1024	C++
&gt; WebKit.dll!WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute(const WebCore::QualifiedName &amp; name, const WTF::AtomicString &amp; value, WebCore::MutableStyleProperties &amp; style) Line 54	C++
&gt; WebKit.dll!WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute(const WebCore::QualifiedName &amp; name, const WTF::AtomicString &amp; value, WebCore::MutableStyleProperties &amp; style) Line 118	C++
&gt; WebKit.dll!WebCore::StyledElement::rebuildPresentationAttributeStyle() Line 239	C++
&gt; WebKit.dll!WebCore::StyledElement::presentationAttributeStyle() Line 97	C++
&gt; WebKit.dll!WebCore::ElementRuleCollector::matchAllRules(bool matchAuthorAndUserStyles, bool includeSMILProperties) Line 510	C++
&gt; WebKit.dll!WebCore::StyleResolver::styleForElement(const WebCore::Element &amp; element, const WebCore::RenderStyle * parentStyle, const WebCore::RenderStyle * parentBoxStyle, WebCore::RuleMatchingBehavior matchingBehavior, const WebCore::SelectorFilter * selectorFilter) Line 386	C++
&gt; WebKit.dll!WebCore::Style::TreeResolver::styleForElement(WebCore::Element &amp; element, const WebCore::RenderStyle &amp; inheritedStyle) Line 133	C++
&gt; WebKit.dll!WebCore::Style::TreeResolver::resolveElement(WebCore::Element &amp; element) Line 203	C++
&gt; WebKit.dll!WebCore::Style::TreeResolver::resolveComposedTree() Line 500	C++
&gt; WebKit.dll!WebCore::Style::TreeResolver::resolve() Line 558	C++
&gt; WebKit.dll!WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType type) Line 1856	C++
&gt; WebKit.dll!WebCore::Document::updateStyleIfNeeded() Line 1973	C++
&gt; WebKit.dll!WebCore::Document::implicitClose() Line 2884	C++
&gt; WebKit.dll!WebCore::FrameLoader::checkCallImplicitClose() Line 957	C++
&gt; WebKit.dll!WebCore::FrameLoader::checkCompleted() Line 899	C++
&gt; WebKit.dll!WebCore::FrameLoader::loadDone(WebCore::LoadCompletionType type) Line 800	C++
&gt; WebKit.dll!WebCore::CachedResourceLoader::loadDone(WebCore::LoadCompletionType type, bool shouldPerformPostLoadActions) Line 1317	C++
&gt; WebKit.dll!WebCore::SubresourceLoader::notifyDone(WebCore::LoadCompletionType type) Line 743	C++
&gt; WebKit.dll!WebCore::SubresourceLoader::didFinishLoading(const WebCore::NetworkLoadMetrics &amp; networkLoadMetrics) Line 644	C++
&gt; WebKit.dll!WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle * __formal) Line 683	C++
&gt; WebKit.dll!WebCore::CurlResourceHandleDelegate::curlDidComplete(WebCore::CurlRequest &amp; request) Line 171	C++
&gt; WebKit.dll!WebCore::CurlRequest::didCompleteTransfer::__l11::&lt;lambda&gt;(WebCore::CurlRequest &amp; request, WebCore::CurlRequestClient &amp; client) Line 411	C++
&gt; WebKit.dll!WTF::Function&lt;void __cdecl(WebCore::CurlRequest &amp;,WebCore::CurlRequestClient &amp;)&gt;::CallableWrapper&lt;void &lt;lambda&gt;(WebCore::CurlRequest &amp;, WebCore::CurlRequestClient &amp;) &gt;::call(WebCore::CurlRequest &amp; &lt;in_0&gt;, WebCore::CurlRequestClient &amp; &lt;in_1&gt;) Line 101	C++
&gt; WebKit.dll!WTF::Function&lt;void __cdecl(WebCore::CurlRequest &amp;,WebCore::CurlRequestClient &amp;)&gt;::operator()(WebCore::CurlRequest &amp; &lt;in_0&gt;, WebCore::CurlRequestClient &amp; &lt;in_1&gt;) Line 57	C++
&gt; WebKit.dll!WebCore::CurlRequest::callClient::__l2::&lt;lambda&gt;() Line 136	C++
&gt; WebKit.dll!WTF::Function&lt;void __cdecl(void)&gt;::CallableWrapper&lt;void &lt;lambda&gt;(void) &gt;::call() Line 101	C++
&gt; WTF.dll!WTF::Function&lt;void __cdecl(void)&gt;::operator()() Line 57	C++
&gt; WTF.dll!WTF::dispatchFunctionsFromMainThread() Line 132	C++
&gt; WTF.dll!WTF::ThreadingWindowWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 47	C++
&gt; [External Code]	
&gt; DumpRenderTreeLib.dll!runTest(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; inputLine) Line 1246	C++
&gt; DumpRenderTreeLib.dll!main(int argc, const char * * argv) Line 1619	C++
&gt; DumpRenderTreeLib.dll!dllLauncherEntryPoint(int argc, const char * * argv) Line 1660	C++
&gt; DumpRenderTree.exe!main(int argc, const char * * argv) Line 228	C++
&gt; [External Code]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453398</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2018-08-23 22:57:26 -0700</bug_when>
    <thetext>This is super weird. It&apos;d be interesting to see what things got compiled too. Not sure what specifically would make windows itself barf here. Maybe MSVC has a bad time with this code?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453404</commentid>
    <comment_count>4</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-23 23:55:12 -0700</bug_when>
    <thetext>The HashTable was filled with Color::invalidRGBAColor (0x0000000000000001), not Color::emptyHashValue(0xFFFFFFFFFFFFFFFB).
Then, HashTable::add can&apos;t find an empty slot in the loop.

It seems that HashTable::allocateTable initializes slots with
WTF::GenericHashTraits&lt;WebCore::Color&gt;::emptyValue() not
HashTraits&lt;WebCore::Color&gt;::emptyValue().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453412</commentid>
    <comment_count>5</comment_count>
      <attachid>347998</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-24 00:56:19 -0700</bug_when>
    <thetext>Created attachment 347998
WIP patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453416</commentid>
    <comment_count>6</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2018-08-24 01:59:44 -0700</bug_when>
    <thetext>(In reply to Fujii Hironori from comment #4)
&gt; The HashTable was filled with Color::invalidRGBAColor (0x0000000000000001),
&gt; not Color::emptyHashValue(0xFFFFFFFFFFFFFFFB).
&gt; Then, HashTable::add can&apos;t find an empty slot in the loop.
&gt; 
&gt; It seems that HashTable::allocateTable initializes slots with
&gt; WTF::GenericHashTraits&lt;WebCore::Color&gt;::emptyValue() not
&gt; HashTraits&lt;WebCore::Color&gt;::emptyValue().

Interesting. This sounds like a more general issue. Why don’t we see the implemented HashTraits? Do you know why we end up picking up GenericHashTraits instead of the custom one?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453426</commentid>
    <comment_count>7</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-24 04:08:22 -0700</bug_when>
    <thetext>I don&apos;t understand what is going on in MSVC yet.

You added a template method constructEmptyValue in Bug 188582.
constructEmptyValue is a template method in order to override emptyValue().
We need to use constructEmptyValue with Traits because it overrides emptyValue.
IMHO, this code is weird. We should find a better solution for Bug 188582.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453802</commentid>
    <comment_count>8</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-26 23:05:58 -0700</bug_when>
    <thetext>I can&apos;t reproduce this issue with msbuild. It happens only by using Ninja. So weird.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453837</commentid>
    <comment_count>9</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-27 03:35:22 -0700</bug_when>
    <thetext>I compared disassembled code of GenericHashTraits&lt;Color&gt;::constructEmptyValue of built by msbuild and Ninja.

&gt;	WebKit.dll!WTF::GenericHashTraits&lt;WebCore::Color&gt;::constructEmptyValue&lt;WTF::HashTraits&lt;WebCore::Color&gt; &gt;(WebCore::Color &amp; slot) Line 76	C++

MSBuild:

&gt; --- c:\webkit\ga\webkitbuild\debug\derivedsources\forwardingheaders\wtf\hashtraits.h 
&gt; 
&gt;     template &lt;typename Traits&gt;
&gt;     static void constructEmptyValue(T&amp; slot)
&gt;     {
&gt; 00007FFB1F07DE80  mov         qword ptr [rsp+8],rcx  
&gt; 00007FFB1F07DE85  push        rdi  
&gt; 00007FFB1F07DE86  sub         rsp,30h  
&gt; 00007FFB1F07DE8A  mov         rdi,rsp  
&gt; 00007FFB1F07DE8D  mov         ecx,0Ch  
&gt; 00007FFB1F07DE92  mov         eax,0CCCCCCCCh  
&gt; 00007FFB1F07DE97  rep stos    dword ptr [rdi]  
&gt; 00007FFB1F07DE99  mov         rcx,qword ptr [slot]  
&gt;         new (NotNull, std::addressof(slot)) T(Traits::emptyValue());
&gt; 00007FFB1F07DE9E  mov         rcx,qword ptr [slot]  
&gt; 00007FFB1F07DEA3  call        std::addressof&lt;WebCore::Color&gt; (07FFB1F07C650h)  
&gt; 00007FFB1F07DEA8  mov         r8,rax  
&gt; 00007FFB1F07DEAB  xor         edx,edx  
&gt; 00007FFB1F07DEAD  mov         ecx,8  
&gt; 00007FFB1F07DEB2  call        WebCore::Color::operator new (07FFB1F08EF40h)  
&gt; 00007FFB1F07DEB7  mov         qword ptr [rsp+20h],rax  
&gt; 00007FFB1F07DEBC  cmp         qword ptr [rsp+20h],0  
&gt; 00007FFB1F07DEC2  je          WTF::GenericHashTraits&lt;WebCore::Color&gt;::constructEmptyValue&lt;WTF::HashTraits&lt;WebCore::Color&gt; &gt;+55h (07FFB1F07DED5h)  
&gt; 00007FFB1F07DEC4  mov         rcx,qword ptr [rsp+20h]  
&gt; 00007FFB1F07DEC9  call        WTF::GenericHashTraits&lt;WebCore::Color&gt;::emptyValue (07FFB1F09BDE0h)  
&gt; 00007FFB1F07DECE  mov         qword ptr [rsp+28h],rax  
&gt; 00007FFB1F07DED3  jmp         WTF::GenericHashTraits&lt;WebCore::Color&gt;::constructEmptyValue&lt;WTF::HashTraits&lt;WebCore::Color&gt; &gt;+5Eh (07FFB1F07DEDEh)  
&gt; 00007FFB1F07DED5  mov         qword ptr [rsp+28h],0  
&gt;     }
&gt; 00007FFB1F07DEDE  add         rsp,30h  
&gt; 00007FFB1F07DEE2  pop         rdi  
&gt; 00007FFB1F07DEE3  ret  


Ninja

&gt; --- c:\webkit\gb\webkitbuild\debug\derivedsources\forwardingheaders\wtf\hashtraits.h 
&gt; 
&gt;     template &lt;typename Traits&gt;
&gt;     static void constructEmptyValue(T&amp; slot)
&gt;     {
&gt; 00007FFB1F338830  mov         qword ptr [rsp+8],rcx  
&gt; 00007FFB1F338835  push        rdi  
&gt; 00007FFB1F338836  sub         rsp,30h  
&gt; 00007FFB1F33883A  mov         rdi,rsp  
&gt; 00007FFB1F33883D  mov         ecx,0Ch  
&gt; 00007FFB1F338842  mov         eax,0CCCCCCCCh  
&gt; 00007FFB1F338847  rep stos    dword ptr [rdi]  
&gt; 00007FFB1F338849  mov         rcx,qword ptr [slot]  
&gt;         new (NotNull, std::addressof(slot)) T(Traits::emptyValue());
&gt; 00007FFB1F33884E  mov         rcx,qword ptr [slot]  
&gt; 00007FFB1F338853  call        std::addressof&lt;WebCore::Color&gt; (07FFB1F3360C0h)  
&gt; 00007FFB1F338858  mov         r8,rax  
&gt; 00007FFB1F33885B  xor         edx,edx  
&gt; 00007FFB1F33885D  mov         ecx,8  
&gt; 00007FFB1F338862  call        WebCore::Color::operator new (07FFB1F3410F0h)  
&gt; 00007FFB1F338867  mov         qword ptr [rsp+20h],rax  
&gt; 00007FFB1F33886C  cmp         qword ptr [rsp+20h],0  
&gt; 00007FFB1F338872  je          WTF::GenericHashTraits&lt;WebCore::Color&gt;::constructEmptyValue&lt;WTF::HashTraits&lt;WebCore::Color&gt; &gt;+55h (07FFB1F338885h)  
&gt; 00007FFB1F338874  mov         rcx,qword ptr [rsp+20h]  
&gt; 00007FFB1F338879  call        WTF::HashTraits&lt;WebCore::Color&gt;::emptyValue (07FFB1F34A7D0h)  
&gt; 00007FFB1F33887E  mov         qword ptr [rsp+28h],rax  
&gt; 00007FFB1F338883  jmp         WTF::GenericHashTraits&lt;WebCore::Color&gt;::constructEmptyValue&lt;WTF::HashTraits&lt;WebCore::Color&gt; &gt;+5Eh (07FFB1F33888Eh)  
&gt; 00007FFB1F338885  mov         qword ptr [rsp+28h],0  
&gt;     }
&gt; 00007FFB1F33888E  add         rsp,30h  
&gt; 00007FFB1F338892  pop         rdi  
&gt; 00007FFB1F338893  ret  

WTF::GenericHashTraits&lt;WebCore::Color&gt;::emptyValue is called in one built by MSBuild.
But, WTF::HashTraits&lt;WebCore::Color&gt;::emptyValue is called in one built by Ninja.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453845</commentid>
    <comment_count>10</comment_count>
      <attachid>348131</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-27 04:49:45 -0700</bug_when>
    <thetext>Created attachment 348131
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1453906</commentid>
    <comment_count>11</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2018-08-27 09:17:37 -0700</bug_when>
    <thetext>I wonder if there is anything we can do to make diagnosing such issues easier or even produce build errors somehow? I don’t see how we could make it produce a build error but maybe someone else does</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1454266</commentid>
    <comment_count>12</comment_count>
      <attachid>348131</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-27 19:39:24 -0700</bug_when>
    <thetext>Comment on attachment 348131
Patch

Good point!

Indeed, JavaScriptCore is doing that. JSC has a lot of *Inlines.h
not to include unnecessary inline functions.

For example, the template declaration of Heap::forEachProtectedCell is in Heap.h.
https://github.com/WebKit/webkit/blob/5b3fecdfc4dfae0b39a57cece903ff0c96f0c423/Source/JavaScriptCore/heap/Heap.h#L237

And, its template definition is in HeapInlines.h.
https://github.com/WebKit/webkit/blob/5b3fecdfc4dfae0b39a57cece903ff0c96f0c423/Source/JavaScriptCore/heap/HeapInlines.h#L155

I will add a template declaration in Color.h.

&gt; namespace WTF {
&gt; template&lt;&gt; struct HashTraits&lt;WebCore::Color&gt;;
&gt; }

Then, I get a following compilation error.

&gt; 1&gt;------ Build started: Project: WebCore (WebCore\WebCore), Configuration: Debug x64 ------
&gt; 1&gt;UnifiedSource304.cpp
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(221): error C2672: &apos;WTF::HashMap&lt;WTF::String,WebCore::Color,WTF::DefaultHash&lt;WTF::String&gt;::Hash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;WebCore::Color&gt;&gt;::get&apos;: no matching overloaded function found
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(221): error C2893: Failed to specialize function template &apos;std::enable_if::type WTF::HashMap&lt;WTF::String,WebCore::Color,WTF::DefaultHash&lt;WTF::String&gt;::Hash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;WebCore::Color&gt;&gt;::get(GetPtrHelper&lt;K&gt;::PtrType) const&apos;
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(221): note: With the following template arguments:
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(221): note: &apos;K=WTF::String&apos;
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(227): error C2672: &apos;WTF::HashMap&lt;WTF::String,WebCore::Color,WTF::DefaultHash&lt;WTF::String&gt;::Hash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;WebCore::Color&gt;&gt;::get&apos;: no matching overloaded function found
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(227): error C2893: Failed to specialize function template &apos;std::enable_if::type WTF::HashMap&lt;WTF::String,WebCore::Color,WTF::DefaultHash&lt;WTF::String&gt;::Hash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;WebCore::Color&gt;&gt;::get(GetPtrHelper&lt;K&gt;::PtrType) const&apos;
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(227): note: With the following template arguments:
&gt; 1&gt;c:\webkit\gb\source\webcore\page\debugpageoverlays.cpp(227): note: &apos;K=WTF::String&apos;
&gt; 1&gt;Done building project &quot;WebCore.vcxproj&quot; -- FAILED.
&gt; ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I discard the previous patch and will upload a new patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1454346</commentid>
    <comment_count>13</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-08-28 03:57:30 -0700</bug_when>
    <thetext>Filed another ticket.

  Bug 189044 – Add specialize template declarations of HashTraits and DefaultHash to detect misuse</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458345</commentid>
    <comment_count>14</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-10 17:57:27 -0700</bug_when>
    <thetext>Fixed this issue in Bug 189044.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>347998</attachid>
            <date>2018-08-24 00:56:19 -0700</date>
            <delta_ts>2018-08-27 04:49:41 -0700</delta_ts>
            <desc>WIP patch</desc>
            <filename>a.diff</filename>
            <type>text/plain</type>
            <size>912</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL3BsYXRmb3JtL2dyYXBoaWNzL0NvbG9ySGFzaC5o
IGIvU291cmNlL1dlYkNvcmUvcGxhdGZvcm0vZ3JhcGhpY3MvQ29sb3JIYXNoLmgKaW5kZXggZjA4
MTE5MzUxZDA4Li5iY2NhNzBlNjA3OGIgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJDb3JlL3BsYXRm
b3JtL2dyYXBoaWNzL0NvbG9ySGFzaC5oCisrKyBiL1NvdXJjZS9XZWJDb3JlL3BsYXRmb3JtL2dy
YXBoaWNzL0NvbG9ySGFzaC5oCkBAIC00Myw2ICs0Myw4IEBAIHRlbXBsYXRlPD4gc3RydWN0IERl
ZmF1bHRIYXNoPFdlYkNvcmU6OkNvbG9yPiB7CiB0ZW1wbGF0ZTw+IHN0cnVjdCBIYXNoVHJhaXRz
PFdlYkNvcmU6OkNvbG9yPiA6IEdlbmVyaWNIYXNoVHJhaXRzPFdlYkNvcmU6OkNvbG9yPiB7CiAg
ICAgc3RhdGljIGNvbnN0IGJvb2wgZW1wdHlWYWx1ZUlzWmVybyA9IGZhbHNlOwogICAgIHN0YXRp
YyBXZWJDb3JlOjpDb2xvciBlbXB0eVZhbHVlKCkgeyByZXR1cm4gV2ViQ29yZTo6Q29sb3IoSGFz
aFRhYmxlRW1wdHlWYWx1ZSk7IH0KKyAgICB0ZW1wbGF0ZSA8dHlwZW5hbWUgVHJhaXRzPgorICAg
IHN0YXRpYyB2b2lkIGNvbnN0cnVjdEVtcHR5VmFsdWUoV2ViQ29yZTo6Q29sb3ImIHNsb3QpIHsg
bmV3IChOb3ROdWxsLCAmc2xvdCkgV2ViQ29yZTo6Q29sb3IoZW1wdHlWYWx1ZSgpKTsgfQogCiAg
ICAgc3RhdGljIHZvaWQgY29uc3RydWN0RGVsZXRlZFZhbHVlKFdlYkNvcmU6OkNvbG9yJiBzbG90
KSB7IG5ldyAoTm90TnVsbCwgJnNsb3QpIFdlYkNvcmU6OkNvbG9yKEhhc2hUYWJsZURlbGV0ZWRW
YWx1ZSk7IH0KICAgICBzdGF0aWMgYm9vbCBpc0RlbGV0ZWRWYWx1ZShjb25zdCBXZWJDb3JlOjpD
b2xvciYgdmFsdWUpIHsgcmV0dXJuIHZhbHVlLmlzSGFzaFRhYmxlRGVsZXRlZFZhbHVlKCk7IH0K
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>348131</attachid>
            <date>2018-08-27 04:49:45 -0700</date>
            <delta_ts>2018-08-27 19:39:24 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-188893-20180827204944.patch</filename>
            <type>text/plain</type>
            <size>2071</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjM1MjcxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNTAwODFmOTUwMGFkZTdm
YmFmZjNjOWI4Yjc2OTg0NWU3YjczN2EyMy4uMmY3ZTllNDdjZjY3Y2JhMmEzNzkzZjg3YmU3Yzhk
NWRkNGFiNWZmMSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDMxIEBACisyMDE4L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S9EZWJ1Z1BhZ2VPdmVy
bGF5cy5jcHAKQEAgLTI2LDYgKzI2LDcgQEAKICNpbmNsdWRlICJjb25maWcuaCIKICNpbmNsdWRl
ICJEZWJ1Z1BhZ2VPdmVybGF5cy5oIgogCisjaW5jbHVkZSAiQ29sb3JIYXNoLmgiCiAjaW5jbHVk
ZSAiRWxlbWVudEl0ZXJhdG9yLmgiCiAjaW5jbHVkZSAiRnJhbWVWaWV3LmgiCiAjaW5jbHVkZSAi
R3JhcGhpY3NDb250ZXh0LmgiCg==
</data>
<flag name="review"
          id="365803"
          type_id="1"
          status="+"
          setter="saam"
    />
          </attachment>
      

    </bug>

</bugzilla>