<?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>197181</bug_id>
          
          <creation_ts>2019-04-22 16:18:05 -0700</creation_ts>
          <short_desc>Assertion fires when calling getSubStringLength() for a fragmented &lt;text&gt; element</short_desc>
          <delta_ts>2023-01-20 11:03:35 -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>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1529448</commentid>
    <comment_count>0</comment_count>
      <attachid>367991</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-04-22 16:18:05 -0700</bug_when>
    <thetext>Created attachment 367991
test case

Open the attached test case. The following assertion will fire:

0x00000001b2ae79b0 in ::WTFCrash() at Source/WTF/wtf/Assertions.cpp:305
0x00000001a000e75b in WTFCrashWithInfo(int, char const*, char const*, int) at WebKitBuild/Debug/usr/local/include/wtf/Assertions.h:566
0x00000001a3ba3e7d in WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;, unsigned int&amp;, unsigned int&amp;) const at Source/WebCore/rendering/svg/SVGTextQuery.cpp:140
0x00000001a3ba450c in WebCore::SVGTextQuery::subStringLengthCallback(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;) const at Source/WebCore/rendering/svg/SVGTextQuery.cpp:291
0x00000001a3ba3d9c in WebCore::SVGTextQuery::executeQuery(WebCore::SVGTextQuery::Data*, bool (WebCore::SVGTextQuery::*)(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;) const) const at Source/WebCore/rendering/svg/SVGTextQuery.cpp:125
0x00000001a3ba4627 in WebCore::SVGTextQuery::subStringLength(unsigned int, unsigned int) const at Source/WebCore/rendering/svg/SVGTextQuery.cpp:305
0x00000001a3f34490 in WebCore::SVGTextContentElement::getSubStringLength(unsigned int, unsigned int) at Source/WebCore/./svg/SVGTextContentElement.cpp:75
0x00000001a12c5d00 in WebCore::jsSVGTextContentElementPrototypeFunctionGetSubStringLengthBody(JSC::ExecState*, WebCore::JSSVGTextContentElement*, JSC::ThrowScope&amp;) at WebKitBuild/Debug/DerivedSources/WebCore/JSSVGTextContentElement.cpp:295
0x00000001a12ba6d0 in long long WebCore::IDLOperation&lt;WebCore::JSSVGTextContentElement&gt;::call&lt;&amp;(WebCore::jsSVGTextContentElementPrototypeFunctionGetSubStringLengthBody(JSC::ExecState*, WebCore::JSSVGTextContentElement*, JSC::ThrowScope&amp;)), (WebCore::CastedThisErrorBehavior)0&gt;(JSC::ExecState&amp;, char const*) at Source/WebCore/bindings/js/JSDOMOperation.h:53
0x00000001a12ba3bc in WebCore::jsSVGTextContentElementPrototypeFunctionGetSubStringLength(JSC::ExecState*) at WebKitBuild/Debug/DerivedSources/WebCore/JSSVGTextContentElement.cpp:300</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529449</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-04-22 16:19:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/50109006&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926980</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-20 11:03:35 -0800</bug_when>
    <thetext>I get hit by this assertion while trying to load test case in Minibrowser WK2 Debug build based of 259136@main and get following:

ASSERTION FAILED: startPosition &gt;= queryData-&gt;processedCharacters
rendering/svg/SVGTextQuery.cpp(142) : bool WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates(WebCore::SVGTextQuery::Data *, const WebCore::SVGTextFragment &amp;, unsigned int &amp;, unsigned int &amp;) const
1   0x139d6ed84 WTFCrash
2   0x280832730 WTFCrashWithInfo(int, char const*, char const*, int)
3   0x285bd1358 WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;, unsigned int&amp;, unsigned int&amp;) const
4   0x285bd1bd4 WebCore::SVGTextQuery::subStringLengthCallback(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;) const
5   0x285bd1238 WebCore::SVGTextQuery::executeQuery(WebCore::SVGTextQuery::Data*, bool (WebCore::SVGTextQuery::*)(WebCore::SVGTextQuery::Data*, WebCore::SVGTextFragment const&amp;) const) const
6   0x285bd1d08 WebCore::SVGTextQuery::subStringLength(unsigned int, unsigned int) const
7   0x2860366ac WebCore::SVGTextContentElement::getSubStringLength(unsigned int, unsigned int)
8   0x281a6ad08 WebCore::jsSVGTextContentElementPrototypeFunction_getSubStringLengthBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSSVGTextContentElement*)
9   0x281a6a9c4 long long WebCore::IDLOperation&lt;WebCore::JSSVGTextContentElement&gt;::call&lt;&amp;(WebCore::jsSVGTextContentElementPrototypeFunction_getSubStringLengthBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSSVGTextContentElement*)), (WebCore::CastedThisErrorBehavior)0&gt;(JSC::JSGlobalObject&amp;, JSC::CallFrame&amp;, char const*)
10  0x281a69e68 WebCore::jsSVGTextContentElementPrototypeFunction_getSubStringLength(JSC::JSGlobalObject*, JSC::CallFrame*)
11  0x2a4e5403c (null)
12  0x13a496990 llint_entry
13  0x13a470eec vmEntryToJavaScript
14  0x13b4cfa5c JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
15  0x13b4ceff8 JSC::Interpreter::executeProgram(JSC::SourceCode const&amp;, JSC::JSGlobalObject*, JSC::JSObject*)
16  0x13b938110 JSC::evaluate(JSC::JSGlobalObject*, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
17  0x13b938254 JSC::profiledEvaluate(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
18  0x283240254 WebCore::JSExecState::profiledEvaluate(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
19  0x28323fd28 WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&amp;, WebCore::DOMWrapperWorld&amp;)
20  0x28323fb5c WebCore::ScriptController::evaluateInWorldIgnoringException(WebCore::ScriptSourceCode const&amp;, WebCore::DOMWrapperWorld&amp;)
21  0x28324050c WebCore::ScriptController::evaluateIgnoringException(WebCore::ScriptSourceCode const&amp;)
22  0x283cbd164 WebCore::ScriptElement::executeClassicScript(WebCore::ScriptSourceCode const&amp;)
23  0x283cbb2e8 WebCore::ScriptElement::prepareScript(WTF::TextPosition const&amp;, WebCore::ScriptElement::LegacyTypeSupport)
24  0x2863d6984 WebCore::XMLDocumentParser::endElementNs()
25  0x2863d7e18 WebCore::endElementNsHandler(void*, unsigned char const*, unsigned char const*, unsigned char const*)
26  0x1a6f538b4 xmlParseEndTag2
27  0x1a6f4a320 xmlParseTryOrFinish
28  0x1a6f48f40 xmlParseChunk
29  0x2863d5034 WebCore::XMLDocumentParser::doWrite(WTF::String const&amp;)
30  0x2863cb95c WebCore::XMLDocumentParser::append(WTF::RefPtr&lt;WTF::StringImpl, WTF::RawPtrTraits&lt;WTF::StringImpl&gt;, WTF::DefaultRefDerefTraits&lt;WTF::StringImpl&gt; &gt;&amp;&amp;)
31  0x283a67eec WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter&amp;, unsigned char const*, unsigned long)
2023-01-20 19:01:00.281 MiniBrowser[67347:23990700] WebContent process crashed; reloading
ASSERTION FAILED: m_connection
/Users/ahmadsaleem/Documents/GitHub-Webkit-origin/Webkit/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h(86) : IPC::Connection *WebKit::AuxiliaryProcessProxy::connection() const
1   0x135b4ed84 WTFCrash
2   0x11610fc30 WTFCrashWithInfo(int, char const*, char const*, int)
3   0x117231d48 WebKit::AuxiliaryProcessProxy::connection() const
4   0x117c5b848 WebKit::WebPageProxy::messageSenderConnection() const
5   0x117c5b3e4 WebKit::WebPageProxy::sendWheelEvent(WebKit::WebWheelEvent const&amp;, WTF::OptionSet&lt;WebCore::WheelEventProcessingSteps&gt;)
6   0x117c5b298 WebKit::WebPageProxy::handleWheelEvent(WebKit::NativeWebWheelEvent const&amp;)
7   0x11795cd7c WebKit::WebViewImpl::scrollWheel(NSEvent*)
8   0x1175a27ac -[WKWebView(WKImplementationMac) scrollWheel:]
9   0x1a259e618 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]
10  0x1a259d124 -[NSWindow(NSEventRouting) sendEvent:]
11  0x1a259c25c -[NSApplication(NSEvent) sendEvent:]
12  0x1a27ee360 -[NSApplication _handleEvent:]
13  0x1a2463a08 -[NSApplication run]
14  0x1a243ae28 NSApplicationMain
15  0x100045edc main
16  0x19ede7e50 start
2023-01-20 19:01:00.335 com.apple.WebKit.WebContent.Development[67548:23993744] Application does not have permission to communicate with network resources. rc=1 : errno=3</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367991</attachid>
            <date>2019-04-22 16:18:05 -0700</date>
            <delta_ts>2019-04-22 16:18:05 -0700</delta_ts>
            <desc>test case</desc>
            <filename>svg-text-getSubStringLength.svg</filename>
            <type>image/svg+xml</type>
            <size>232</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHRleHQgaWQ9InRl
eHQiIHg9IjAsMjAsNDAsNjAiIHk9IjE1Ij50ZXh0PC90ZXh0PgogICAgPHNjcmlwdD4KICAgICAg
ICB2YXIgdGV4dCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiN0ZXh0Iik7CiAgICAgICAgdmFy
IGxlbmd0aCA9IHRleHQuZ2V0U3ViU3RyaW5nTGVuZ3RoKDEsMSk7CiAgICA8L3NjcmlwdD4KPC9z
dmc+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>