<?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>135760</bug_id>
          
          <creation_ts>2014-08-08 11:05:46 -0700</creation_ts>
          <short_desc>[GTK] No IPC messages are sent when building WebKitGTK+ with VERSION_SCRIPT</short_desc>
          <delta_ts>2014-08-11 03:12:02 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>135694</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bunhere</cc>
    
    <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>mrobinson</cc>
    
    <cc>ossy</cc>
    
    <cc>rakuco</cc>
    
    <cc>sergio</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1027879</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-08 11:05:46 -0700</bug_when>
    <thetext>Everything fails because of the threading initialization, this is what is happening:

1. InitializeWebKit2 is called when the first API object is created in the UI process

2. InitializeWebKit2 calls 

  JSC::initializeThreading(); 
  WTF::initializeMainThread();

3. We have two copies of WTF in memory and JSC::initializeThreading() is using one, and WTF::initializeMainThread() the other, see:

$ objdump -t libjavascriptcoregtk-4.0.so | grep ThreadIdentifierData
0000000000000000 l    df *ABS*	0000000000000000              ThreadIdentifierDataPthreads.cpp
00000000006e3290 g     F .text	000000000000005f              _ZN3WTF20ThreadIdentifierData10identifierEv
00000000006e32f0 g     F .text	0000000000000056              _ZN3WTF20ThreadIdentifierData10initializeEj
00000000006e31b0 g     F .text	0000000000000025              _ZN3WTF20ThreadIdentifierDataD1Ev
00000000006e31e0 g     F .text	0000000000000053              _ZN3WTF20ThreadIdentifierData8destructEPv
00000000006e31b0 g     F .text	0000000000000025              _ZN3WTF20ThreadIdentifierDataD2Ev
00000000009d6da8 g     O .data	0000000000000004              _ZN3WTF20ThreadIdentifierData5m_keyE
00000000006e3240 g     F .text	000000000000004b              _ZN3WTF20ThreadIdentifierData14initializeOnceEv

$ objdump -t libwebkit2gtk-4.0.so | grep ThreadIdentifierData
0000000000000000 l    df *ABS*	0000000000000000              ThreadIdentifierDataPthreads.cpp
0000000000700150 l     F .text	0000000000000025              _ZN3WTF20ThreadIdentifierDataD1Ev
0000000000700290 l     F .text	0000000000000056              _ZN3WTF20ThreadIdentifierData10initializeEj
0000000000700230 l     F .text	000000000000005f              _ZN3WTF20ThreadIdentifierData10identifierEv
0000000000700180 l     F .text	0000000000000053              _ZN3WTF20ThreadIdentifierData8destructEPv
00000000023efe1c l     O .data	0000000000000004              _ZN3WTF20ThreadIdentifierData5m_keyE
0000000000700150 l     F .text	0000000000000025              _ZN3WTF20ThreadIdentifierDataD2Ev
00000000007001e0 l     F .text	000000000000004b              _ZN3WTF20ThreadIdentifierData14initializeOnceEv

JSC::initializeThreading() calls ThreadIdentifierData::initializeOnce() but using the symbol in libjavascriptcoregtk-4.0.so, so it initializes the pthread_key_t ThreadIdentifierData::m_key in libjavascriptcoregtk-4.0.so. Then WTF::initializeMainThread() calls currentThread() to initialize the main thread identificator, that ends up calling ThreadIdentifierData::identifier() but this time using the local symbol in libwebkit2gtk-4.0.so. The ThreadIdentifierData::m_key in libwebkit2gtk-4.0.so is never initialized with pthread_key_create, and then all calls to pthread_setspecific use 1024 and fails with EINVAL.
Everything depending on the main thread fails, because isMainThread is always returning false, so for example, we are creating a new GMainContext in runLoop instead of using the default one, and all sources scheduled in the main run loop are not processed at all.

The solution is to not link explicitly WebKit2 to WTF, because WebKit2 already links to JavaScriptCore, and then only the JSC copy (with the global symbols) is used. That&apos;s what autotools build used to do as well, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1027883</commentid>
    <comment_count>1</comment_count>
      <attachid>236289</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-08 11:12:04 -0700</bug_when>
    <thetext>Created attachment 236289
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028130</commentid>
    <comment_count>2</comment_count>
      <attachid>236289</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2014-08-10 23:31:44 -0700</bug_when>
    <thetext>Comment on attachment 236289
Patch

o_O</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028131</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-10 23:35:03 -0700</bug_when>
    <thetext>Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028150</commentid>
    <comment_count>4</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2014-08-11 02:16:41 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;

Unfortunately it broke the EFL build: http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2%20%28Perf%29/builds/2883

It&apos;s strange why the EFL EWS didn&apos;t notice it before. 
Maybe ENABLE_DRT environment variable isn&apos;t set on them.

The build fails on the EFL layout tester and the EFL performance
tester bots where ENABLE_DRT is set to 1. But the build doesn&apos;t 
fail on the ARM bots of u-szeged where ENABLE_DRT isn&apos;t present.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028151</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-11 02:35:01 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;
&gt; 
&gt; Unfortunately it broke the EFL build: http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2%20%28Perf%29/builds/2883

I&apos;m sorry, I assumed green EWS was safe enough.

&gt; It&apos;s strange why the EFL EWS didn&apos;t notice it before. 
&gt; Maybe ENABLE_DRT environment variable isn&apos;t set on them.
&gt; 
&gt; The build fails on the EFL layout tester and the EFL performance
&gt; tester bots where ENABLE_DRT is set to 1. But the build doesn&apos;t 
&gt; fail on the ARM bots of u-szeged where ENABLE_DRT isn&apos;t present.

I guess we just need to add WTF to any other target.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028154</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-11 02:53:08 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;
&gt; &gt; 
&gt; &gt; Unfortunately it broke the EFL build: http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2%20%28Perf%29/builds/2883
&gt; 
&gt; I&apos;m sorry, I assumed green EWS was safe enough.
&gt; 
&gt; &gt; It&apos;s strange why the EFL EWS didn&apos;t notice it before. 
&gt; &gt; Maybe ENABLE_DRT environment variable isn&apos;t set on them.
&gt; &gt; 
&gt; &gt; The build fails on the EFL layout tester and the EFL performance
&gt; &gt; tester bots where ENABLE_DRT is set to 1. But the build doesn&apos;t 
&gt; &gt; fail on the ARM bots of u-szeged where ENABLE_DRT isn&apos;t present.
&gt; 
&gt; I guess we just need to add WTF to any other target.

Ok, so the difference between ENABLE_DRT present or not is that it uses -DSHARED_CORE=ON, which is very confusing IMO. So the problem is not building DRT or whatever, but building with SHARED_CORE</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028155</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-08-11 02:59:08 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;
&gt; &gt; &gt; 
&gt; &gt; &gt; Unfortunately it broke the EFL build: http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2%20%28Perf%29/builds/2883
&gt; &gt; 
&gt; &gt; I&apos;m sorry, I assumed green EWS was safe enough.
&gt; &gt; 
&gt; &gt; &gt; It&apos;s strange why the EFL EWS didn&apos;t notice it before. 
&gt; &gt; &gt; Maybe ENABLE_DRT environment variable isn&apos;t set on them.
&gt; &gt; &gt; 
&gt; &gt; &gt; The build fails on the EFL layout tester and the EFL performance
&gt; &gt; &gt; tester bots where ENABLE_DRT is set to 1. But the build doesn&apos;t 
&gt; &gt; &gt; fail on the ARM bots of u-szeged where ENABLE_DRT isn&apos;t present.
&gt; &gt; 
&gt; &gt; I guess we just need to add WTF to any other target.
&gt; 
&gt; Ok, so the difference between ENABLE_DRT present or not is that it uses -DSHARED_CORE=ON, which is very confusing IMO. So the problem is not building DRT or whatever, but building with SHARED_CORE

So, even though I don&apos;t understand why it fails, I guess we can just add WTF to the list of wk2 libs only when SHARED_CORE is ON (this will never be ON for GTK+)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028160</commentid>
    <comment_count>8</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2014-08-11 03:12:02 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; (In reply to comment #5)
&gt; &gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; &gt; Committed r172385: &lt;http://trac.webkit.org/changeset/172385&gt;
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Unfortunately it broke the EFL build: http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2%20%28Perf%29/builds/2883
&gt; &gt; &gt; 
&gt; &gt; &gt; I&apos;m sorry, I assumed green EWS was safe enough.
&gt; &gt; &gt; 
&gt; &gt; &gt; &gt; It&apos;s strange why the EFL EWS didn&apos;t notice it before. 
&gt; &gt; &gt; &gt; Maybe ENABLE_DRT environment variable isn&apos;t set on them.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; The build fails on the EFL layout tester and the EFL performance
&gt; &gt; &gt; &gt; tester bots where ENABLE_DRT is set to 1. But the build doesn&apos;t 
&gt; &gt; &gt; &gt; fail on the ARM bots of u-szeged where ENABLE_DRT isn&apos;t present.
&gt; &gt; &gt; 
&gt; &gt; &gt; I guess we just need to add WTF to any other target.
&gt; &gt; 
&gt; &gt; Ok, so the difference between ENABLE_DRT present or not is that it uses -DSHARED_CORE=ON, which is very confusing IMO. So the problem is not building DRT or whatever, but building with SHARED_CORE
&gt; 
&gt; So, even though I don&apos;t understand why it fails, I guess we can just add WTF to the list of wk2 libs only when SHARED_CORE is ON (this will never be ON for GTK+)


This is long term issue on EFL port. Currently EFL port can&apos;t run layout test without SHARED_CORE=ON. To fix this issue, I filed a bug. However, it is still opened.

[EFL] Can&apos;t run layout test without SHARED_CORE=ON
https://bugs.webkit.org/show_bug.cgi?id=80683

It looks EFL EWS doesn&apos;t enable SHARED_CORE yet though buildbot enables it. That&apos;s why EWS didn&apos;t detect this build break. Let me talk how to fix this problem with my co-workers soon.

Anyway, I add WTF library for EFL port at the moment. 
http://trac.webkit.org/changeset/172392</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>236289</attachid>
            <date>2014-08-08 11:12:04 -0700</date>
            <delta_ts>2014-08-10 23:31:44 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>wk2-no-wtf.diff</filename>
            <type>text/plain</type>
            <size>1670</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NNYWtlTGlzdHMudHh0IGIvU291cmNlL1dlYktp
dDIvQ01ha2VMaXN0cy50eHQKaW5kZXggM2Y1MTg4Ny4uNjFmZDc2MSAxMDA2NDQKLS0tIGEvU291
cmNlL1dlYktpdDIvQ01ha2VMaXN0cy50eHQKKysrIGIvU291cmNlL1dlYktpdDIvQ01ha2VMaXN0
cy50eHQKQEAgLTY2NCw3ICs2NjQsNiBAQCBzZXQoTmV0d29ya1Byb2Nlc3NfTElCUkFSSUVTCiAK
IHNldChXZWJLaXQyX0xJQlJBUklFUwogICAgIEphdmFTY3JpcHRDb3JlCi0gICAgV1RGCiAgICAg
V2ViQ29yZQogKQogCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cgYi9Tb3Vy
Y2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggN2UyOTA0MS4uOWYzNTE3NyAxMDA2NDQKLS0tIGEv
U291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwpA
QCAtMSw1ICsxLDI1IEBACiAyMDE0LTA4LTA4ICBDYXJsb3MgR2FyY2lhIENhbXBvcyAgPGNnYXJj
aWFAaWdhbGlhLmNvbT4KIAorICAgICAgICBbR1RLXSBObyBJUEMgbWVzc2FnZXMgYXJ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ZiBXZWJLaXQyIGxpYnJhcmllcywKKyAgICAgICAgV2ViS2l0MiBhbHJlYWR5IGRl
cGVuZHMgb24gSmF2YVNjcmlwdENvcmUgdGhhdCBhbHJlYWR5IGxpbmtzIHRvIFdURi4KKworMjAx
NC0wOC0wOCAgQ2FybG9zIEdhcmNpYSBDYW1wb3MgIDxjZ2FyY2lhQGlnYWxpYS5jb20+CisKICAg
ICAgICAgW0dUS10gUkVHUkVTU0lPTihyMTY2MjM5KTogVGhlIGxkIHZlcnNpb24gc2NyaXB0IGlz
IG5vdCBiZWluZyB1c2VkCiAgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD0xMzU2OTQKIAo=
</data>
<flag name="review"
          id="260890"
          type_id="1"
          status="+"
          setter="pnormand"
    />
          </attachment>
      

    </bug>

</bugzilla>