<?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>17655</bug_id>
          
          <creation_ts>2008-03-03 14:58:59 -0800</creation_ts>
          <short_desc>Reproducible crash calling querySelector on viewless Document</short_desc>
          <delta_ts>2008-05-20 12:18:01 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</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>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Rowe (bdash)">mrowe</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alex</cc>
    
    <cc>catfish.man</cc>
    
    <cc>jresig</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72617</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-03 14:58:59 -0800</bug_when>
    <thetext>After fixing the main crash reported on bug 17313, the original test case still crashes.  This is because a document is created via DOMParser.parseFromString and is then queried with querySelectorAll.  As the document is not attached to any view it has no style selector, which leads to a null dereference.

Top of backtrace is as follows:
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000000000e8
Crashed Thread:  0

Thread 0 Crashed:
0   com.apple.WebCore             	0x00e3745a WebCore::CSSStyleSelector::initElementAndPseudoState(WebCore::Element*) + 26 (CSSStyleSelector.cpp:535)
1   com.apple.WebCore             	0x011192be WebCore::Node::querySelector(WebCore::String const&amp;, int&amp;) + 542 (Node.cpp:1225)
2   com.apple.WebCore             	0x01036aee WebCore::jsDocumentPrototypeFunctionQuerySelector(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 142 (PassRefPtr.h:49)
3   com.apple.JavaScriptCore      	0x00487228 KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) + 696 (object.cpp:99)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72619</commentid>
    <comment_count>1</comment_count>
      <attachid>19504</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-03 15:04:22 -0800</bug_when>
    <thetext>Created attachment 19504
Reduction (will crash Release builds of TOT)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72621</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-03 15:06:59 -0800</bug_when>
    <thetext>&lt;rdar://problem/5778077&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81014</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-05-20 12:18:01 -0700</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/changeset/33939&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>19504</attachid>
            <date>2008-03-03 15:04:22 -0800</date>
            <delta_ts>2008-03-03 15:04:22 -0800</delta_ts>
            <desc>Reduction (will crash Release builds of TOT)</desc>
            <filename>bug-17655-reduction.html</filename>
            <type>text/html</type>
            <size>191</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgdmFyIG5ld0RvY3VtZW50ID0gKG5l
dyBET01QYXJzZXIoKSkucGFyc2VGcm9tU3RyaW5nKCc8b3V0Pjxpbj50ZXh0PC9pbj48L291dD4n
LCAndGV4dC94bWwnKTsKICAgIHZhciBub2RlID0gbmV3RG9jdW1lbnQucXVlcnlTZWxlY3Rvcign
b3V0IGluJyk7Cjwvc2NyaXB0Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>