<?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>127684</bug_id>
          
          <creation_ts>2014-01-27 09:08:52 -0800</creation_ts>
          <short_desc>ASSERTION FAILED: insertionBlock != currentRoot</short_desc>
          <delta_ts>2024-04-10 00:38:42 -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>PC</rep_platform>
          <op_sys>Linux</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>
          
          <blocked>116980</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Hodovan">mhodovan.u-szeged</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>benjamin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>rhodovan.u-szeged</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>972431</commentid>
    <comment_count>0</comment_count>
      <attachid>222330</attachid>
    <who name="Martin Hodovan">mhodovan.u-szeged</who>
    <bug_when>2014-01-27 09:08:52 -0800</bug_when>
    <thetext>Created attachment 222330
Test case

The failing test:
&lt;body onload=&quot;
	if (document.counter)
		document.counter++;
	else 
		document.counter = 1;

	if (document.counter &lt;= 1) {
		document.designMode=&apos;on&apos;;
		document.execCommand(&apos;selectall&apos;);
		document.execCommand(&apos;RemoveFormat&apos;);
		document.execCommand(&apos;inserthtml&apos;, false);
	}&quot;
&gt;
	&lt;hr&gt;
	&lt;canvas&gt;
	&lt;/canvas&gt;
&lt;/body&gt;


The error message:
ASSERTION FAILED: insertionBlock != currentRoot
/home/martin/Data/WebKit/Source/WebCore/editing/ReplaceSelectionCommand.cpp(1016) : virtual void WebCore::ReplaceSelectionCommand::doApply()
1   0x7ffff5c19441 WTFCrash
2   0x7ffff0b2985f WebCore::ReplaceSelectionCommand::doApply()
3   0x7ffff0ac67a8 WebCore::CompositeEditCommand::apply()
4   0x7ffff0ac65a0 WebCore::applyCommand(WTF::PassRefPtr&lt;WebCore::CompositeEditCommand&gt;)
5   0x7ffff0afb00b
6   0x7ffff0afc683
7   0x7ffff0affa76 WebCore::Editor::Command::execute(WTF::String const&amp;, WebCore::Event*) const
8   0x7ffff09c523e WebCore::Document::execCommand(WTF::String const&amp;, bool, WTF::String const&amp;)
9   0x7ffff185aa58 WebCore::jsDocumentPrototypeFunctionExecCommand(JSC::ExecState*)
10  0x7fff9b9be0e5

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5c19446 in WTFCrash () at /home/martin/Data/WebKit/Source/WTF/wtf/Assertions.cpp:333
333	    *(int *)(uintptr_t)0xbbadbeef = 0;


The backtrace:
#1  0x00007ffff0b2985f in WebCore::ReplaceSelectionCommand::doApply (this=0xa3fde0) at /home/martin/Data/WebKit/Source/WebCore/editing/ReplaceSelectionCommand.cpp:1016
#2  0x00007ffff0ac67a8 in WebCore::CompositeEditCommand::apply (this=0xa3fde0) at /home/martin/Data/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp:227
#3  0x00007ffff0ac65a0 in WebCore::applyCommand (command=...) at /home/martin/Data/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp:182
#4  0x00007ffff0afb00b in WebCore::executeInsertFragment (frame=..., fragment=...) at /home/martin/Data/WebKit/Source/WebCore/editing/EditorCommand.cpp:195
#5  0x00007ffff0afc683 in WebCore::executeInsertHTML (frame=..., value=...) at /home/martin/Data/WebKit/Source/WebCore/editing/EditorCommand.cpp:508
#6  0x00007ffff0affa76 in WebCore::Editor::Command::execute (this=0x7fffffffbac0, parameter=..., triggeringEvent=0x0)
    at /home/martin/Data/WebKit/Source/WebCore/editing/EditorCommand.cpp:1740
#7  0x00007ffff09c523e in WebCore::Document::execCommand (this=0x808ab0, commandName=..., userInterface=false, value=...)
    at /home/martin/Data/WebKit/Source/WebCore/dom/Document.cpp:4220
#8  0x00007ffff185aa58 in WebCore::jsDocumentPrototypeFunctionExecCommand (exec=0x7fff8f071f40)
    at /home/martin/Data/WebKit/WebKitBuild/Debug/DerivedSources/WebCore/JSDocument.cpp:3369
#9  0x00007fff9b9be0e5 in ?? ()
#10 0x00007fff8f071f90 in ?? ()
#11 0x00007ffff5c075c1 in llint_op_call () from /home/martin/Data/WebKit/WebKitBuild/Debug/lib/libjavascriptcore_efl.so.0
#12 0x00007fff9b9be900 in ?? ()
#13 0x00000000009ee4e0 in ?? ()
#14 0x00007fff800078b0 in ?? ()
#15 0x00007fff800064a0 in ?? ()
#16 0x000000000073cd50 in ?? ()
#17 0x0000000000000000 in ?? ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217164</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2016-08-03 14:01:07 -0700</bug_when>
    <thetext>This still occurs under r204037.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217165</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-08-03 14:01:23 -0700</bug_when>
    <thetext>&lt;rdar://problem/27685262&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926969</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-20 10:41:12 -0800</bug_when>
    <thetext>I am still able to reproduce this assert failed using attached test case in MiniBrowser WK2 Debug Build based of 259136@main and it gets this:

ASSERTION FAILED: insertionBlock != currentRoot
editing/ReplaceSelectionCommand.cpp(1230) : virtual void WebCore::ReplaceSelectionCommand::doApply()
1   0x138346d84 WTFCrash
2   0x280832730 WTFCrashWithInfo(int, char const*, char const*, int)
3   0x283e7b3b8 WebCore::ReplaceSelectionCommand::doApply()
4   0x283dac198 WebCore::CompositeEditCommand::apply()
5   0x283e43438 WebCore::executeInsertFragment(WebCore::Frame&amp;, WTF::Ref&lt;WebCore::DocumentFragment, WTF::RawPtrTraits&lt;WebCore::DocumentFragment&gt; &gt;&amp;&amp;)
6   0x283e3d604 WebCore::executeInsertHTML(WebCore::Frame&amp;, WebCore::Event*, WebCore::EditorCommandSource, WTF::String const&amp;)
7   0x283e12a30 WebCore::Editor::Command::execute(WTF::String const&amp;, WebCore::Event*) const
8   0x283a99ef0 WebCore::Document::execCommand(WTF::String const&amp;, bool, WTF::String const&amp;)
9   0x280be2e5c WebCore::jsDocumentPrototypeFunction_execCommandBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSDocument*)
10  0x280be2944 long long WebCore::IDLOperation&lt;WebCore::JSDocument&gt;::call&lt;&amp;(WebCore::jsDocumentPrototypeFunction_execCommandBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSDocument*)), (WebCore::CastedThisErrorBehavior)0&gt;(JSC::JSGlobalObject&amp;, JSC::CallFrame&amp;, char const*)
11  0x280bcda00 WebCore::jsDocumentPrototypeFunction_execCommand(JSC::JSGlobalObject*, JSC::CallFrame*)
12  0x2a4e5403c (null)
13  0x138a6e990 llint_entry
14  0x138a48eec vmEntryToJavaScript
15  0x139aa7a5c JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
16  0x139aa8138 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
17  0x139ed4878 JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
18  0x139ed493c JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
19  0x139ed4c10 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
20  0x28323e6b8 WebCore::JSExecState::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
21  0x283163f10 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&amp;, WebCore::Event&amp;)
22  0x283bc8f44 WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&amp;, WTF::Vector&lt;WTF::RefPtr&lt;WebCore::RegisteredEventListener, WTF::RawPtrTraits&lt;WebCore::RegisteredEventListener&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::RegisteredEventListener&gt; &gt;, 1ul, WTF::CrashOnOverflow, 2ul, WTF::FastMalloc&gt;, WebCore::EventTarget::EventInvokePhase)
23  0x283bbdf30 WebCore::EventTarget::fireEventListeners(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase)
24  0x284a5507c WebCore::DOMWindow::dispatchEvent(WebCore::Event&amp;, WebCore::EventTarget*)
25  0x284a5fda0 WebCore::DOMWindow::dispatchLoadEvent()
26  0x283a872a4 WebCore::Document::dispatchWindowLoadEvent()
27  0x283a86efc WebCore::Document::implicitClose()
28  0x284848ba0 WebCore::FrameLoader::checkCallImplicitClose()
29  0x284848544 WebCore::FrameLoader::checkCompleted()
30  0x284846950 WebCore::FrameLoader::finishedParsing()
31  0x283a9c2bc WebCore::Document::finishedParsing()
2023-01-20 18:39:56.245 MiniBrowser[65827:23966084] WebContent process crashed; reloading</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027366</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-04-10 00:38:39 -0700</bug_when>
    <thetext>Committed 277291@main (cb8d258708a5): &lt;https://commits.webkit.org/277291@main&gt;

Reviewed commits have been landed. Closing PR #26896 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>222330</attachid>
            <date>2014-01-27 09:08:52 -0800</date>
            <delta_ts>2014-01-27 09:08:52 -0800</delta_ts>
            <desc>Test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>311</size>
            <attacher name="Martin Hodovan">mhodovan.u-szeged</attacher>
            
              <data encoding="base64">PGJvZHkgb25sb2FkPSIKCWlmIChkb2N1bWVudC5jb3VudGVyKQoJCWRvY3VtZW50LmNvdW50ZXIr
KzsKCWVsc2UgCgkJZG9jdW1lbnQuY291bnRlciA9IDE7CglpZiAoZG9jdW1lbnQuY291bnRlciA8
PSAxKSB7CgkJZG9jdW1lbnQuZGVzaWduTW9kZT0nb24nOwoJCWRvY3VtZW50LmV4ZWNDb21tYW5k
KCdzZWxlY3RhbGwnKTsKCQlkb2N1bWVudC5leGVjQ29tbWFuZCgnUmVtb3ZlRm9ybWF0Jyk7CgkJ
ZG9jdW1lbnQuZXhlY0NvbW1hbmQoJ2luc2VydGh0bWwnLCBmYWxzZSk7Cgl9Igo+Cgk8aHI+Cgk8
Y2FudmFzPgoJPC9jYW52YXM+CjwvYm9keT4=
</data>

          </attachment>
      

    </bug>

</bugzilla>