<?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>75012</bug_id>
          
          <creation_ts>2011-12-21 09:58:24 -0800</creation_ts>
          <short_desc>Exception thrown when running WKBrowsingContextLoadDelegateTest.SimpleLoad test</short_desc>
          <delta_ts>2011-12-21 11:08: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>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.7</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="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          <cc>andersca</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>525301</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-12-21 09:58:24 -0800</bug_when>
    <thetext>To reproduce:

1. build-api-tests --debug
2. run-test-webkit-api --debug

You&apos;ll see something like this:

[ RUN      ] WKBrowsingContextLoadDelegateTest.SimpleLoad
2011-12-21 12:56:16.300 TestWebKitAPI[15727:f07] -[WKBrowsingContextGroupData delegate]: unrecognized selector sent to instance 0x7fc25b916900
2011-12-21 12:56:16.301 TestWebKitAPI[15727:f07] An uncaught exception was raised
2011-12-21 12:56:16.301 TestWebKitAPI[15727:f07] -[WKBrowsingContextGroupData delegate]: unrecognized selector sent to instance 0x7fc25b916900
2011-12-21 12:56:16.308 TestWebKitAPI[15727:f07] (
	0   CoreFoundation                      0x00007fff8dc9f476 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff86c515a6 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff8dd3254a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
	3   CoreFoundation                      0x00007fff8dc8d3e6 ___forwarding___ + 358
	4   CoreFoundation                      0x00007fff8dc8d208 _CF_forwarding_prep_0 + 232
	5   WebKit2                             0x000000010f5e568d _ZL19didCreateConnectionPK15OpaqueWKContextPK18OpaqueWKConnectionPKv + 61
	6   WebKit2                             0x000000010f5e9016 _ZN6WebKit26WebContextConnectionClient19didCreateConnectionEPNS_10WebContextEPNS_13WebConnectionE + 102
	7   WebKit2                             0x000000010f3659d6 _ZN6WebKit10WebContext25processDidFinishLaunchingEPNS_15WebProcessProxyE + 438
	8   WebKit2                             0x000000010f42e783 _ZN6WebKit15WebProcessProxy18didFinishLaunchingEj + 419
	9   WebKit2                             0x000000010f42e5cf _ZN6WebKit15WebProcessProxy18didFinishLaunchingEPNS_15ProcessLauncherEj + 31
	10  WebKit2                             0x000000010f42e7c5 _ZThn56_N6WebKit15WebProcessProxy18didFinishLaunchingEPNS_15ProcessLauncherEj + 53
	11  WebKit2                             0x000000010f34c8b3 _ZN6WebKit15ProcessLauncher25didFinishLaunchingProcessEij + 99
	12  WebKit2                             0x000000010f34e25c _ZN3WTF15FunctionWrapperIMN6WebKit15ProcessLauncherEFvijEEclEPS2_ij + 124
	13  WebKit2                             0x000000010f34e1cb _ZN3WTF17BoundFunctionImplINS_15FunctionWrapperIMN6WebKit15ProcessLauncherEFvijEEEFvPS3_ijEEclEv + 43
	14  WebKit2                             0x000000010f34f060 _ZN3WTF8FunctionIFvvEEclEv + 128
	15  WebKit2                             0x000000010f34ee47 _ZN7RunLoop11performWorkEv + 135
	16  WebKit2                             0x000000010f34ff80 _ZN7RunLoop11performWorkEPv + 96
	17  CoreFoundation                      0x00007fff8dc17531 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	18  CoreFoundation                      0x00007fff8dc16df5 __CFRunLoopDoSources0 + 245
	19  CoreFoundation                      0x00007fff8dc3d0ff __CFRunLoopRun + 799
	20  CoreFoundation                      0x00007fff8dc3ca89 CFRunLoopRunSpecific + 233
	21  Foundation                          0x00007fff8703246e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 268
	22  TestWebKitAPI                       0x000000010e9a549b _ZN13TestWebKitAPI4Util3runEPb + 139
	23  TestWebKitAPI                       0x000000010ea10ed4 _ZN49WKBrowsingContextLoadDelegateTest_SimpleLoad_Test8TestBodyEv + 276
	24  TestWebKitAPI                       0x000000010ea29fda _ZN7testing4Test3RunEv + 154
	25  TestWebKitAPI                       0x000000010ea2a91d _ZN7testing8internal12TestInfoImpl3RunEv + 189
	26  TestWebKitAPI                       0x000000010ea2b15d _ZN7testing8TestCase3RunEv + 205
	27  TestWebKitAPI                       0x000000010ea301b0 _ZN7testing8internal12UnitTestImpl11RunAllTestsEv + 736
	28  TestWebKitAPI                       0x000000010ea2fec9 _ZN7testing8UnitTest3RunEv + 25
	29  TestWebKitAPI                       0x000000010e9a5ff0 _ZN13TestWebKitAPI15TestsController3runEiPPc + 48
	30  TestWebKitAPI                       0x000000010e9a5e71 main + 113
	31  TestWebKitAPI                       0x000000010e9a5404 start + 52
	32  ???                                 0x0000000000000001 0x0 + 1
)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525306</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-12-21 10:06:56 -0800</bug_when>
    <thetext>The bug only occurs intermittently. Turning on zombies might make it easier to reproduce.

I suspect WKProcessGroup needs to clear the WKContextConnectionClient when it is destroyed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525308</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-12-21 10:07:12 -0800</bug_when>
    <thetext>Sometimes I just see a crash instead of an exception.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525312</commentid>
    <comment_count>3</comment_count>
      <attachid>120189</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-12-21 10:16:12 -0800</bug_when>
    <thetext>Created attachment 120189
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525314</commentid>
    <comment_count>4</comment_count>
      <attachid>120189</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-12-21 10:17:38 -0800</bug_when>
    <thetext>Comment on attachment 120189
Patch

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

&gt; Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:97
&gt; +    WKContextSetConnectionClient(self._contextRef, 0);

The rest of this file uses _data-&gt;_contextRef.get(). Not sure which is better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525315</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-12-21 10:19:13 -0800</bug_when>
    <thetext>Committed r103412: &lt;http://trac.webkit.org/changeset/103412&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525349</commentid>
    <comment_count>6</comment_count>
      <attachid>120189</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-12-21 11:08:12 -0800</bug_when>
    <thetext>Comment on attachment 120189
Patch

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

&gt;&gt; Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:97
&gt;&gt; +    WKContextSetConnectionClient(self._contextRef, 0);
&gt; 
&gt; The rest of this file uses _data-&gt;_contextRef.get(). Not sure which is better.

self._contextRef does one additional Objective-C method dispatch, so it’s slower</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>120189</attachid>
            <date>2011-12-21 10:16:12 -0800</date>
            <delta_ts>2011-12-21 11:08:12 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-75012-20111221101617.patch</filename>
            <type>text/plain</type>
            <size>1158</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDEwMzQxMSkKKysrIFNvdXJjZS9XZWJLaXQyL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDExLTEyLTIxICBTYW0gV2Vp
bmlnICA8c2FtQHdlYmtpdC5vcmc+CisKKyAgICAgICAgRXhjZXB0aW9uIHRocm93biB3aGVuIHJ1
bm5pbmcgV0tCcm93c2luZ0NvbnRleHRMb2FkRGVsZWdhdGVUZXN0LlNpbXBsZUxvYWQgdGVzdAor
ICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NzUwMTIKKwor
ICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIFVJUHJvY2Vz
cy9BUEkvbWFjL1dLUHJvY2Vzc0dyb3VwLm1tOgorICAgICAgICAoLVtXS1Byb2Nlc3NHcm91cCBk
ZWFsbG9jXSk6CisgICAgICAgIENsZWFyIHRoZSBXS0NvbnRleHQncyBjb25uZWN0aW9uIGNsaWVu
dC4KKwogMjAxMS0xMi0yMSAgTWljaGFlbCBCcsO8bmluZyAgPG1pY2hhZWwuYnJ1bmluZ0Bub2tp
YS5jb20+CiAKICAgICAgICAgW1F0XVtXSzJdIEZpeCB0c3RfUVF1aWNrV2ViVmlldzo6c2Nyb2xs
UmVxdWVzdCgpIEFQSSB0ZXN0CkluZGV4OiBTb3VyY2UvV2ViS2l0Mi9VSVByb2Nlc3MvQVBJL21h
Yy9XS1Byb2Nlc3NHcm91cC5tbQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2ViS2l0Mi9VSVByb2Nl
c3MvQVBJL21hYy9XS1Byb2Nlc3NHcm91cC5tbQkocmV2aXNpb24gMTAzMzc1KQorKysgU291cmNl
L1dlYktpdDIvVUlQcm9jZXNzL0FQSS9tYWMvV0tQcm9jZXNzR3JvdXAubW0JKHdvcmtpbmcgY29w
eSkKQEAgLTk0LDYgKzk0LDggQEAgLSAoaWQpaW5pdFdpdGhJbmplY3RlZEJ1bmRsZVVSTDooTlNV
UkwgKgogCiAtICh2b2lkKWRlYWxsb2MKIHsKKyAgICBXS0NvbnRleHRTZXRDb25uZWN0aW9uQ2xp
ZW50KHNlbGYuX2NvbnRleHRSZWYsIDApOworCiAgICAgW19kYXRhIHJlbGVhc2VdOwogICAgIFtz
dXBlciBkZWFsbG9jXTsKIH0K
</data>
<flag name="review"
          id="120380"
          type_id="1"
          status="+"
          setter="aroben"
    />
          </attachment>
      

    </bug>

</bugzilla>