<?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>161481</bug_id>
          
          <creation_ts>2016-09-01 01:53:52 -0700</creation_ts>
          <short_desc>[GTK] Use GTestDBus instead of dbus-launch in WebKitTestBus.cpp</short_desc>
          <delta_ts>2016-11-02 09:33:38 -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>Other</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></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>clopez</cc>
    
    <cc>gustavo</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1225294</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2016-09-01 01:53:52 -0700</bug_when>
    <thetext>This is not a priority, but I&apos;m leaving it here so it can be tracker.

Debian is moving towards making dbus-x11 optional.

WebKitGTK+ uses dbus-launch in one of its tests. Using GTestDBus instead (as stated in the FIXME comment in the very source file) should solve this problem.

More details here:

https://lists.debian.org/debian-devel/2016/08/msg00554.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246408</commentid>
    <comment_count>1</comment_count>
      <attachid>293416</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-31 06:44:53 -0700</bug_when>
    <thetext>Created attachment 293416
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246469</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-31 09:51:20 -0700</bug_when>
    <thetext>Didn&apos;t we have a similar patch recently? From Gustavo or Emanuele? What happened to that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246470</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-31 09:56:35 -0700</bug_when>
    <thetext>I don&apos;t know I haven&apos;t seen anything in my bug mail, and this is the first patch in this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246477</commentid>
    <comment_count>4</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-31 10:15:07 -0700</bug_when>
    <thetext>Ah, I guess you mean bug #161135. That doesn&apos;t change the use of dbus-launch, both patches are compatible, it&apos;s not the same thing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246487</commentid>
    <comment_count>5</comment_count>
      <attachid>293416</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-31 10:50:44 -0700</bug_when>
    <thetext>Comment on attachment 293416
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=293416&amp;action=review

&gt; Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:38
&gt; +    g_setenv(&quot;DISPLAY&quot;, display.data(), FALSE);

So the problem here is it&apos;s too late to be doing setenv; we&apos;ve already initialized threads. Some other thread could call getenv at the same time -- there are getenv calls in many many places -- and crash. It&apos;s not a theoretical issue, I&apos;ve seen multiple cases of this crashing gnome-session.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246489</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-31 10:52:58 -0700</bug_when>
    <thetext>Although I do see the existing code was doing this already, I would prefer finding a way to fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246862</commentid>
    <comment_count>7</comment_count>
      <attachid>293416</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-01 02:31:38 -0700</bug_when>
    <thetext>Comment on attachment 293416
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=293416&amp;action=review

&gt;&gt; Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:38
&gt;&gt; +    g_setenv(&quot;DISPLAY&quot;, display.data(), FALSE);
&gt; 
&gt; So the problem here is it&apos;s too late to be doing setenv; we&apos;ve already initialized threads. Some other thread could call getenv at the same time -- there are getenv calls in many many places -- and crash. It&apos;s not a theoretical issue, I&apos;ve seen multiple cases of this crashing gnome-session.

It&apos;s not that I want to se the display here, DISPLAY has already been set, but g_test_dbus_up() unsets it unconditionally, so I&apos;m just restoring it because otherwise nothing works (the web process needs DISPLAY to be set to work). This has nothing to do with gnome-session, this only affects the tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246879</commentid>
    <comment_count>8</comment_count>
      <attachid>293416</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-01 05:10:24 -0700</bug_when>
    <thetext>Comment on attachment 293416
Patch

The problem is that if you do that, the test will randomly crash; we don&apos;t need more flaky tests. In fact, since g_test_dbus_up() calls setenv() itself, it suffers from the same problem. We need to be careful to only call such functions (a) at the very top of main(), or (b) when we&apos;re really really sure that it&apos;s before the first secondary thread has been created, otherwise the test will be flaky. And it&apos;s impossible for WebKitTestBus to guarantee where it&apos;s used from, so it really needs to not be setting environment variables.

Is it even possible to create a GObject without starting secondary threads?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246884</commentid>
    <comment_count>9</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2016-11-01 05:50:06 -0700</bug_when>
    <thetext>While the patch from bug 161135 applies along with this one, it does disable this one which I think is undesirable. The result of having both applied would be dbus-run-session be used every time it is available. This solution is a better one, so I&apos;d recommend just going with it, if we can fix the threading concerns.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247241</commentid>
    <comment_count>10</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-02 00:16:23 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Comment on attachment 293416 [details]
&gt; Patch
&gt; 
&gt; The problem is that if you do that, the test will randomly crash; we don&apos;t
&gt; need more flaky tests.

Why? Could you show a bt of one of such crashes? Because our current code is calling setenv in the same place, this patch is only replacing the code that GTestDBus with GTestDBus.

&gt; In fact, since g_test_dbus_up() calls setenv()
&gt; itself, it suffers from the same problem.

Exactly, it&apos;s not a problem of this patch, but an existing problem (if any) and I have never seen random crashes in the tests using WebKitTestBus.

&gt; We need to be careful to only call
&gt; such functions (a) at the very top of main(),

Which is exactly what happens. This is not public API, this is an internal helper class designed to be used by tests that should do this at the very beginning of beforeAll():

bus = new WebKitTestBus();
if (!bus-&gt;run())
    return;

And beforeAll() is called by main() right after setting up the environment and registering gresources. There isn&apos;t any other code before that, nor any other secondary thread created.

&gt; or (b) when we&apos;re really
&gt; really sure that it&apos;s before the first secondary thread has been created,
&gt; otherwise the test will be flaky. And it&apos;s impossible for WebKitTestBus to
&gt; guarantee where it&apos;s used from, so it really needs to not be setting
&gt; environment variables.

We are already ensuring both a) and b), and we don&apos;t need WebKitTestBus to ensure anything, we just need to use it as it&apos;s designed to be used, at the very beginning of beforeAll(). Another option would be to do it unconditionally in main() for all tests, but that could slow down the tests that don&apos;t need dbus at all.

&gt; Is it even possible to create a GObject without starting secondary threads?

There isn&apos;t any thread nor GObject created in this case when WebKitTestBus::run is called.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247244</commentid>
    <comment_count>11</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-02 00:21:28 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; While the patch from bug 161135 applies along with this one, it does disable
&gt; this one which I think is undesirable. The result of having both applied
&gt; would be dbus-run-session be used every time it is available. This solution
&gt; is a better one, so I&apos;d recommend just going with it, if we can fix the
&gt; threading concerns.

I&apos;m not sure this patch solves the same problem. The bus started by WebKitTestBus::run() will be leaked if the test crashes, because ~WebKitTestBus() won&apos;t be called in that case. So, we can leave this code as fallback when dbus-run-session is not present, or when tests are run manually (without using run-gtk-tests), something that I do a lot. When dbus-run-session is present we simply set m_address, I don&apos;t think the patches are mutually exclusive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247291</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-02 05:45:52 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Why? Could you show a bt of one of such crashes? Because our current code is
&gt; calling setenv in the same place, this patch is only replacing the code that
&gt; GTestDBus with GTestDBus.

Here&apos;s one example of such a crash, with a backtrace:

https://bugzilla.gnome.org/show_bug.cgi?id=754951

We had a second case in some important GNOME component recently, but I honestly don&apos;t remember where and can&apos;t find it now. And we have third one in Endless&apos;s private bug tracker right now.

&gt; &gt; We need to be careful to only call
&gt; &gt; such functions (a) at the very top of main(),
&gt; 
&gt; Which is exactly what happens. This is not public API, this is an internal
&gt; helper class designed to be used by tests that should do this at the very
&gt; beginning of beforeAll():
&gt; 
&gt; bus = new WebKitTestBus();
&gt; if (!bus-&gt;run())
&gt;     return;
&gt; 
&gt; And beforeAll() is called by main() right after setting up the environment
&gt; and registering gresources. There isn&apos;t any other code before that, nor any
&gt; other secondary thread created.

OK, then it should be OK, but it is so easy to misuse that I would prefer that you add an assertion to guarantee this. Unfortunately the best example I found requires reading /proc:

http://stackoverflow.com/a/13993822/1120203

but it could be done inside #ifndef NDEBUG. Then if that check passes, we can be confident that GLib isn&apos;t creating any secondary thread somewhere before the setenv.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247294</commentid>
    <comment_count>13</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-02 05:52:30 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; (In reply to comment #10)
&gt; &gt; Why? Could you show a bt of one of such crashes? Because our current code is
&gt; &gt; calling setenv in the same place, this patch is only replacing the code that
&gt; &gt; GTestDBus with GTestDBus.
&gt; 
&gt; Here&apos;s one example of such a crash, with a backtrace:
&gt; 
&gt; https://bugzilla.gnome.org/show_bug.cgi?id=754951
&gt; 
&gt; We had a second case in some important GNOME component recently, but I
&gt; honestly don&apos;t remember where and can&apos;t find it now. And we have third one
&gt; in Endless&apos;s private bug tracker right now.

I don&apos;t care about other applications crashing, this bug is about our unit tests, we have done this forever and I&apos;ve never seen a crash, so I don&apos;t understand why you say that this patch is going to be the source of crashes and flaky tests.

&gt; &gt; &gt; We need to be careful to only call
&gt; &gt; &gt; such functions (a) at the very top of main(),
&gt; &gt; 
&gt; &gt; Which is exactly what happens. This is not public API, this is an internal
&gt; &gt; helper class designed to be used by tests that should do this at the very
&gt; &gt; beginning of beforeAll():
&gt; &gt; 
&gt; &gt; bus = new WebKitTestBus();
&gt; &gt; if (!bus-&gt;run())
&gt; &gt;     return;
&gt; &gt; 
&gt; &gt; And beforeAll() is called by main() right after setting up the environment
&gt; &gt; and registering gresources. There isn&apos;t any other code before that, nor any
&gt; &gt; other secondary thread created.
&gt; 
&gt; OK, then it should be OK, but it is so easy to misuse that I would prefer
&gt; that you add an assertion to guarantee this. Unfortunately the best example
&gt; I found requires reading /proc:
&gt; 
&gt; http://stackoverflow.com/a/13993822/1120203
&gt; 
&gt; but it could be done inside #ifndef NDEBUG. Then if that check passes, we
&gt; can be confident that GLib isn&apos;t creating any secondary thread somewhere
&gt; before the setenv.

This is private API for unit tests, I don&apos;t think we need to complicate things to fix a problem that doesn&apos;t exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247326</commentid>
    <comment_count>14</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2016-11-02 08:08:41 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #9)
&gt; &gt; While the patch from bug 161135 applies along with this one, it does disable
&gt; &gt; this one which I think is undesirable. The result of having both applied
&gt; &gt; would be dbus-run-session be used every time it is available. This solution
&gt; &gt; is a better one, so I&apos;d recommend just going with it, if we can fix the
&gt; &gt; threading concerns.
&gt; 
&gt; I&apos;m not sure this patch solves the same problem. The bus started by
&gt; WebKitTestBus::run() will be leaked if the test crashes, because
&gt; ~WebKitTestBus() won&apos;t be called in that case. So, we can leave this code as
&gt; fallback when dbus-run-session is not present, or when tests are run
&gt; manually (without using run-gtk-tests), something that I do a lot. When
&gt; dbus-run-session is present we simply set m_address, I don&apos;t think the
&gt; patches are mutually exclusive.

I thought GTestDBus handled cleaning up the dbus daemon process even on crashes? But if you think it&apos;s useful to have both and ok to have dbus-run-session used when present I&apos;ll go ahead and land it =)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247329</commentid>
    <comment_count>15</comment_count>
      <attachid>293416</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-02 08:36:19 -0700</bug_when>
    <thetext>Comment on attachment 293416
Patch

I&apos;m going to give you r+ since you&apos;ve convinced me that the current code is safe, but I really do think this is fragile and that it would be better to add an assertion, even if the assertion is not straightforward to write.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247330</commentid>
    <comment_count>16</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-02 08:37:24 -0700</bug_when>
    <thetext>(to catch future incorrect use of this class, and to verify that we&apos;re right in thinking there is only one thread when this code is executed)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247344</commentid>
    <comment_count>17</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-02 09:26:40 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; (In reply to comment #11)
&gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; While the patch from bug 161135 applies along with this one, it does disable
&gt; &gt; &gt; this one which I think is undesirable. The result of having both applied
&gt; &gt; &gt; would be dbus-run-session be used every time it is available. This solution
&gt; &gt; &gt; is a better one, so I&apos;d recommend just going with it, if we can fix the
&gt; &gt; &gt; threading concerns.
&gt; &gt; 
&gt; &gt; I&apos;m not sure this patch solves the same problem. The bus started by
&gt; &gt; WebKitTestBus::run() will be leaked if the test crashes, because
&gt; &gt; ~WebKitTestBus() won&apos;t be called in that case. So, we can leave this code as
&gt; &gt; fallback when dbus-run-session is not present, or when tests are run
&gt; &gt; manually (without using run-gtk-tests), something that I do a lot. When
&gt; &gt; dbus-run-session is present we simply set m_address, I don&apos;t think the
&gt; &gt; patches are mutually exclusive.
&gt; 
&gt; I thought GTestDBus handled cleaning up the dbus daemon process even on
&gt; crashes? But if you think it&apos;s useful to have both and ok to have
&gt; dbus-run-session used when present I&apos;ll go ahead and land it =)

You are right, it uses a global watcher that forks a child that watches the parent and kills spawned processes in that case. So, I agree this solution is better, because it also works when tests are run directly without using run-gtk-tests</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247346</commentid>
    <comment_count>18</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-11-02 09:33:38 -0700</bug_when>
    <thetext>Committed r208284: &lt;http://trac.webkit.org/changeset/208284&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>293416</attachid>
            <date>2016-10-31 06:44:53 -0700</date>
            <delta_ts>2016-11-02 08:36:19 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>wk2-dbus-test.diff</filename>
            <type>text/plain</type>
            <size>5440</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdp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VzdFdl
YktpdEFQSS9ndGsvV2ViS2l0Mkd0ay9XZWJLaXRUZXN0QnVzLmgKaW5kZXggMDNiY2MzYS4uYjhh
OGU2MCAxMDA2NDQKLS0tIGEvVG9vbHMvVGVzdFdlYktpdEFQSS9ndGsvV2ViS2l0Mkd0ay9XZWJL
aXRUZXN0QnVzLmgKKysrIGIvVG9vbHMvVGVzdFdlYktpdEFQSS9ndGsvV2ViS2l0Mkd0ay9XZWJL
aXRUZXN0QnVzLmgKQEAgLTI3LDcgKzI3LDcgQEAKIGNsYXNzIFdlYktpdFRlc3RCdXMgewogcHVi
bGljOgogICAgIFdlYktpdFRlc3RCdXMoKTsKLSAgICB2aXJ0dWFsIH5XZWJLaXRUZXN0QnVzKCk7
CisgICAgfldlYktpdFRlc3RCdXMoKTsKIAogICAgIGJvb2wgcnVuKCk7CiAgICAgR0RCdXNQcm94
eSogY3JlYXRlUHJveHkoY29uc3QgY2hhciogc2VydmljZU5hbWUsIGNvbnN0IGNoYXIqIG9iamVj
dFBhdGgsIGNvbnN0IGNoYXIqIGludGVyZmFjZU5hbWUsIEdNYWluTG9vcCopOwpAQCAtMzYsNyAr
MzYsNyBAQCBwdWJsaWM6CiBwcml2YXRlOgogICAgIEdEQnVzQ29ubmVjdGlvbiogZ2V0T3JDcmVh
dGVDb25uZWN0aW9uKCk7CiAKLSAgICBwaWRfdCBtX3BpZDsKKyAgICBHUmVmUHRyPEdUZXN0REJ1
cz4gbV9idXM7CiAgICAgQ1N0cmluZyBtX2FkZHJlc3M7CiAgICAgR1JlZlB0cjxHREJ1c0Nvbm5l
Y3Rpb24+IG1fY29ubmVjdGlvbjsKIH07Cg==
</data>
<flag name="review"
          id="316293"
          type_id="1"
          status="+"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>