<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LazyNeverDestroyed is not thread safe in debug builds, causing assertions"
   href="https://bugs.webkit.org/show_bug.cgi?id=144378">144378</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LazyNeverDestroyed is not thread safe in debug builds, causing assertions
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Template Framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ap&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>akling&#64;apple.com, andersca&#64;apple.com, cdumez&#64;apple.com, zan&#64;falconsigh.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Thread 28 Crashed:: WebCore: Worker
0   com.apple.JavaScriptCore          0x00000001128509da WTFCrash + 42 (Assertions.cpp:321)

ASSERT(m_isConstructed);

1   com.apple.JavaScriptCore          0x0000000112862ed2 WTF::LazyNeverDestroyed&lt;std::__1::mutex&gt;::asPtr() + 66 (NeverDestroyed.h:102)
2   com.apple.JavaScriptCore          0x0000000112862e85 WTF::LazyNeverDestroyed&lt;std::__1::mutex&gt;::operator std::__1::mutex&amp;() + 21 (NeverDestroyed.h:94)
3   com.apple.JavaScriptCore          0x0000000112862161 WTF::cachedCollatorMutex() + 577 (CollatorICU.cpp:62)
4   com.apple.JavaScriptCore          0x0000000112861c8b WTF::Collator::Collator(char const*, bool) + 43 (CollatorICU.cpp:120)
5   com.apple.JavaScriptCore          0x0000000112861c4c WTF::Collator::Collator(char const*, bool) + 44 (CollatorICU.cpp:146)
6   com.apple.JavaScriptCore          0x0000000112788a4b JSC::stringProtoFuncLocaleCompare(JSC::ExecState*) + 155 (StringPrototype.cpp:1429)

LazyNeverDestroyed has a non-trivial constructor in debug builds, which is obviously wrong to have for the pattern we normally use it with.

static std::mutex&amp; cachedCollatorMutex()
{
    static std::once_flag onceFlag;

    static LazyNeverDestroyed&lt;std::mutex&gt; mutex;
    std::call_once(onceFlag, []{
        mutex.construct();
    });

    return mutex;
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>