<?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>178402</bug_id>
          
          <creation_ts>2017-10-17 11:21:07 -0700</creation_ts>
          <short_desc>REGRESSION (r222709): webkitpy: Hang when workers write to the same stack trace file</short_desc>
          <delta_ts>2017-11-29 10:16:12 -0800</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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=178368</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=176393</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>176393</dependson>
    
    <dependson>178587</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Bedard">jbedard</reporter>
          <assigned_to name="Jonathan Bedard">jbedard</assigned_to>
          <cc>aakash_jain</cc>
    
    <cc>ap</cc>
    
    <cc>buildbot</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dbates</cc>
    
    <cc>glenn</cc>
    
    <cc>lforschler</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1361322</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2017-10-17 11:21:07 -0700</bug_when>
    <thetext>There is a hang when workers write their stack traces to the same file if that file already exists on disk.  This is the root cause of the more general issue addressed in &lt;https://bugs.webkit.org/show_bug.cgi?id=178368&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361325</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-17 11:21:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/35033432&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361328</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2017-10-17 11:22:06 -0700</bug_when>
    <thetext>If we add a pid to the name of the stack-trace, the problem stops.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361341</commentid>
    <comment_count>3</comment_count>
      <attachid>324035</attachid>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2017-10-17 11:45:32 -0700</bug_when>
    <thetext>Created attachment 324035
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361354</commentid>
    <comment_count>4</comment_count>
      <attachid>324035</attachid>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2017-10-17 12:14:12 -0700</bug_when>
    <thetext>Comment on attachment 324035
Patch

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

&gt; Tools/Scripts/webkitpy/common/interupt_debugging.py:47
&gt; +        file_name = os.path.join(os.path.dirname(output_file), &apos;{}-{}&apos;.format(os.getpid(), os.path.basename(output_file))) if output_file else None

Is it guaranteed that we won&apos;t have file name collision after adding os.getpid() ?
Maybe we can add timestamp in filename instead of pid to make it unique, it would also make it easy to sort these files into the directory having multiple such files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361375</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2017-10-17 13:02:47 -0700</bug_when>
    <thetext>(In reply to Aakash Jain from comment #4)
&gt; Comment on attachment 324035 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=324035&amp;action=review
&gt; 
&gt; &gt; Tools/Scripts/webkitpy/common/interupt_debugging.py:47
&gt; &gt; +        file_name = os.path.join(os.path.dirname(output_file), &apos;{}-{}&apos;.format(os.getpid(), os.path.basename(output_file))) if output_file else None
&gt; 
&gt; Is it guaranteed that we won&apos;t have file name collision after adding
&gt; os.getpid() ?
&gt; Maybe we can add timestamp in filename instead of pid to make it unique, it
&gt; would also make it easy to sort these files into the directory having
&gt; multiple such files.

It&apos;s guaranteed that we won&apos;t have a file name collision inside a single test run.

Overwriting an existing file with the same name is perfectly fine.  I don&apos;t think timestamp is a good way to achieve this because it is possible (likely, in fact) that workers will generate timestamps very close to or even equal to their sibling workers since they will all receive the SIGTERM at the same time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361387</commentid>
    <comment_count>6</comment_count>
      <attachid>324035</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-17 13:30:21 -0700</bug_when>
    <thetext>Comment on attachment 324035
Patch

Clearing flags on attachment: 324035

Committed r223572: &lt;https://trac.webkit.org/changeset/223572&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361388</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-17 13:30:23 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362708</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-20 09:06:59 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 178587</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362718</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-10-20 09:14:28 -0700</bug_when>
    <thetext>This didn&apos;t help, at least not enough. Re-fixed by rolling back both r222709 and r223572.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1375887</commentid>
    <comment_count>10</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2017-11-29 10:16:12 -0800</bug_when>
    <thetext>Note that this change is now part of the patch up for review in &lt;https://bugs.webkit.org/show_bug.cgi?id=176393&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>324035</attachid>
            <date>2017-10-17 11:45:32 -0700</date>
            <delta_ts>2017-10-17 13:30:21 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-178402-20171017114531.patch</filename>
            <type>text/plain</type>
            <size>3368</size>
            <attacher name="Jonathan Bedard">jbedard</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDIyMzU1OCkKKysrIFRvb2xzL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwz
ICsxLDE5IEBACisyMDE3LTEwLTE3ICBKb25hdGhhbiBCZWRhcmQgIDxqYmVkYXJkQGFwcGxlLmNv
bT4KKworICAgICAgICB3ZWJraXRweTogSGFuZyB3aGVuIHdvcmtlcnMgd3JpdGUgdG8gdGhlIHNh
bWUgc3RhY2sgdHJhY2UgZmlsZQorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93
X2J1Zy5jZ2k/aWQ9MTc4NDAyCisgICAgICAgIDxyZGFyOi8vcHJvYmxlbS8zNTAzMzQzMj4KKwor
ICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXb3JrZXJzIGNh
biBoYW5nIGlmIHRoZXkgYWxsIHdyaXRlIHRvIHRoZSBzYW1lIHN0YWNrI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AgICAgcmFpc2UgUnVudGlt
ZUVycm9yKCd7fSBjYW5ub3QgYmUgb3BlbmVkJy5mb3JtYXQob3V0cHV0X2ZpbGUpKQorICAgICAg
ICAgICAgcmFpc2UgUnVudGltZUVycm9yKCd7fSBjYW5ub3QgYmUgb3BlbmVkJy5mb3JtYXQoZmls
ZV9uYW1lKSkKIAogICAgICAgICBpZiBmaWxlIGlzIHN5cy5zdGRlcnI6CiAgICAgICAgICAgICBm
aWxlLndyaXRlKCdcbicpCiAgICAgICAgIGVsc2U6Ci0gICAgICAgICAgICBfbG9nLmNyaXRpY2Fs
KCdTdGFjayB0cmFjZSBzYXZlZCB0byB7fScuZm9ybWF0KG91dHB1dF9maWxlKSkKKyAgICAgICAg
ICAgIF9sb2cuY3JpdGljYWwoJ1N0YWNrIHRyYWNlIHNhdmVkIHRvIHt9Jy5mb3JtYXQoZmlsZV9u
YW1lKSkKICAgICAgICAgZmlsZS53cml0ZSgnY250cmwgQyByZWNlaXZlZFxuJykKICAgICAgICAg
bG9nX3N0YWNrX3RyYWNlKGZyYW1lLCBmaWxlKQogICAgICAgICByYWlzZSBLZXlib2FyZEludGVy
cnVwdAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>