<?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>182882</bug_id>
          
          <creation_ts>2018-02-16 13:28:45 -0800</creation_ts>
          <short_desc>[Cocoa][WebKitLegacy] REGRESSION(r221559): Coda 2 crashes when switching views</short_desc>
          <delta_ts>2018-02-16 13:57:16 -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>WebKit Misc.</component>
          <version>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>aestes</cc>
    
    <cc>bfulgham</cc>
    
    <cc>darin</cc>
    
    <cc>mitz</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1399997</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-02-16 13:28:45 -0800</bug_when>
    <thetext>The refactoring in Bug 176280 caused WebKit to attempt to message destroyed objects in WebKitLegacy applications.

A loop was moved (and rewritten) in the new implementation of (void)_web_makePluginSubviewsPerformSelector:(SEL)selector withObject:(id)object

The new code access subviews, copied them, placed them in a smart pointer, then retrieved the bare pointer for use in the Objective C iteration:

    for (NSView *view in adoptNS([[self subviews] copy]).get()) { ... }

This caused the collection being iterated over to be cleaned up during the loop, resulting in a crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1399999</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-02-16 13:28:56 -0800</bug_when>
    <thetext>&lt;rdar://problem/35672661&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400002</commentid>
    <comment_count>2</comment_count>
      <attachid>334064</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-02-16 13:32:28 -0800</bug_when>
    <thetext>Created attachment 334064
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400015</commentid>
    <comment_count>3</comment_count>
      <attachid>334064</attachid>
    <who name="">mitz</who>
    <bug_when>2018-02-16 13:52:46 -0800</bug_when>
    <thetext>Comment on attachment 334064
Patch

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

&gt; Source/WebKitLegacy/mac/WebView/WebHTMLView.mm:1430
&gt; +    auto subViewsCopy = adoptNS([self.subviews copy]);

Lowercase v.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400020</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-02-16 13:56:18 -0800</bug_when>
    <thetext>Committed r228580: &lt;https://trac.webkit.org/changeset/228580&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400022</commentid>
    <comment_count>5</comment_count>
      <attachid>334064</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-02-16 13:57:16 -0800</bug_when>
    <thetext>Comment on attachment 334064
Patch

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

&gt;&gt; Source/WebKitLegacy/mac/WebView/WebHTMLView.mm:1430
&gt;&gt; +    auto subViewsCopy = adoptNS([self.subviews copy]);
&gt; 
&gt; Lowercase v.

Will do! Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>334064</attachid>
            <date>2018-02-16 13:32:28 -0800</date>
            <delta_ts>2018-02-16 13:52:46 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-182882-20180216133227.patch</filename>
            <type>text/plain</type>
            <size>1657</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXRMZWdhY3kvbWFjL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBT
b3VyY2UvV2ViS2l0TGVnYWN5L21hYy9DaGFuZ2VMb2cJKHJldmlzaW9uIDIyODU3NCkKKysrIFNv
dXJjZS9XZWJLaXRMZWdhY3kvbWFjL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsx
LDE3IEBACisyMDE4LTAyLTE2ICBCcmVudCBGdWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgor
CisgICAgICAgIFtDb2NvYV1bV2ViS2l0TGVnYWN5XSBSRUdSRVNTSU9OKHIyMjE1NTkpOiBDb2Rh
IDIgY3Jhc2hlcyB3aGVuIHN3aXRjaGluZyB2aWV3cworICAgICAgICBodHRwczovL2J1Z3Mud2Vi
a2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTgyODgyCisgICAgICAgIDxyZGFyOi8vcHJvYmxlbS8z
NTY3MjY2MT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBNYWtlIHN1cmUgdGhlIHNtYXJ0IHBvaW50ZXIgaG9sZCB0aGUgY29sbGVjdGlvbiBvZiBzdWJ2
aWV3cyBsaXZlcyBhdCBsZWFzdCBhcworICAgICAgICBsb25nIGFzIHRoZSBsb29wIHVzaW5nIGl0
LgorCisgICAgICAgICogV2ViVm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weV0pOworICAgIGZvciAoTlNW
aWV3ICp2aWV3IGluIHN1YlZpZXdzQ29weS5nZXQoKSkgewogICAgICAgICBpZiAoW3ZpZXcgaXNL
aW5kT2ZDbGFzczpbV2ViQmFzZU5ldHNjYXBlUGx1Z2luVmlldyBjbGFzc11dKQogICAgICAgICAg
ICAgW3ZpZXcgcGVyZm9ybVNlbGVjdG9yOnNlbGVjdG9yIHdpdGhPYmplY3Q6b2JqZWN0XTsKICAg
ICB9Cg==
</data>
<flag name="review"
          id="352868"
          type_id="1"
          status="+"
          setter="mitz"
    />
          </attachment>
      

    </bug>

</bugzilla>