Bug 76657

Summary: [Qt] Fix the build with the newes Qt5 hashes
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: Tools / TestsAssignee: Andras Becsi <abecsi>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, anselmo.melo, hausmann, kbalazs, ossy, rafael.lobo, vestbo, zarvai, zeno
Priority: P3 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
proposed patch
none
Patch
none
proposed patch none

Description Andras Becsi 2012-01-19 12:48:07 PST
Few things changed in qtbase, which causes failures with the newest Qt5 hash.
- QGLContext::currentContext now returns QFunctionPointer
- Because of the new automatic touch -> mouse mocking our touch mocking breaks in MiniBrowser and results in an infinite loop.
Comment 1 Andras Becsi 2012-01-19 12:51:32 PST
Created attachment 123179 [details]
proposed patch
Comment 2 Andras Becsi 2012-01-19 13:24:12 PST
Comment on attachment 123179 [details]
proposed patch

The MiniBrowser part is not correct. I'm going to look into this tomorrow.
Comment 3 Csaba Osztrogonác 2012-01-20 06:32:50 PST
I tried Andras' patch with the latest Qt5, layout tests work fine, 
but unfortunately qmltests API test is broken:

$ xvfb-run -a --server-args="-screen 0 1024x768x24" WebKitBuild/Release/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests
Qml debugging is enabled. Only use this in a safe environment!
********* Start testing of qmltests *********
Config: Using QTest library 5.0.0, Qt 5.0.0
PASS   : qmltests::DesktopWebViewLinkHovered::initTestCase()
PASS   : qmltests::DesktopWebViewLinkHovered::test_linkHovered()
PASS   : qmltests::DesktopWebViewLinkHovered::test_linkHoveredDoesntEmitRepeated()
PASS   : qmltests::DesktopWebViewLinkHovered::cleanupTestCase()
PASS   : qmltests::DesktopWebViewLoadHtml::initTestCase()
PASS   : qmltests::DesktopWebViewLoadHtml::test_baseUrlAfterLoadHtml()
PASS   : qmltests::DesktopWebViewLoadHtml::cleanupTestCase()
PASS   : qmltests::DesktopWebViewMessaging::initTestCase()
Segmentation fault
Comment 4 Csaba Osztrogonác 2012-01-20 07:34:39 PST
Here is a debug backtrace with c++filt-ed output:

ASSERTION FAILED: !result
/home/oszi/WebKit/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp(282) : void WTF::Mutex::lock()
1   0x7fb2b8e3f9e9 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(WTF::Mutex::lock()+0x45) [0x7fb2b8e3f9e9]
2   0x7fb2b74338a6 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x4368a6) [0x7fb2b74338a6]
3   0x7fb2b762f6ef /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x6326ef) [0x7fb2b762f6ef]
4   0x7fb2b762f95c /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x63295c) [0x7fb2b762f95c]
5   0x7fb2b762f687 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x632687) [0x7fb2b762f687]
6   0x7fb2b759a635 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x59d635) [0x7fb2b759a635]
7   0x7fb2b7597c0d /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x59ac0d) [0x7fb2b7597c0d]
8   0x7fb2b83cd8c3 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x13d08c3) [0x7fb2b83cd8c3]
9   0x7fb2b759755f /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x59a55f) [0x7fb2b759755f]
10  0x7fb2b7738058 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x73b058) [0x7fb2b7738058]
11  0x7fb2b7737ad5 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x73aad5) [0x7fb2b7737ad5]
12  0x7fb2b7737616 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x73a616) [0x7fb2b7737616]
13  0x7fb2b7597fae /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x59afae) [0x7fb2b7597fae]
14  0x7fb2b757a500 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x57d500) [0x7fb2b757a500]
15  0x7fb2b75ebbe9 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x5eebe9) [0x7fb2b75ebbe9]
16  0x7fb2b7570fd9 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x573fd9) [0x7fb2b7570fd9]
17  0x7fb2b74ca0ad /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x4cd0ad) [0x7fb2b74ca0ad]
18  0x7fb2b74ca28f /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x4cd28f) [0x7fb2b74ca28f]
19  0x7fb2b74d4647 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x4d7647) [0x7fb2b74d4647]
20  0x7fb2b74d4350 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x4d7350) [0x7fb2b74d4350]
21  0x7fb2b772d942 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x730942) [0x7fb2b772d942]
22  0x7fb2b8098937 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x109b937) [0x7fb2b8098937]
23  0x7fb2b8364ad6 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x1367ad6) [0x7fb2b8364ad6]
24  0x7fb2b8365911 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.4(+0x1368911) [0x7fb2b8365911]
25  0x7fb2b382dca6 /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtCore.so.5(QObject::event(QEvent*)+0x396) [0x7fb2b382dca6]
26  0x7fb2b43749dc /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtWidgets.so.5(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0xac) [0x7fb2b43749dc]
27  0x7fb2b4379df2 /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtWidgets.so.5(QApplication::notify(QObject*, QEvent*)+0x152) [0x7fb2b4379df2]
28  0x7fb2b3812344 /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtCore.so.5(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x84) [0x7fb2b3812344]
29  0x7fb2b3816452 /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtCore.so.5(QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)+0x402) [0x7fb2b3816452]
30  0x7fb2b38520a3 /usr/local/Trolltech/Qt5/Qt-5.0.0-r19/lib/libQtCore.so.5(+0x1ff0a3) [0x7fb2b38520a3]
31  0x7fb2b05cc6f2 /lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f2) [0x7fb2b05cc6f2]
Segmentation fault
Comment 5 Andras Becsi 2012-01-20 07:41:21 PST
(In reply to comment #4)
> Here is a debug backtrace with c++filt-ed output:
> 
> ASSERTION FAILED: !result
> /home/oszi/WebKit/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp(282) : void WTF::Mutex::lock()
> Segmentation fault
Tor Arne, do you eventually know whether something changed in the Qt5 QMutex code which could cause this crash?
The backtrace does not say much :(
Comment 6 Tor Arne Vestbø 2012-01-20 07:52:55 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Here is a debug backtrace with c++filt-ed output:
> > 
> > ASSERTION FAILED: !result
> > /home/oszi/WebKit/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp(282) : void WTF::Mutex::lock()
> > Segmentation fault
> Tor Arne, do you eventually know whether something changed in the Qt5 QMutex code which could cause this crash?
> The backtrace does not say much :(

Try checking with Joao or Brad
Comment 7 Rafael Brandao 2012-01-20 09:01:15 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Here is a debug backtrace with c++filt-ed output:
> > 
> > ASSERTION FAILED: !result
> > /home/oszi/WebKit/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp(282) : void WTF::Mutex::lock()
> > Segmentation fault
> Tor Arne, do you eventually know whether something changed in the Qt5 QMutex code which could cause this crash?
> The backtrace does not say much :(

This is a problem with our icon client. I have a fix pending for review that will fix this.
Comment 8 Anselmo L. S. Melo 2012-01-20 09:12:39 PST
Created attachment 123337 [details]
Patch
Comment 9 Anselmo L. S. Melo 2012-01-20 09:16:33 PST
Qt5/QtBase 9702400e modified QGLContext::getProcAddress(), which now returns QFunctionPointer. The proposed patch fixes the build.
Comment 10 Anselmo L. S. Melo 2012-01-20 09:41:57 PST
Comment on attachment 123337 [details]
Patch

Nevermind, the previous patch already does this :-)
And in fact, my patch should say QGLContext::currentContext(), not getProcAddress()...
Comment 11 Andras Becsi 2012-01-20 11:50:16 PST
Created attachment 123350 [details]
proposed patch

After a discussion with Tor Arne and Zeno the decision was to temporarily disable the automatic touch->mouse synthesis in Qt to avoid the infinite loop with QGuiApplicationPrivate::processTouchEvent and MiniBrowser's touch mocking.

After we make it possible to set the synthesized flag (which is currently internally used to prevent infinite loops) on our touch mock events we can enable it again and mark our touch events synthesized.

This decision was made because using QWindowSystemInterface::handleTouchEvent to sent the mock events is the most straightforward solution.
If we would create the QTouchEvent's ourselves, we would need to set all the positions and cache the last positions, which would result in more code and would make the implementation more error prone to changes in QQuickCanvasPrivate::translateTouchEvent and other places where touch points are adjusted.
Comment 12 Balazs Kelemen 2012-01-21 14:16:50 PST
I am not sure how it is related but we experienced another bug with the touch mocking: seems like it is also active on touch devices. When I built WebKit to N9 and tried MiniBrowser it also produced the blue bubbles on the touch points and double touch was not working. However Zoltán Árvai informed me his last week build was working correctly. Maybe it's a side effect of the changes in Qt?
Comment 13 Andras Becsi 2012-01-23 04:45:23 PST
(In reply to comment #12)
> I am not sure how it is related but we experienced another bug with the touch mocking: seems like it is also active on touch devices. When I built WebKit to N9 and tried MiniBrowser it also produced the blue bubbles on the touch points and double touch was not working. However Zoltán Árvai informed me his last week build was working correctly. Maybe it's a side effect of the changes in Qt?

I did not try it on the device but it is the same issue indeed.
I found the bug in Qt and am on my way to fix it. Thanks.
Comment 14 Csaba Osztrogonác 2012-01-24 04:55:39 PST
(In reply to comment #4)
> Here is a debug backtrace with c++filt-ed output:
> 
> ASSERTION FAILED: !result
> /home/oszi/WebKit/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp(282) : void WTF::Mutex::lock()

This crash is absolutely unrelated to Qt5 revision update. It is an old bug
but unfortunately we didn't notive it before because a serious bug in the API
test runner script: https://bugs.webkit.org/show_bug.cgi?id=76906

I filed a new bug to fix this crash: https://bugs.webkit.org/show_bug.cgi?id=76906

Now the latest Qt5 works fine for me, so update is coming in an hour.
Comment 15 Csaba Osztrogonác 2012-01-24 05:32:18 PST
Comment on attachment 123350 [details]
proposed patch

Clearing flags on attachment: 123350

Committed r105733: <http://trac.webkit.org/changeset/105733>
Comment 16 Csaba Osztrogonác 2012-01-24 05:32:27 PST
All reviewed patches have been landed.  Closing bug.
Comment 17 Rafael Brandao 2012-01-24 06:45:12 PST
Anyone else into this?

Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp:115:46: error: no matching function for call to 'QNetworkReply::ignoreSslErrors(const QList<QSslError>&)'

I've just verified with bbandix's hashes https://gist.github.com/1670199 and they're all the same. WebKit head is at 3c79efc755327 and I'm building with build-webkit --qt --release --makeargs=-j30
Comment 18 Csaba Osztrogonác 2012-01-24 06:48:49 PST
(In reply to comment #17)
> Anyone else into this?
> 
> Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp:115:46: error: no matching function for call to 'QNetworkReply::ignoreSslErrors(const QList<QSslError>&)'
> 
> I've just verified with bbandix's hashes https://gist.github.com/1670199 and they're all the same. WebKit head is at 3c79efc755327 and I'm building with build-webkit --qt --release --makeargs=-j30

Have you got libssl-dev package installed? It seems no. :)
Because QNetworkReply::ignoreSslErrors is defined in #ifndef QT_NO_OPENSSL guard.
Comment 19 Rafael Brandao 2012-01-24 07:20:37 PST
(In reply to comment #18)
> (In reply to comment #17)
> > Anyone else into this?
> > 
> > Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp:115:46: error: no matching function for call to 'QNetworkReply::ignoreSslErrors(const QList<QSslError>&)'
> > 
> > I've just verified with bbandix's hashes https://gist.github.com/1670199 and they're all the same. WebKit head is at 3c79efc755327 and I'm building with build-webkit --qt --release --makeargs=-j30
> 
> Have you got libssl-dev package installed? It seems no. :)
> Because QNetworkReply::ignoreSslErrors is defined in #ifndef QT_NO_OPENSSL guard.

It did the trick! Thanks. :-)