<?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>17948</bug_id>
          
          <creation_ts>2008-03-19 07:06:16 -0700</creation_ts>
          <short_desc>Exception in -[WebDataSource webArchive]</short_desc>
          <delta_ts>2008-11-25 13:47:30 -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 API</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</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>0</everconfirmed>
          <reporter name="Michael Tsai">mjt</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>74432</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Tsai">mjt</who>
    <bug_when>2008-03-19 07:06:16 -0700</bug_when>
    <thetext>I&apos;ve seen several cases where WebKit raises an exception:

-[NSCFArray insertObject:atIndex:]: attempt to insert nil

when my code calls [[[webView mainFrame] dataSource] webArchive]. I&apos;ve been able to reproduce this only rarely on my Mac, but I have a customer for whom it happens 100% of the time, no matter the page.

As far as I can tell, the exception is being raised in -[WebDataSource subresources]. It looks like the WebResource that&apos;s being created in the loop is returning nil from its -init method. While there may be an interesting and significant reason for that, I suggest that -subresources refrain from adding nil objects to the array so that at least a partial Web archive can be returned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100038</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-11-24 13:28:18 -0800</bug_when>
    <thetext>Does your customer have any third-party &quot;extensions&quot; (haxies, input managers, etc.) installed for Safari?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100049</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Tsai">mjt</who>
    <bug_when>2008-11-24 13:41:11 -0800</bug_when>
    <thetext>No.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100140</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-11-24 20:15:58 -0800</bug_when>
    <thetext>Could you have the customer recreate the crash and post a crash log to this bug?  If you would prefer not to post a crash log of your application here, please create a bug using &lt;https://bugreport.apple.com/&gt; and report the 7-digit bug number here.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100205</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Tsai">mjt</who>
    <bug_when>2008-11-25 06:19:35 -0800</bug_when>
    <thetext>It&apos;s not crashing for the customer, just raising an exception that&apos;s caught in my code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100228</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-11-25 10:16:58 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; It&apos;s not crashing for the customer, just raising an exception that&apos;s caught in
&gt; my code.

Is there any way you could provide a stack trace when the exception is caught?  Can you provide a reproducible test case using a local copy of the customer&apos;s web page?

BTW, what revision(s) of WebKit are you using?  Does this work on a nightly WebKit build?

After re-reading the description, this sounds related to Bug 22466.  I think the code in WebKit -[WebDataSource subresources] has moved to DocumentLoader::subresources() in tip-of-tree (ToT) WebKit, though.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100242</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Tsai">mjt</who>
    <bug_when>2008-11-25 11:16:14 -0800</bug_when>
    <thetext>One of the problem Web pages was:

http://www.faqts.com/knowledge_base/index.phtml/fid/199/

I am no longer able to reproduce the problem using the WebKit from Safari 3.2.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100244</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-11-25 11:26:46 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; One of the problem Web pages was:
&gt; 
&gt; http://www.faqts.com/knowledge_base/index.phtml/fid/199/
&gt; 
&gt; I am no longer able to reproduce the problem using the WebKit from Safari
&gt; 3.2.1.

Can this bug be closed then?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100261</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Tsai">mjt</who>
    <bug_when>2008-11-25 12:29:34 -0800</bug_when>
    <thetext>Yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100271</commentid>
    <comment_count>9</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-11-25 13:47:30 -0800</bug_when>
    <thetext>See also Bug 17151.

Closing per Comment #8.

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>