<?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>66806</bug_id>
          
          <creation_ts>2011-08-23 13:41:21 -0700</creation_ts>
          <short_desc>[chromium] Stacktrace not in test output when a test crashes</short_desc>
          <delta_ts>2011-08-24 18:02:20 -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>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>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="James Robinson">jamesr</reporter>
          <assigned_to name="James Robinson">jamesr</assigned_to>
          <cc>abarth</cc>
    
    <cc>dglazkov</cc>
    
    <cc>dpranke</cc>
    
    <cc>eric</cc>
    
    <cc>tony</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>455667</commentid>
    <comment_count>0</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-23 13:41:21 -0700</bug_when>
    <thetext>When a test crashes in the chromium port, the full stacktrace is produced by the binary but isn&apos;t actually visible it the output.  It looks like the output is ending up in DriverOutput.text, but when a test crashes we only output DriverOutput.error.  http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_result_writer.py#L69.  I think this is due to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py#L448 which pipes stderr to the same place as stdout.

If locally I patch http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_result_writer.py#L69 to write &quot;driver_output.error + driver_output.text&quot;, then I do see the full stack (in addition to whatever test output was produced on stdout).  Based on the comments we should be using ServerProcess, which does have logic to open up stdout and stderr FDs and select() between them.

Because of this bug we often don&apos;t get usable stack traces from even the debug layout test bots, which sucks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>455673</commentid>
    <comment_count>1</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-23 13:45:33 -0700</bug_when>
    <thetext>At a glance maybe I could change the Popen call to leave stderr in its own PIPE, modify ChromiumDriver._write_command_and_read_line() to return a tuple (line, error, did_crash) and do a select() on stdout/stderr inside that function instead of reading directly from stdout always. Sound reasonable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>455712</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-08-23 14:26:05 -0700</bug_when>
    <thetext>Our stdout vs. stderr handling needs work in both the WebKit and Chromium Driver implementations.

I do have plans to fix WebKit&apos;s/ServerProcess, but I don&apos;t have any plans to fix ChromiumDriver since Chromium&apos;s DRT is so different from the rest (and I don&apos;t want to break it).

It seems we should be writing out to a stderr file liek the rest of the webkit ports do, no?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>455715</commentid>
    <comment_count>3</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-23 14:29:35 -0700</bug_when>
    <thetext>Why would we write the stderr output into a file instead of reading it directly from the test harness?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>455732</commentid>
    <comment_count>4</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-23 15:06:00 -0700</bug_when>
    <thetext>https://bugs.webkit.org/show_bug.cgi?id=58708 seems related.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456489</commentid>
    <comment_count>5</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2011-08-24 15:52:41 -0700</bug_when>
    <thetext>The problem with your solution in comment #1 is that select doesn&apos;t work on windows. You end up needing to do something like what I outlined in bug bug 58708, or looping between the two fd&apos;s after setting them both to be nonblocking (assuming that even works, I haven&apos;t tested it on all platforms, but it probably does).

It would be nice if we could unify around ServerProcess, but as Eric says, the logic is at least somewhat different so it&apos;s a non-zero amount of work. 

We could consider also making Chromium DRT match the other ports&apos; output; Tony &amp; co got this mostly working but we never finished working out the bugs. In addition to letting us delete code, it would also probably provide a decent speed boost since we wouldn&apos;t have to write the PNGs to disk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456493</commentid>
    <comment_count>6</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-24 15:56:08 -0700</bug_when>
    <thetext>Can you point me at where that work went to unify the DRT output?  I think that would be a big win, since currently when we get a crash on the bots we have to reproduce locally just to get a stack.  If we could just get a stack from the bots it would help tremendously.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456498</commentid>
    <comment_count>7</comment_count>
      <attachid>105091</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-24 15:59:06 -0700</bug_when>
    <thetext>Created attachment 105091
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456503</commentid>
    <comment_count>8</comment_count>
      <attachid>105091</attachid>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2011-08-24 16:00:47 -0700</bug_when>
    <thetext>Comment on attachment 105091
Patch

change the run_test() method in ChromiumPort to return output + error if it&apos;s a crash instead. That way the hack is isolated to Chromium ports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456516</commentid>
    <comment_count>9</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-08-24 16:19:43 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Can you point me at where that work went to unify the DRT output?

Chromium&apos;s DRT can do either output.  If you pass in --test-shell, we get the Chromium style output, otherwise, we&apos;re supposed to output DRT style.  Most of this logic seems encapsulated in TestEventPrinter.  The non-test-shell output may be out of date.
http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp

When we were upstreaming chromium&apos;s DRT, we tried to switch to the common DRT format at the same time, but there were bugs that we failed to track down (random test timeouts) so we cut our losses and just used the old test_shell format.

I&apos;m not sure exactly what you&apos;d need to do to try to use the common DRT format.  You might be able to just change ChromiumMacPort to inherit from WebKitPort instead of ChromiumPort, but there are probably some additional changes needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456518</commentid>
    <comment_count>10</comment_count>
      <attachid>105092</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-08-24 16:20:44 -0700</bug_when>
    <thetext>Created attachment 105092
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456519</commentid>
    <comment_count>11</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2011-08-24 16:22:14 -0700</bug_when>
    <thetext>Note that if we were to unify the output, we&apos;d also need to make sure that ServerProcess works on windows (win32, not just cygwin). 

I have no idea what the status of the NRWT-on-win port is. Eric?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456574</commentid>
    <comment_count>12</comment_count>
      <attachid>105092</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-24 18:02:15 -0700</bug_when>
    <thetext>Comment on attachment 105092
Patch

Clearing flags on attachment: 105092

Committed r93751: &lt;http://trac.webkit.org/changeset/93751&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>456575</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-24 18:02:20 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>105091</attachid>
            <date>2011-08-24 15:59:06 -0700</date>
            <delta_ts>2011-08-24 16:20:41 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-66806-20110824155706.patch</filename>
            <type>text/plain</type>
            <size>1800</size>
            <attacher name="James Robinson">jamesr</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTM3NDIKZGlmZiAtLWdpdCBhL1Rvb2xzL0NoYW5nZUxvZyBi
L1Rvb2xzL0NoYW5nZUxvZwppbmRleCBmZGRlMTRkNDlmZTk5MWMyMzQwOWRkOWFjNWJiOWJiYTAz
NDhlOTE3Li40NTUwZGM4YjQyMjBkOTIxYTJjOGViMjU4YWJmYjI5YWFkOTRiYzkzIDEwMDY0NAot
LS0gYS9Ub29scy9DaGFuZ2VMb2cKKysrIGIvVG9vbHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTUg
QEAKKzIwMTEtMDgtMjQgIEphbWVzIFJvYmluc29uICA8amFtZXNyQGNocm9taXVtLm9yZz4KKwor
ICAgICAgICBbY2hyb21pdW1dIFN0YWNrdHJhY2Ugbm90IGluIHRlc3Qgb3V0cHV0IHdoZW4gYSB0
ZXN0IGNyYXNoZXMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dp
P2lkPTY2ODA2CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAg
ICAgQXBwZW5kcyB0aGUgLmVycm9yIGFuZCAudGV4dCBvdXRwdXQgd2hlbiBhIHRlc3QgY3Jhc2hl
cyBzaW5jZSBvbiBjaHJvbWl1bSB0aGUgLnRleHQgY29udGFpbnMgdGhlIGFjdHVhbCBzdGFjawor
ICAgICAgICB0cmFjZS4KKworICAgICAgICAqIFNjcmlwdHMvd2Via2l0cHkvbGF5b3V0X3Rlc3Rz
L2xheW91dF9wYWNrYWdlL3Rlc3RfcmVzdWx0X3dyaXRlci5weToKKwogMjAxMS0wOC0yNCAgQWRh
b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C5lcnJvciArIHN0cihkcml2ZXJfb3V0cHV0LnRleHQpKQogICAgICAgICBlbGlmIGlzaW5zdGFu
Y2UoZmFpbHVyZSwgdGVzdF9mYWlsdXJlcy5GYWlsdXJlUmVmdGVzdE1pc21hdGNoKToKICAgICAg
ICAgICAgIHdyaXRlci53cml0ZV9pbWFnZV9maWxlcyhkcml2ZXJfb3V0cHV0LmltYWdlLCBleHBl
Y3RlZF9kcml2ZXJfb3V0cHV0LmltYWdlKQogICAgICAgICAgICAgIyBGSVhNRTogVGhpcyB3b3Jr
IHNob3VsZCBiZSBkb25lIGVhcmxpZXIgaW4gdGhlIHBpcGVsaW5lIChlLmcuLCB3aGVuIHdlIGNv
bXBhcmUgaW1hZ2VzIGZvciBub24tcmVmIHRlc3RzKS4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>105092</attachid>
            <date>2011-08-24 16:20:44 -0700</date>
            <delta_ts>2011-08-24 18:02:15 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-66806-20110824161845.patch</filename>
            <type>text/plain</type>
            <size>1819</size>
            <attacher name="James Robinson">jamesr</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTM3NDIKZGlmZiAtLWdpdCBhL1Rvb2xzL0NoYW5nZUxvZyBi
L1Rvb2xzL0NoYW5nZUxvZwppbmRleCBmZGRlMTRkNDlmZTk5MWMyMzQwOWRkOWFjNWJiOWJiYTAz
NDhlOTE3Li42NjUzZWUyMTFkMTRmZDk5Zjc2ZTViNmM4YTZlMzg3NzZmNmZhZGE1IDEwMDY0NAot
LS0gYS9Ub29scy9DaGFuZ2VMb2cKKysrIGIvVG9vbHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTUg
QEAKKzIwMTEtMDgtMjQgIEphbWVzIFJvYmluc29uICA8amFtZXNyQGNocm9taXVtLm9yZz4KKwor
ICAgICAgICBbY2hyb21pdW1dIFN0YWNrdHJhY2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JpdmVyKERyaXZlcik6CiAgICAgICAgICAgICBpZiBub3QgdGV4dDoK
ICAgICAgICAgICAgICAgICB0ZXh0ID0gTm9uZQogCisgICAgICAgIGVycm9yID0gJycuam9pbihl
cnJvcikKKyAgICAgICAgIyBDdXJyZW50bHkgdGhlIHN0YWNrdHJhY2UgaXMgaW4gdGhlIHRleHQg
b3V0cHV0LCBub3QgZXJyb3IsIHNvIGFwcGVuZCB0aGUgdHdvIHRvZ2V0aGVyIHNvCisgICAgICAg
ICMgdGhhdCB3ZSBjYW4gc2VlIHN0YWNrIGluIHRoZSBvdXRwdXQuIFNlZSBodHRwOi8vd2Via2l0
Lm9yZy9iLzY2ODA2CisgICAgICAgICMgRklYTUU6IFdlIHJlYWxseSBzaG91bGQgcHJvcGVybHkg
aGFuZGxlIHRoZSBzdGRlcnIgb3V0cHV0IHNlcGFyYXRlbHkuCisgICAgICAgIGlmIGNyYXNoOgor
ICAgICAgICAgICAgZXJyb3IgPSBlcnJvciArIHN0cih0ZXh0KQorCiAgICAgICAgIHJldHVybiBE
cml2ZXJPdXRwdXQodGV4dCwgb3V0cHV0X2ltYWdlLCBhY3R1YWxfY2hlY2tzdW0sIGF1ZGlvPWF1
ZGlvX2J5dGVzLAotICAgICAgICAgICAgY3Jhc2g9Y3Jhc2gsIHRlc3RfdGltZT1ydW5fdGltZSwg
dGltZW91dD10aW1lb3V0LCBlcnJvcj0nJy5qb2luKGVycm9yKSkKKyAgICAgICAgICAgIGNyYXNo
PWNyYXNoLCB0ZXN0X3RpbWU9cnVuX3RpbWUsIHRpbWVvdXQ9dGltZW91dCwgZXJyb3I9ZXJyb3Ip
CiAKICAgICBkZWYgc3RvcChzZWxmKToKICAgICAgICAgaWYgbm90IHNlbGYuX3Byb2M6Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>