<?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>99607</bug_id>
          
          <creation_ts>2012-10-17 10:11:40 -0700</creation_ts>
          <short_desc>editing/pasteboard/paste-noscript-xhtml.xhtml crashes in chromium&apos;s content_shell</short_desc>
          <delta_ts>2012-10-23 07:52:38 -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>HTML Editing</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>99880</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>jochen</reporter>
          <assigned_to name="Adam Klein">adamk</assigned_to>
          <cc>adamk</cc>
    
    <cc>esprehn</cc>
    
    <cc>leviw</cc>
    
    <cc>ojan</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>744343</commentid>
    <comment_count>0</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-10-17 10:11:40 -0700</bug_when>
    <thetext>When running

new_run_webkit_tests --chromium --debug --driver-name=content_shell --additional-drt-flag=--dump-render-tree --additional-drt-flag=--no-sandbox --clobber-old-results --no-show-results editing/pasteboard/paste-noscript-xhtml.xhtml

I get the following crash:

STDERR: [20611:20611:1017/190312:32571343945:ERROR:process_util_posix.cc(144)] Received signal 11
STDERR: 	base::debug::StackTrace::StackTrace() [0x4e505e]
STDERR: 	base::(anonymous namespace)::StackDumpSignalHandler() [0x4fe814]
STDERR: 	0x7fc9502a84c0
STDERR: 	WebCore::Node::getFlag() [0xc5084e]
STDERR: 	WebCore::Node::isContainerNode() [0x1e02c0a]
STDERR: 	WebCore::Node::firstChild() [0x1e292a9]
STDERR: 	WebCore::getChildNodes() [0x2c2ce43]
STDERR: 	WebCore::ContainerNode::takeAllChildrenFrom() [0x309d9aa]
STDERR: 	WebCore::createFragmentFromMarkupWithContext() [0x27e112a]
STDERR: 	WebCore::Pasteboard::documentFragment() [0x39f3efa]
STDERR: 	WebCore::Editor::pasteWithPasteboard() [0x2779bfd]
STDERR: 	WebCore::Editor::paste() [0x277d47e]
STDERR: 	WebCore::executePaste() [0x278fca1]
STDERR: 	WebCore::Editor::Command::execute() [0x278c1d5]
STDERR: 	WebCore::Document::execCommand() [0x30c6c0e]
STDERR: 	WebCore::DocumentV8Internal::execCommandCallback() [0x36826b3]
STDERR: 	v8::internal::HandleApiCallHelper&lt;&gt;() [0x1699b95]
STDERR: 	v8::internal::Builtin_Impl_HandleApiCall() [0x1699773]
STDERR: 	v8::internal::Builtin_HandleApiCall() [0x16932fc]
STDERR: 	0x24143650618e

Tracked also in http://code.google.com/p/chromium/issues/detail?id=156376</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745411</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 11:21:02 -0700</bug_when>
    <thetext>Most likely reason for this is that we&apos;re passing an empty DocumentFragment to ContainerNode::takeAllChildrenFrom(), which assumes (but doesn&apos;t check) that oldParent is non-null. Will look into it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745446</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 11:57:51 -0700</bug_when>
    <thetext>I&apos;m running into a bit of a problem trying to track this down, in that I can&apos;t figure out how to attach gdb to the renderer. jochen, any tips?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745461</commentid>
    <comment_count>3</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-10-18 12:18:14 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m running into a bit of a problem trying to track this down, in that I can&apos;t figure out how to attach gdb to the renderer. jochen, any tips?

I would try

echo /path/to/editing/pasteboard/paste-noscript-xhtml.xhtml | out/Debug/content_shell --dump-render-tree --no-timeout --no-sandbox --renderer-cmd-prefix=&apos;xterm -title renderer -e gdb --eval-command=run --args&apos;

That should start each renderer in a gdb in a new xterm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745462</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 12:19:01 -0700</bug_when>
    <thetext>Thanks, used printfs for now. It looks like the problem is that the selected content can&apos;t be parsed, likely due to a leading &lt;meta charset=&apos;UTF-8&apos;&gt; tag in the selected markup. Still digging to figure out how that&apos;s ending up in the selection, and only in ContentShell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745466</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 12:23:37 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Thanks, used printfs for now. It looks like the problem is that the selected content can&apos;t be parsed, likely due to a leading &lt;meta charset=&apos;UTF-8&apos;&gt; tag in the selected markup. Still digging to figure out how that&apos;s ending up in the selection, and only in ContentShell.

Correction, that&apos;s &quot;&lt;meta charset=&apos;utf-8&apos;&gt;&quot; to be precise, and at least on Mac it looks like we add that to the selection. Last of updates for now, I think I&apos;ve got a bead on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745477</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 12:42:01 -0700</bug_when>
    <thetext>Okay, I lied, one more question for jochen: I take it you were running this on Linux? I&apos;m not able to reproduce there, only on Mac, and the &lt;meta&gt; tag insertion I mentioned before seems to be Mac-specific.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745480</commentid>
    <comment_count>7</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-10-18 12:50:04 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Okay, I lied, one more question for jochen: I take it you were running this on Linux? I&apos;m not able to reproduce there, only on Mac, and the &lt;meta&gt; tag insertion I mentioned before seems to be Mac-specific.

Yes, sorry for not mentioning this.

I can repro on 64bit lucid and precise</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745550</commentid>
    <comment_count>8</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-18 14:02:34 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; Okay, I lied, one more question for jochen: I take it you were running this on Linux? I&apos;m not able to reproduce there, only on Mac, and the &lt;meta&gt; tag insertion I mentioned before seems to be Mac-specific.
&gt; 
&gt; Yes, sorry for not mentioning this.
&gt; 
&gt; I can repro on 64bit lucid and precise

Hmm, I can&apos;t on precise (the test fails to run properly instead, looks like perhaps the paste never happens?). Anyway, the &lt;meta&gt; thing looks like a real bug (http://crbug.com/136218).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>745554</commentid>
    <comment_count>9</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-10-18 14:05:42 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; (In reply to comment #6)
&gt; &gt; &gt; Okay, I lied, one more question for jochen: I take it you were running this on Linux? I&apos;m not able to reproduce there, only on Mac, and the &lt;meta&gt; tag insertion I mentioned before seems to be Mac-specific.
&gt; &gt; 
&gt; &gt; Yes, sorry for not mentioning this.
&gt; &gt; 
&gt; &gt; I can repro on 64bit lucid and precise
&gt; 
&gt; Hmm, I can&apos;t on precise (the test fails to run properly instead, looks like perhaps the paste never happens?). Anyway, the &lt;meta&gt; thing looks like a real bug (http://crbug.com/136218).

Are you building after chromium r161834 ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>748651</commentid>
    <comment_count>10</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-10-23 07:52:38 -0700</bug_when>
    <thetext>Should be fixed by http://trac.webkit.org/changeset/132211</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>