<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 - [GTK][OSX] ThreadIdentifierData::initialize assertion fails: (m_key != PTHREAD_KEYS_MAX)"
   href="https://bugs.webkit.org/show_bug.cgi?id=153176">153176</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GTK][OSX] ThreadIdentifierData::initialize assertion fails: (m_key != PTHREAD_KEYS_MAX)
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>WebKit 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>WebKit Gtk
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jeremyhu&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply&#64;webkitgtk.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reported on MacPorts at <a href="https://trac.macports.org/ticket/50339">https://trac.macports.org/ticket/50339</a>

After working through various build issues (<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK OSX] webkit-gtk 2.11.2 fails to link libllvmForJSC.dylib on OS X due to duplicate (local) abort and raise symbols"
   href="show_bug.cgi?id=152641">bug #152641</a>, <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK OSX] JavaScriptCore fails to build on older versions of OS X due to CF_AVAILABLE usage"
   href="show_bug.cgi?id=152720">bug #152720</a>, <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK OSX] libGObjectDOMBindings.a is not linked into libwebkit2gtk-4.0.37.dylib"
   href="show_bug.cgi?id=153117">bug #153117</a>, <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK OSX] libwebkit2gtk fails to link due to missing symbol ANGLEPlatformCurrent"
   href="show_bug.cgi?id=153120">bug #153120</a>, <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK][OSX] libjavascriptcoregtk fails to link when building debug configuration"
   href="show_bug.cgi?id=153138">bug #153138</a>), we get a successful build, but the resulting library aborts at initialization.

The issue is in ThreadIdentifierData::initialize(ThreadIdentifier id), we're failing the RELEASE_ASSERT.  m_key is PTHREAD_KEYS_MAX for some reason.

void ThreadIdentifierData::initialize(ThreadIdentifier id)
{
    ASSERT(!identifier());
    // Ideally we'd have this as a release assert everywhere, but that would hurt performane.
    // Having this release assert here means that we will catch &quot;didn't call
    // WTF::initializeThreading() soon enough&quot; bugs in release mode.
    RELEASE_ASSERT(m_key != PTHREAD_KEYS_MAX);
    pthread_setspecific(m_key, new ThreadIdentifierData(id));
}

---

I didn't quite believe it, so I changed the RELEASE_ASSERT to a real assert(), and sure enough:

Assertion failed: (m_key != PTHREAD_KEYS_MAX), function identifier, file /.../webkitgtk-2.11.3/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp, line 64.</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>