<?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>91181</bug_id>
          
          <creation_ts>2012-07-12 18:46:51 -0700</creation_ts>
          <short_desc>nrwt: don&apos;t choke when printing invalid utf-8 to stderr</short_desc>
          <delta_ts>2012-07-13 01:23:36 -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="David Grogan">dgrogan</reporter>
          <assigned_to name="David Grogan">dgrogan</assigned_to>
          <cc>abarth</cc>
    
    <cc>alecflett</cc>
    
    <cc>dpranke</cc>
    
    <cc>jsbell</cc>
    
    <cc>ojan</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>668492</commentid>
    <comment_count>0</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2012-07-12 18:46:51 -0700</bug_when>
    <thetext>This seems to only reproduce on one of my branches, so I&apos;ve probably introduced an error that interacts badly with the recent nrwt changes.  Though I have no changes in Tools, just Source. Dirk, if you could try to glean some hints about a possible nrwt bug from this stacktrace, I&apos;d appreciate it.

$ new-run-webkit-tests -f --debug --no-new-test-results --no-retry-failures storage/indexeddb

    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/message_pool.py&quot;, line 242, in run
      worker.handle(message.name, message.src, *message.args)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 81, in handle
      self._run_test(test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 104, in _run_test
      result = self._run_test_with_timeout(test_input, test_timeout_sec)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 146, in _run_test_with_timeout
      return self._run_test_in_this_thread(test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 231, in _run_test_in_this_thread
      return self._run_single_test(self._driver, test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 235, in _run_single_test
      test_input, driver, self._name)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 46, in run_single_test
      return runner.run()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 105, in run
      return self._run_compare_test()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 118, in _run_compare_test
      test_result_writer.write_test_result(self._filesystem, self._port, self._test_name, driver_output, expected_driver_output, test_result.failures)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 45, in write_test_result
      writer.write_stderr(driver_output.error)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 163, in write_stderr
      self._write_text_file(filename, error)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 136, in _write_text_file
      self._filesystem.write_text_file(path, contents)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem.py&quot;, line 226, in write_text_file
      f.write(contents)
    File &quot;/usr/lib/python2.6/codecs.py&quot;, line 686, in write
      return self.writer.write(data)
    File &quot;/usr/lib/python2.6/codecs.py&quot;, line 351, in write
      data, consumed = self.encode(object, self.errors)
worker/12 raised UnicodeDecodeError(&apos;&apos;ascii&apos; codec can&apos;t decode byte 0xef in position 914: ordinal not in range(128)&apos;):
Exception raised, exiting</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668499</commentid>
    <comment_count>1</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-07-12 18:57:02 -0700</bug_when>
    <thetext>the stack trace is saying that you printed something to stderr from DRT/WebKit that isn&apos;t a valid utf-8 codepoint, specifically a byte with value 0xef. Does that help?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668519</commentid>
    <comment_count>2</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2012-07-12 19:24:19 -0700</bug_when>
    <thetext>Ah to stderr. Yes, there is a printf that prints invalid characters when running storage/indexeddb/odd-strings.html. Indeed, running odd-strings.html alone causes an exception. Though this just started happening today, at 122505.  Before then, running new-run-webkit-tests --debug storage/indexeddb/odd-strings.html succeeds.  After 122505, I get the stack trace below (practically the same as the first).  Any chance of making nrwt tolerate the unprintable characters?

$ new-run-webkit-tests --debug storage/indexeddb/odd-strings.html
Exception raised, exiting       
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 129, in run
      unexpected_result_count = manager.run()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 866, in run
      interrupted, keyboard_interrupted, thread_timings, test_timings, individual_test_timings = self._run_tests(self._test_files_list, result_summary, int(self._options.child_processes))
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 777, in _run_tests
      pool.run((&apos;test_list&apos;, shard.name, shard.test_inputs) for shard in all_shards)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/message_pool.py&quot;, line 97, in run
      self.wait()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/message_pool.py&quot;, line 117, in wait
      self._workers[0].run()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/message_pool.py&quot;, line 242, in run
      worker.handle(message.name, message.src, *message.args)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 81, in handle
      self._run_test(test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 104, in _run_test
      result = self._run_test_with_timeout(test_input, test_timeout_sec)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 146, in _run_test_with_timeout
      return self._run_test_in_this_thread(test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 231, in _run_test_in_this_thread
      return self._run_single_test(self._driver, test_input)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py&quot;, line 235, in _run_single_test
      test_input, driver, self._name)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 46, in run_single_test
      return runner.run()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 105, in run
      return self._run_compare_test()
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py&quot;, line 118, in _run_compare_test
      test_result_writer.write_test_result(self._filesystem, self._port, self._test_name, driver_output, expected_driver_output, test_result.failures)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 45, in write_test_result
      writer.write_stderr(driver_output.error)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 163, in write_stderr
      self._write_text_file(filename, error)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 136, in _write_text_file
      self._filesystem.write_text_file(path, contents)
    File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem.py&quot;, line 226, in write_text_file
      f.write(contents)
    File &quot;/usr/lib/python2.6/codecs.py&quot;, line 686, in write
      return self.writer.write(data)
    File &quot;/usr/lib/python2.6/codecs.py&quot;, line 351, in write
      data, consumed = self.encode(object, self.errors)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668526</commentid>
    <comment_count>3</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-07-12 19:38:25 -0700</bug_when>
    <thetext>As a workaround, all you need to do is change:

File &quot;/sdb1/chrome/1/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py&quot;, line 163, in write_stderr
      self._write_text_file(filename, error)
   
to self._write_binary_file(filename, error)

this would probably be a reasonable change to make, period. I don&apos;t think we have a strong requirement that stderr is utf-8 :).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668539</commentid>
    <comment_count>4</comment_count>
      <attachid>152137</attachid>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2012-07-12 19:56:45 -0700</bug_when>
    <thetext>Created attachment 152137
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668543</commentid>
    <comment_count>5</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2012-07-12 19:57:38 -0700</bug_when>
    <thetext>Dirk, could you review this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668547</commentid>
    <comment_count>6</comment_count>
      <attachid>152137</attachid>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-07-12 20:09:37 -0700</bug_when>
    <thetext>Comment on attachment 152137
Patch

yes, I can :).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668717</commentid>
    <comment_count>7</comment_count>
      <attachid>152137</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-07-13 01:23:31 -0700</bug_when>
    <thetext>Comment on attachment 152137
Patch

Clearing flags on attachment: 152137

Committed r122551: &lt;http://trac.webkit.org/changeset/122551&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>668718</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-07-13 01:23:36 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>152137</attachid>
            <date>2012-07-12 19:56:45 -0700</date>
            <delta_ts>2012-07-13 01:23:31 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-91181-20120712195644.patch</filename>
            <type>text/plain</type>
            <size>1477</size>
            <attacher name="David Grogan">dgrogan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIyNTE1CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggZDc5ZDA1MWMxZTQ5M2JkZDlhOTc2Y2FjMWZkY2RiMmRh
Zm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