<?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>127820</bug_id>
          
          <creation_ts>2014-01-28 18:18:12 -0800</creation_ts>
          <short_desc>API tests on Windows fail after r162774 (Debug)</short_desc>
          <delta_ts>2016-03-22 14:06:09 -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>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <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="Roger Fong">roger_fong</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>andersca</cc>
    
    <cc>bfulgham</cc>
    
    <cc>drake127</cc>
    
    <cc>roger_fong</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>973242</commentid>
    <comment_count>0</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-01-28 18:18:12 -0800</bug_when>
    <thetext>Tests fail trying to build the list of tests to run.
It only fails in Debug mode.

Looking at the changeset, it looks like it has something to do with using CHECK_HASHTABLE_ITERATORS.
-#ifndef NDEBUG
-// Required for CHECK_HASHTABLE_ITERATORS.
-#include &lt;wtf/OwnPtr.h&gt;
-#include &lt;wtf/PassOwnPtr.h&gt;
-#endif

It looks like the replacing of those two headers with std headers caused some problems.
Once I figure out which arguments I need to pass into TestWebKitAPI.exe to get that step to run in the debugger i&apos;ll post a stack trace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>973243</commentid>
    <comment_count>1</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-01-28 18:19:32 -0800</bug_when>
    <thetext>perhaps just --gtest-list-tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>973444</commentid>
    <comment_count>2</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-01-29 12:28:43 -0800</bug_when>
    <thetext>First-chance exception at 0x76D12EEC in TestWebKitAPI.exe: Microsoft C++ exception: Concurrency::scheduler_resource_allocation_error at memory location 0x0018FB90.
Unhandled exception at 0x76D12EEC in TestWebKitAPI.exe: Microsoft C++ exception: Concurrency::scheduler_resource_allocation_error at memory location 0x0018FB90.

In this code:

#if CHECK_HASHTABLE_ITERATORS

    template&lt;typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits&gt;
    void HashTable&lt;Key, Value, Extractor, HashFunctions, Traits, KeyTraits&gt;::invalidateIterators()
    {
        std::lock_guard&lt;std::mutex&gt; lock(*m_mutex);
        const_iterator* next;
        for (const_iterator* p = m_iterators; p; p = next) {  &lt;----HERE
            next = p-&gt;m_next;
            p-&gt;m_table = 0;
            p-&gt;m_next = 0;
            p-&gt;m_previous = 0;
        }
        m_iterators = 0;
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>973449</commentid>
    <comment_count>3</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-01-29 12:56:47 -0800</bug_when>
    <thetext>
&gt; #if CHECK_HASHTABLE_ITERATORS
&gt; 
&gt;     template&lt;typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits&gt;
&gt;     void HashTable&lt;Key, Value, Extractor, HashFunctions, Traits, KeyTraits&gt;::invalidateIterators()
&gt;     {
&gt;         std::lock_guard&lt;std::mutex&gt; lock(*m_mutex); &lt;----HERE

Correction it&apos;s on this line</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>973450</commentid>
    <comment_count>4</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-01-29 13:06:46 -0800</bug_when>
    <thetext>Looks like we got something funky going on with the VS2013 headers

inline int _Mtx_lockX(_Mtx_t *_Mtx)
	{	// throw exception on failure
	return (_Check_C_return(_Mtx_lock(_Mtx)));
	}

in xthread.h is throwing the exception</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>992299</commentid>
    <comment_count>5</comment_count>
    <who name="Emanuel Komínek">drake127</who>
    <bug_when>2014-03-19 15:45:22 -0700</bug_when>
    <thetext>I am not related to WebKit but suffer from same bug in our software. Has somebody been able to reproduce it?

It is likely a bug in implementation of std::mutex by MS (both VS 2012 and VS 2013 runtime) but I got my hands only on minidumps which were inconclusive.

So far, we observed this crash only on 32-bit Windows and our failing function was RegisterWaitForSingleObject and call stack is as follows:

_CxxThrowException+0x57 [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\throw.cpp @ 152]
Concurrency::details::SchedulerBase::SchedulerBase+0x23b [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp @ 146]
Concurrency::details::ThreadScheduler::ThreadScheduler+0x18 [f:\dd\vctools\crt_bld\self_x86\crt\src\threadscheduler.cpp @ 26]
Concurrency::details::ThreadScheduler::Create+0x2d [f:\dd\vctools\crt_bld\self_x86\crt\src\threadscheduler.cpp @ 35]
Concurrency::details::SchedulerBase::CreateWithoutInitializing+0x18 [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp @ 276]
Concurrency::details::SchedulerBase::GetDefaultScheduler+0x5c [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp @ 650]
Concurrency::details::SchedulerBase::CreateContextFromDefaultScheduler+0x7 [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp @ 567]
Concurrency::details::LockQueueNode::LockQueueNode+0x27 [f:\dd\vctools\crt_bld\self_x86\crt\src\rtlocks.cpp @ 617]
Concurrency::critical_section::lock+0x13 [f:\dd\vctools\crt_bld\self_x86\crt\src\rtlocks.cpp @ 1022]
mtx_do_lock+0x74 [f:\dd\vctools\crt_bld\self_x86\crt\src\thr\mutex.c @ 65]
_Mtx_lock+0xd [f:\dd\vctools\crt_bld\self_x86\crt\src\thr\mutex.c @ 144]

The problem is, I never saw what was happening in the RegisterWaitForSingleObject call so I cannot say what exactly went wrong. :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177117</commentid>
    <comment_count>6</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2016-03-22 14:06:09 -0700</bug_when>
    <thetext>This doesn&apos;t seem to happen anymore. Looks like this was resolved in one of the VS updates.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>