<div dir="ltr"><div>@Konstantin Thanks for the update and it is definitely relieving to know that those were known issues and have been fixed in later version of QtWebKit. I will work with PhantomJS maintainers to get the QtWebKit version upgraded in the latest PhantomJS version.</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 13, 2017 at 3:41 PM, Konstantin Tokarev <span dir="ltr">&lt;<a href="mailto:annulen@yandex.ru" target="_blank">annulen@yandex.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
13.02.2017, 11:52, &quot;Atul Sowani&quot; &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt;:<br>
<span>&gt; I am using Qt 5.5.1.<br>
<br>
</span>It ships with obsolete WebKit version based on trunk from 2013. Indeed it is known to have assertion failures related to calc like those you&#39;ve posted, which were fixed since that times.<br>
<br>
Please upgrade to QtWebKit TP5 [1]. It is much closer to trunk, and will be a hard requirement for Phantom JS 2.5<br>
<br>
[1] <a href="https://github.com/annulen/webkit/releases/tag/qtwebkit-tp5" target="_blank" rel="noreferrer">https://github.com/annulen/<wbr>webkit/releases/tag/qtwebkit-<wbr>tp5</a><br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; On Thu, Feb 9, 2017 at 10:15 PM, Simon Fraser &lt;<a href="mailto:simon.fraser@apple.com">simon.fraser@apple.com</a>&gt; wrote:<br>
&gt;&gt; What WebKit revision are your sources based on? It&#39;s quite likely the this bug has been fixed.<br>
&gt;&gt;<br>
&gt;&gt; Simon<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Feb 9, 2017, at 4:09 AM, Atul Sowani &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Finally I zeroed in on 3 &quot;calc&quot; candidates from the stylesheet which are causing the CSS parser to fail:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; height:calc(100vh - 200px)<br>
&gt;&gt;&gt; height:calc(100vh - 230px)<br>
&gt;&gt;&gt; max-height:calc(100vh - 200px)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think it is the very first one and the remaining two never get processed.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I put in some debug statements in the code and the corresponding output for this is:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ATUL: value-&gt;id = 0 propId = 1080<br>
&gt;&gt;&gt; ATUL: in CSSPropertyHeight<br>
&gt;&gt;&gt; ATUL: in CSSPropertyWebkitLogicalHeight<br>
&gt;&gt;&gt; ATUL: in CSSCalcValue::create<br>
&gt;&gt;&gt; ATUL: in parseValueExpression, calling parseAdditiveValueExpression<br>
&gt;&gt;&gt; ATUL: calling CSSCalcBinaryOperation::create from parseAdditiveValueExpression<br>
&gt;&gt;&gt; ATUL: operatorCharacter = -<br>
&gt;&gt;&gt; ATUL: lhs = 1 rhs = 1<br>
&gt;&gt;&gt; ATUL: leftSide category = ATUL: m_category = 5<br>
&gt;&gt;&gt; 5<br>
&gt;&gt;&gt; ATUL: rightSide category = ATUL: m_category = 1<br>
&gt;&gt;&gt; 1<br>
&gt;&gt;&gt; ATUL: m_category = 5<br>
&gt;&gt;&gt; ASSERTION FAILED: leftSide-&gt;category() != CalcOther &amp;&amp; rightSide-&gt;category() != CalcOther<br>
&gt;&gt;&gt; css/CSSCalculationValue.cpp(<wbr>293) : static WTF::PassRefPtr&lt;WebCore::<wbr>CSSCalcBinaryOperation&gt; WebCore::<wbr>CSSCalcBinaryOperation::<wbr>create(WTF::PassRefPtr&lt;<wbr>WebCore::<wbr>CSSCalcExpressionNode&gt;, WTF::PassRefPtr&lt;WebCore::<wbr>CSSCalcExpressionNode&gt;, WebCore::CalcOperator)<br>
&gt;&gt;&gt; 1   0x12e8a80c bin/phantomjs() [0x12e8a80c]<br>
&gt;&gt;&gt; &lt; stack trace removed &gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; So the question is, is the calc expression valid one?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt; Atul.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Feb 9, 2017 at 2:17 PM, Atul Sowani &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; @Konstantin thanks for the suggestions. I disabled CSS JIT on x85 but there was no negative impact on the results on x86. So I guess the issue is a genuine ppc64le problem. I have picked up the starting points mentioned in this thread earlier and debugging the issue. I have also isolated the issue to a single CSS file which is causing the problem. Now I am trying to isolate the exact entry in the CSS file which is causing the trouble.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt;&gt; Atul.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Tue, Feb 7, 2017 at 3:53 PM, Konstantin Tokarev &lt;<a href="mailto:annulen@yandex.ru">annulen@yandex.ru</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 07.02.2017, 12:55, &quot;Atul Sowani&quot; &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt;:<br>
&gt;&gt;&gt;&gt;&gt;&gt; Thanks Geoffrey, Alex, Yoav for the debugging pointer. I am debugging the issue further using this information and will most likely need some more help in immediate future as well.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Unfortunately, I don&#39;t have a stand-alone test case which can be tested with qtwebkit. I am trying to load a page using PhantomJS and it&#39;s crashing. The typical URLs which cause it to crash are <a href="http://engadget.com" target="_blank" rel="noreferrer">http://engadget.com</a> and <a href="http://cnn.com" target="_blank" rel="noreferrer">http://cnn.com</a> - both of these load without any issue on x86 platform though, so the issue seems to be specific to ppc64le.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; A few suggestions:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 1. I suppose you are building with disabled JIT, as WebKit does not implement JIT for any PPC variant in official tree. This may introduce subtle differences in behavior, for example I once encountered layout test that was failing only when CSS JIT was disabled. You can try building without JIT on x86_64 and compare.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 2. It might be miscompilation, as your platform may not be as thoroughly tested as more mainstream ones. You can try to build with -O0, -O1, -O2 (default is -O3). Alternatively, try building with different compiler (at least GCC and Clang support ppc64le and are fine for WebKit, xlC may not work though), or try different version of your compiler.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 3. Note that webkit-qt list is more appropriate for issues specific for QtWebKit. Make sure you are using latest release (technology preview 5 at the moment [1])<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; [1] <a href="https://github.com/annulen/webkit/releases/tag/qtwebkit-tp5" target="_blank" rel="noreferrer">https://github.com/annulen/<wbr>webkit/releases/tag/qtwebkit-<wbr>tp5</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt;&gt;&gt; Atul.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Mon, Feb 6, 2017 at 5:56 PM, Yoav Weiss &lt;<a href="mailto:yoav@yoav.ws">yoav@yoav.ws</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi Atul,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I second Alex&#39;s suggestion (perhaps followed by HTMLLinkElement::process() and other places in that file that refer to `hrefAttr`).<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; If you have a test case online, I could try to take a look and maybe provide more guidance.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cheers :)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Yoav<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Fri, Feb 3, 2017 at 9:19 PM Alex Christensen &lt;<a href="mailto:achristensen@apple.com">achristensen@apple.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I would start looking at HTMLLinkElement::<wbr>parseAttribute.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; LinkHeader.cpp contains parsers for link headers, which are related.  Yoav knows more about those.  Those parsers ought to be united more.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Feb 3, 2017, at 1:17 AM, Atul Sowani &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; At present I am focusing on CSSParser::findURI() particularly and CSSParser::realLex() other related functionality in CSSParser.cpp - hope I am on right track. ;-)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please let me know if I should be looking at some other functionality as well to resolve this issue.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Atul.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Fri, Feb 3, 2017 at 2:33 PM, Atul Sowani &lt;<a href="mailto:sowani@gmail.com">sowani@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I came across an issue in qtwebkit CSS parser while working on a PhantomJS crash. The issue seems to be with parsing of &lt;link rel=&quot;...&quot; href=&quot;...&quot;&gt; type elements in an HTML page. What I observed is that the parser is trying to interpret the value for href given inside double-quotes. The value contains a &quot;-&quot; (e.g. &quot;<a href="http://some.domain.com/some-page-etc-etc" target="_blank" rel="noreferrer">http://some.domain.com/some-<wbr>page-etc-etc</a>&quot;). The &quot;-&quot; sign is being interpreted as minus and then things go wrong. In another case I found that &quot;\g&quot; embedded in the value (e.g. &quot;<a href="http://some.domain.com/some-page/global/something" target="_blank" rel="noreferrer">http://some.domain.com/some-<wbr>page/global/something</a>&quot;) is also creating issues. In essence, the parser is trying to interpret the value, which I believe, it should not.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I am willing to dive further into it to debug and fix the issue, but looking at the complexity and size of WebCore, I think I would benefit a lot to expedite a fix, if I could get some tips about which code area/functionality I should specifically focus in the WebCore. Looking forward to some help in this regard.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Atul.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; webkit-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank" rel="noreferrer">https://lists.webkit.org/<wbr>mailman/listinfo/webkit-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; ,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; webkit-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank" rel="noreferrer">https://lists.webkit.org/<wbr>mailman/listinfo/webkit-dev</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Regards,<br>
&gt;&gt;&gt;&gt;&gt; Konstantin<br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; webkit-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
&gt;&gt;&gt; <a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank" rel="noreferrer">https://lists.webkit.org/<wbr>mailman/listinfo/webkit-dev</a><br>
&gt; ,<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; webkit-dev mailing list<br>
&gt; <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
&gt; <a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank" rel="noreferrer">https://lists.webkit.org/<wbr>mailman/listinfo/webkit-dev</a><br>
<br>
<br>
-- <br>
Regards,<br>
Konstantin<br>
</div></div></blockquote></div><br></div>