<?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>43565</bug_id>
          
          <creation_ts>2010-08-05 10:49:54 -0700</creation_ts>
          <short_desc>new-run-webkit-tests: Every few runs, Windows Tests hang indefinitely somewhere in Python guts</short_desc>
          <delta_ts>2011-03-18 18:23:28 -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>PC</rep_platform>
          <op_sys>Windows Vista</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>
          <dependson>49566</dependson>
          <blocked>34984</blocked>
    
    <blocked>38023</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dimitri Glazkov (Google)">dglazkov</reporter>
          <assigned_to name="Dirk Pranke">dpranke</assigned_to>
          <cc>dpranke</cc>
    
    <cc>eric</cc>
    
    <cc>evan</cc>
    
    <cc>tkent</cc>
    
    <cc>victorw</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>260693</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-08-05 10:49:54 -0700</bug_when>
    <thetext>It runs a few runs, then hangs to the point where it just sits there, periodically spewing exceptions: 

http://build.webkit.org/builders/Chromium%20Win%20Release%20(Tests)/builds/1004/steps/layout-test/logs/stdio

Here is the stack trace (sic on partially eaten output), which keeps repeating over and over throughout the run:

ut_tests\layout_package\dump_render_tree_thread.py&quot;, line 333, in _run
  result = self._run_test(test_info)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 437, in _run_test
  self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 374, in run_test
  (line, crash) = self._write_command_and_read_line(input=cmd)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 347, in _write_command_and_read_line
  line = self._proc.stdout.readline()

# Thread: 19804
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 499, in __bootstrap
  self.__bootstrap_inner()
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 527, in __bootstrap_inner
  self.run()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 258, in run
  self._run(test_runner=None, result_summary=None)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 333, in _run
  result = self._run_test(test_info)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 437, in _run_test
  self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 374, in run_test
  (line, crash) = self._write_command_and_read_line(input=cmd)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 347, in _write_command_and_read_line
  line = self._proc.stdout.readline()

# Thread: 17884
File: &quot;./WebKitTools/Scripts/new-run-webkit-tests&quot;, line 38, in &lt;module&gt;
  sys.exit(run_webkit_tests.main())
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 1677, in main
  return run(port_obj, options, args)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 1441, in run
  num_unexpected_results = test_runner.run(result_summary)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 759, in run
  self._run_tests(self._test_files_list, result_summary))
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 699, in _run_tests
  self._dump_thread_states_if_necessary()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 652, in _dump_thread_states_if_necessary
  self._dump_thread_states()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 637, in _dump_thread_states
  for filename, lineno, name, line in traceback.extract_stack(stack):

# Thread: 19528
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 499, in __bootstrap
  self.__bootstrap_inner()
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 527, in __bootstrap_inner
  self.run()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 258, in run
  self._run(test_runner=None, result_summary=None)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 333, in _run
  result = self._run_test(test_info)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 444, in _run_test
  output, error)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 107, in process_output
  configuration)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\test_types\text_diff.py&quot;, line 110, in compare_output
  print_text_diffs=True)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\test_types\test_type_base.py&quot;, line 217, in write_output_files
  pretty_patch = port.pretty_patch_text(diff_filename)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\base.py&quot;, line 624, in pretty_patch_text
  return self._executive.run_command(command, decode_output=False)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\common\system\executive.py&quot;, line 293, in run_command
  output = process.communicate(string_to_communicate)[0]
File: &quot;c:\depot_tools\python_bin\lib\subprocess.py&quot;, line 660, in communicate
  self.wait()
File: &quot;c:\depot_tools\python_bin\lib\subprocess.py&quot;, line 845, in wait
  obj = WaitForSingleObject(self._handle, INFINITE)

# Thread: 17884
File: &quot;./WebKitTools/Scripts/new-run-webkit-tests&quot;, line 38, in &lt;module&gt;
  sys.exit(run_webkit_tests.main())
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 1677, in main
  return run(port_obj, options, args)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 1441, in run
  num_unexpected_results = test_runner.run(result_summary)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 759, in run
  self._run_tests(self._test_files_list, result_summary))
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 699, in _run_tests
  self._dump_thread_states_if_necessary()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 652, in _dump_thread_states_if_necessary
  self._dump_thread_states()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 637, in _dump_thread_states
  for filename, lineno, name, line in traceback.extract_stack(stack):

# Thread: 19804
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 499, in __bootstrap
  self.__bootstrap_inner()
File: &quot;c:\depot_tools\python_bin\lib\threading.py&quot;, line 527, in __bootstrap_inner
  self.run()
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 258, in run
  self._run(test_runner=None, result_summary=None)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 333, in _run
  result = self._run_test(test_info)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\layout_package\dump_render_tree_thread.py&quot;, line 437, in _run_test
  self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 374, in run_test
  (line, crash) = self._write_command_and_read_line(input=cmd)
File: &quot;D:\google-windows-2\chromium-win-release-tests\build\WebKitTools\Scripts\webkitpy\layout_tests\port\chromium.py&quot;, line 347, in _write_command_and_read_line
  line = self._proc.stdout.readline()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260706</commentid>
    <comment_count>1</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-08-05 11:07:28 -0700</bug_when>
    <thetext>_dump_thread_states_if_necessary bits are just the code that is dumping the current state of the world for debugging purposes, right?

So it&apos;s hanging in the subprocess stdout read.
That probably indicates stdout buffering.

What is the subprocess?
If it&apos;s C code, see &quot;man 3 setvbuf&quot; (set it to line buffering).
If it&apos;s Python code, do something like
  sys.stdout = os.fdopen(1, &apos;w&apos;, 1)  # last arg of 1 means line buffering</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260714</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2010-08-05 11:23:48 -0700</bug_when>
    <thetext>This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
mac specific, and the cause is believed to be well-understood). Assigning to me.

Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
buffer causes the threads to deadlock.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260727</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-08-05 11:33:49 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
&gt; mac specific, and the cause is believed to be well-understood). Assigning to me.
&gt; 
&gt; Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
&gt; buffer causes the threads to deadlock.

Thanks Dirk! Another thing of note: when I go kill processes to clean up this mess, I also see ruby.exe running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260736</commentid>
    <comment_count>4</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2010-08-05 11:44:53 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
&gt; &gt; mac specific, and the cause is believed to be well-understood). Assigning to me.
&gt; &gt; 
&gt; &gt; Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
&gt; &gt; buffer causes the threads to deadlock.
&gt; 
&gt; Thanks Dirk! Another thing of note: when I go kill processes to clean up this mess, I also see ruby.exe running.

Yeah, the ruby.exe comes from the pretty diff ; it is definitely one of the culprits.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260786</commentid>
    <comment_count>5</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-08-05 12:49:54 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
&gt; &gt; &gt; mac specific, and the cause is believed to be well-understood). Assigning to me.
&gt; &gt; &gt; 
&gt; &gt; &gt; Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
&gt; &gt; &gt; buffer causes the threads to deadlock.
&gt; &gt; 
&gt; &gt; Thanks Dirk! Another thing of note: when I go kill processes to clean up this mess, I also see ruby.exe running.
&gt; 
&gt; Yeah, the ruby.exe comes from the pretty diff ; it is definitely one of the culprits.

Cool. This time when it hang, it was wdiff.exe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260879</commentid>
    <comment_count>6</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-08-05 14:47:15 -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; (In reply to comment #2)
&gt; &gt; &gt; &gt; This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
&gt; &gt; &gt; &gt; mac specific, and the cause is believed to be well-understood). Assigning to me.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
&gt; &gt; &gt; &gt; buffer causes the threads to deadlock.
&gt; &gt; &gt; 
&gt; &gt; &gt; Thanks Dirk! Another thing of note: when I go kill processes to clean up this mess, I also see ruby.exe running.
&gt; &gt; 
&gt; &gt; Yeah, the ruby.exe comes from the pretty diff ; it is definitely one of the culprits.
&gt; 
&gt; Cool. This time when it hang, it was wdiff.exe.

BTW, killing just ruby.exe seemed to have unwedged the script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261516</commentid>
    <comment_count>7</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-08-06 15:13:58 -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; (In reply to comment #2)
&gt; &gt; &gt; &gt; &gt; This is almost certainly the same issue as bug 36622 and bug 38200 (which aren&apos;t actually
&gt; &gt; &gt; &gt; &gt; mac specific, and the cause is believed to be well-understood). Assigning to me.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Evan&apos;s right that the problem is caused by subprocess, but it&apos;s not so much stdout buffering as it is the fact that we&apos;re using PIPEs with a fixed buffer size (even on windows), and overflowing the
&gt; &gt; &gt; &gt; &gt; buffer causes the threads to deadlock.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Thanks Dirk! Another thing of note: when I go kill processes to clean up this mess, I also see ruby.exe running.
&gt; &gt; &gt; 
&gt; &gt; &gt; Yeah, the ruby.exe comes from the pretty diff ; it is definitely one of the culprits.
&gt; &gt; 
&gt; &gt; Cool. This time when it hang, it was wdiff.exe.
&gt; 
&gt; BTW, killing just ruby.exe seemed to have unwedged the script.

Also, installing non-cygwin ruby helped a lot. It hasn&apos;t hung in the last 12 runs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370058</commentid>
    <comment_count>8</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2011-03-18 18:23:28 -0700</bug_when>
    <thetext>I&apos;m closing this ... I assume this has been fixed since we run DRT by default these days.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>