From a5cded843f495b4276a8289b1324778d97bed5ba Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 11 Feb 2019 10:52:06 +0100 Subject: [PATCH 01/11] Avoid creating wide images with negative bytesPerLine The QImage API can not handle images with more bytes per line than what an integer can hold. Fixes: QTBUG-73731 Fixes: QTBUG-73732 Change-Id: Ieed6fec7645661fd58d8d25335f806faaa1bb3e9 Reviewed-by: Thiago Macieira --- src/gui/image/qimage.cpp | 11 +++++++++-- src/gui/image/qimage.h | 4 ++++ src/gui/image/qimage_p.h | 6 ++++++ tests/auto/gui/image/qimage/tst_qimage.cpp | 20 ++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 9897c3aa6f..3e18ca6528 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -124,7 +124,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format) int height = size.height(); int depth = qt_depthForFormat(format); auto params = calculateImageParameters(width, height, depth); - if (params.bytesPerLine < 0) + if (!params.isValid()) return nullptr; QScopedPointer d(new QImageData); @@ -781,7 +781,7 @@ QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QIm const int depth = qt_depthForFormat(format); auto params = calculateImageParameters(width, height, depth); - if (params.totalSize < 0) + if (!params.isValid()) return nullptr; if (bpl > 0) { @@ -1484,10 +1484,17 @@ qsizetype QImage::sizeInBytes() const \sa scanLine() */ +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) +qsizetype QImage::bytesPerLine() const +{ + return d ? d->bytes_per_line : 0; +} +#else int QImage::bytesPerLine() const { return d ? d->bytes_per_line : 0; } +#endif /*! diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 4b7a3b1ead..6505fd5845 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -227,7 +227,11 @@ public: uchar *scanLine(int); const uchar *scanLine(int) const; const uchar *constScanLine(int) const; +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) + qsizetype bytesPerLine() const; +#else int bytesPerLine() const; +#endif bool valid(int x, int y) const; bool valid(const QPoint &pt) const; diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index e3a6c53833..a0a3b5406e 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -109,6 +109,7 @@ struct Q_GUI_EXPORT QImageData { // internal image data struct ImageSizeParameters { qsizetype bytesPerLine; qsizetype totalSize; + bool isValid() const { return bytesPerLine > 0 && totalSize > 0; } }; static ImageSizeParameters calculateImageParameters(qsizetype width, qsizetype height, qsizetype depth); }; @@ -135,6 +136,11 @@ QImageData::calculateImageParameters(qsizetype width, qsizetype height, qsizetyp qsizetype dummy; if (mul_overflow(height, qsizetype(sizeof(uchar *)), &dummy)) return invalid; // why is this here? +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + // Disallow images where width * depth calculations might overflow + if (width > (INT_MAX - 31) / depth) + return invalid; +#endif return { bytes_per_line, total_size }; } diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index eded206d37..6bc27a6e16 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -230,6 +230,8 @@ private slots: void convertColorTable(); + void wideImage(); + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void toWinHBITMAP_data(); void toWinHBITMAP(); @@ -3535,6 +3537,24 @@ void tst_QImage::convertColorTable() QCOMPARE(rgb32.pixel(0,0), 0xffffffff); } +void tst_QImage::wideImage() +{ + // QTBUG-73731 and QTBUG-73732 + QImage i(538994187, 2, QImage::Format_ARGB32); + QImage i2(32, 32, QImage::Format_ARGB32); + i2.fill(Qt::white); + + // Test that it doesn't crash: + QPainter painter(&i); + // With the composition mode is SourceOver out it's an invalid write + // With the composition mode is Source it's an invalid read + painter.drawImage(0, 0, i2); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.drawImage(0, 0, i2); + + // Qt6: Test that it actually works on 64bit architectures. +} + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QT_BEGIN_NAMESPACE Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0); From 1366c4f04645d74e83847687adcf61ecfa20b3d2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 18 Feb 2019 10:44:21 +0100 Subject: [PATCH 02/11] androiddeployqt: Do not check for stdcpp-path in auxiliary mode Fixes: QBS-1429 Change-Id: I189bc42fdee5e63f55705084247fbfc4448a6b65 Reviewed-by: Joerg Bornemann --- src/tools/androiddeployqt/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 712a8091fb..6f08238bcc 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -891,7 +891,7 @@ bool readInputFile(Options *options) options->extraPlugins = extraPlugins.toString().split(QLatin1Char(',')); } - { + if (!options->auxMode) { const QJsonValue stdcppPath = jsonObject.value(QStringLiteral("stdcpp-path")); if (stdcppPath.isUndefined()) { fprintf(stderr, "No stdcpp-path defined in json file.\n"); From 93a78799c3df7c8859b2d9addad45bb4a535dc97 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 13 Feb 2019 23:26:55 +0800 Subject: [PATCH 03/11] Fix compilation with icc, converting between egl's and gl's Error types Each has two constructors from the other, one copying the other moving; and this leads to an ambiguous overload when converting Texture::onDestroy()'s gl::error to the egl::Error that gl::Context::onDestroy() returns. Passing the value through a temporary prevents the move-constructor from being attempted and saves the day. Thanks to Ville Voutilainen for suggesting the fix. Fixes: QTBUG-73698 Change-Id: I628173399a73cee2e253201bc3e8d3e6477a2fbf Reviewed-by: Oliver Wolff Reviewed-by: Edward Welbourne --- src/3rdparty/angle/src/libANGLE/Context.cpp | 3 +- src/3rdparty/angle/src/libANGLE/Stream.cpp | 8 +- src/3rdparty/angle/src/libANGLE/Texture.cpp | 3 +- .../libANGLE/renderer/d3d/d3d9/Renderer9.cpp | 3 +- ...with-icc-converting-between-egl-s-an.patch | 93 +++++++++++++++++++ 5 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch diff --git a/src/3rdparty/angle/src/libANGLE/Context.cpp b/src/3rdparty/angle/src/libANGLE/Context.cpp index f638beda58..84f7936feb 100644 --- a/src/3rdparty/angle/src/libANGLE/Context.cpp +++ b/src/3rdparty/angle/src/libANGLE/Context.cpp @@ -451,7 +451,8 @@ egl::Error Context::onDestroy(const egl::Display *display) for (auto &zeroTexture : mZeroTextures) { - ANGLE_TRY(zeroTexture.second->onDestroy(this)); + auto result = zeroTexture.second->onDestroy(this); + ANGLE_TRY(egl::Error(result)); zeroTexture.second.set(this, nullptr); } mZeroTextures.clear(); diff --git a/src/3rdparty/angle/src/libANGLE/Stream.cpp b/src/3rdparty/angle/src/libANGLE/Stream.cpp index 68279976b7..e384c7d486 100644 --- a/src/3rdparty/angle/src/libANGLE/Stream.cpp +++ b/src/3rdparty/angle/src/libANGLE/Stream.cpp @@ -192,8 +192,9 @@ Error Stream::consumerAcquire(const gl::Context *context) { if (mPlanes[i].texture != nullptr) { - ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( - context, mProducerImplementation->getGLFrameDescription(i))); + auto result = mPlanes[i].texture->acquireImageFromStream( + context, mProducerImplementation->getGLFrameDescription(i)); + ANGLE_TRY(Error(result)); } } @@ -213,7 +214,8 @@ Error Stream::consumerRelease(const gl::Context *context) { if (mPlanes[i].texture != nullptr) { - ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); + auto result = mPlanes[i].texture->releaseImageFromStream(context); + ANGLE_TRY(Error(result)); } } diff --git a/src/3rdparty/angle/src/libANGLE/Texture.cpp b/src/3rdparty/angle/src/libANGLE/Texture.cpp index da92e65916..7447604fe6 100644 --- a/src/3rdparty/angle/src/libANGLE/Texture.cpp +++ b/src/3rdparty/angle/src/libANGLE/Texture.cpp @@ -550,7 +550,8 @@ Error Texture::onDestroy(const Context *context) { if (mBoundSurface) { - ANGLE_TRY(mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER)); + auto result = mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER); + ANGLE_TRY(Error(result)); mBoundSurface = nullptr; } if (mBoundStream) diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp index 75c6298868..b583273641 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp @@ -376,7 +376,8 @@ egl::Error Renderer9::initializeDevice() ASSERT(!mBlit); mBlit = new Blit9(this); - ANGLE_TRY(mBlit->initialize()); + auto result = mBlit->initialize(); + ANGLE_TRY(egl::Error(result)); ASSERT(!mVertexDataManager && !mIndexDataManager); mVertexDataManager = new VertexDataManager(this); diff --git a/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch b/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch new file mode 100644 index 0000000000..6d3b1cac08 --- /dev/null +++ b/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch @@ -0,0 +1,93 @@ +From 2d8118620d4871f74a3ddca233529ff540384477 Mon Sep 17 00:00:00 2001 +From: Yuhang Zhao <2546789017@qq.com> +Date: Wed, 13 Feb 2019 23:26:55 +0800 +Subject: [PATCH] Fix compilation with icc, converting between egl's and gl's + Error types + +Each has two constructors from the other, one copying the other +moving; and this leads to an ambiguous overload when converting +Texture::onDestroy()'s gl::error to the egl::Error that +gl::Context::onDestroy() returns. Passing the value through a +temporary prevents the move-constructor from being attempted and saves +the day. Thanks to Ville Voutilainen for suggesting the fix. + +Fixes: QTBUG-73698 +Change-Id: I628173399a73cee2e253201bc3e8d3e6477a2fbf +--- + src/3rdparty/angle/src/libANGLE/Context.cpp | 3 ++- + src/3rdparty/angle/src/libANGLE/Stream.cpp | 8 +++++--- + src/3rdparty/angle/src/libANGLE/Texture.cpp | 3 ++- + .../angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp | 3 ++- + 4 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/Context.cpp b/src/3rdparty/angle/src/libANGLE/Context.cpp +index f638beda58..84f7936feb 100644 +--- a/src/3rdparty/angle/src/libANGLE/Context.cpp ++++ b/src/3rdparty/angle/src/libANGLE/Context.cpp +@@ -451,7 +451,8 @@ egl::Error Context::onDestroy(const egl::Display *display) + + for (auto &zeroTexture : mZeroTextures) + { +- ANGLE_TRY(zeroTexture.second->onDestroy(this)); ++ auto result = zeroTexture.second->onDestroy(this); ++ ANGLE_TRY(egl::Error(result)); + zeroTexture.second.set(this, nullptr); + } + mZeroTextures.clear(); +diff --git a/src/3rdparty/angle/src/libANGLE/Stream.cpp b/src/3rdparty/angle/src/libANGLE/Stream.cpp +index 68279976b7..e384c7d486 100644 +--- a/src/3rdparty/angle/src/libANGLE/Stream.cpp ++++ b/src/3rdparty/angle/src/libANGLE/Stream.cpp +@@ -192,8 +192,9 @@ Error Stream::consumerAcquire(const gl::Context *context) + { + if (mPlanes[i].texture != nullptr) + { +- ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( +- context, mProducerImplementation->getGLFrameDescription(i))); ++ auto result = mPlanes[i].texture->acquireImageFromStream( ++ context, mProducerImplementation->getGLFrameDescription(i)); ++ ANGLE_TRY(Error(result)); + } + } + +@@ -213,7 +214,8 @@ Error Stream::consumerRelease(const gl::Context *context) + { + if (mPlanes[i].texture != nullptr) + { +- ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); ++ auto result = mPlanes[i].texture->releaseImageFromStream(context); ++ ANGLE_TRY(Error(result)); + } + } + +diff --git a/src/3rdparty/angle/src/libANGLE/Texture.cpp b/src/3rdparty/angle/src/libANGLE/Texture.cpp +index da92e65916..7447604fe6 100644 +--- a/src/3rdparty/angle/src/libANGLE/Texture.cpp ++++ b/src/3rdparty/angle/src/libANGLE/Texture.cpp +@@ -550,7 +550,8 @@ Error Texture::onDestroy(const Context *context) + { + if (mBoundSurface) + { +- ANGLE_TRY(mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER)); ++ auto result = mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER); ++ ANGLE_TRY(Error(result)); + mBoundSurface = nullptr; + } + if (mBoundStream) +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp +index 75c6298868..b583273641 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp +@@ -376,7 +376,8 @@ egl::Error Renderer9::initializeDevice() + + ASSERT(!mBlit); + mBlit = new Blit9(this); +- ANGLE_TRY(mBlit->initialize()); ++ auto result = mBlit->initialize(); ++ ANGLE_TRY(egl::Error(result)); + + ASSERT(!mVertexDataManager && !mIndexDataManager); + mVertexDataManager = new VertexDataManager(this); +-- +2.20.1.windows.1 + From 655e8623afed01de63ce43f55227fb019e800fe9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 14 Feb 2019 11:45:13 +0100 Subject: [PATCH 04/11] Fix QSplashscreen positioning on Android Android does not use QPlatformWindow::initialGeometry(), so the underlying assumption of 56e92dfdf255231aff0034d2e197fd096da7f0c0 was wrong. Try to explicitly find a screen and default to primary. Fixes: QTBUG-73794 Change-Id: Iba3e70657a60babfcedf751335ca55cb971a4f99 Reviewed-by: Oliver Wolff --- src/widgets/widgets/qsplashscreen.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index 4af4f90119..bf6bf1c7c9 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -289,8 +289,7 @@ void QSplashScreen::setPixmap(const QPixmap &pixmap) // 1) If a QDesktopScreenWidget is found in the parent hierarchy, use that (see docs on // QSplashScreen(QWidget *, QPixmap). // 2) If a widget with associated QWindow is found, use that -// 3) When nothing can be found, do not position the widget, allowing for -// QPlatformWindow::initialGeometry() to center it over the cursor +// 3) When nothing can be found, try to center it over the cursor static inline int screenNumberOf(const QDesktopScreenWidget *dsw) { @@ -307,7 +306,15 @@ const QScreen *QSplashScreenPrivate::screenFor(const QWidget *w) if (QWindow *window = p->windowHandle()) return window->screen(); } - return nullptr; +#if QT_CONFIG(cursor) + // Note: We could rely on QPlatformWindow::initialGeometry() to center it + // over the cursor, but not all platforms (namely Android) use that. + if (QGuiApplication::screens().size() > 1) { + if (auto screenAtCursor = QGuiApplication::screenAt(QCursor::pos())) + return screenAtCursor; + } +#endif // cursor + return QGuiApplication::primaryScreen(); } void QSplashScreenPrivate::setPixmap(const QPixmap &p, const QScreen *screen) From 0f163887b526d00ccdcead907dde042aa370fc16 Mon Sep 17 00:00:00 2001 From: Juha Karjalainen Date: Tue, 19 Feb 2019 13:57:47 +0200 Subject: [PATCH 05/11] Fix blacklisting tst_QTimer::basic_chrono() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blacklisting did not work as blacklist should have contained osx instead macos Change-Id: Ifd76a38d371ccce545eb5df030aaa819b00a5b48 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/kernel/qtimer/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST index c31e15f171..16cbab4587 100644 --- a/tests/auto/corelib/kernel/qtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST @@ -2,4 +2,4 @@ windows osx [basic_chrono] -macos +osx From d6d80ff2e925c5c52de498535cfdb808b3bd3670 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 21 Feb 2019 16:43:58 +0100 Subject: [PATCH 06/11] Automatic resources: Fix tooling support The files to be put into an auto-generated qrc file must not simply disappear, because IDE users still need to have them in the project tree. So we add them to OTHER_FILES now. Task-number: QTCREATORBUG-20103 Task-number: QTCREATORBUG-20104 Change-Id: I8a9136491f975def7c33385e375c407815ad269a Reviewed-by: hjk Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index bb2a55b93d..b4e0db6445 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -28,6 +28,7 @@ for(resource, RESOURCES) { !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \ warning("Failure to find: $$resource") qmake_immediate.files += $$resource + OTHER_FILES *= $$resource } RESOURCES -= $$resource next() @@ -57,6 +58,7 @@ for(resource, RESOURCES) { alias = $$relative_path($$file, $$abs_base) resource_file_content += \ "$$xml_escape($$file)" + OTHER_FILES *= $$file } } From 90959f7080d0d6d9953f0bc5fa7ac01a3e82e85f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 25 Feb 2019 12:08:21 +0100 Subject: [PATCH 07/11] Add all library dependencies for static OpenSSL builds on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static builds of OpenSSL can now be linked with -openssl-linked without passing additional library dependencies like user32 or advapi32. Fixes: QTBUG-73205 Change-Id: I66c13096b0a1466c1e6dfbd014123e18655270e6 Reviewed-by: Mårten Nordheim Reviewed-by: Timur Pocheptsov --- src/network/configure.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/configure.json b/src/network/configure.json index f3e18662aa..2c005f0efb 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -84,11 +84,11 @@ "sources": [ { "type": "openssl" }, { - "libs": "-lssleay32 -llibeay32", + "libs": "-lssleay32 -llibeay32 -lUser32 -lWs2_32 -lAdvapi32 -lGdi32", "condition": "config.win32" }, { - "libs": "-llibssl -llibcrypto", + "libs": "-llibssl -llibcrypto -lUser32 -lWs2_32 -lAdvapi32 -lCrypt32", "condition": "config.msvc" }, { From 96f6cab22cab252cbe7a98bbeadde95497e0bd75 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Feb 2019 10:38:58 +0100 Subject: [PATCH 08/11] Blacklist nouveau and llvmpipe for multithreading After removing Mesa drivers from being blank blacklisted, we still need to blacklist nouveau specifically due to their lack of proper locking: https://bugs.freedesktop.org/show_bug.cgi?id=91632 llvmpipe is similarly blacklisted for now, as we lack enough information to know if the underlying issue behind QTCREATORBUG-10666 has been solved. Fixes: QTBUG-73715 Change-Id: I1a60b562cd9db94fa8462b922d6bfeebf0088dc5 Reviewed-by: Laszlo Agocs --- .../xcb_glx/qglxintegration.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index d42a33c22b..476de6d1e5 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -652,6 +652,12 @@ static const char *qglx_threadedgl_blacklist_renderer[] = { 0 }; +static const char *qglx_threadedgl_blacklist_vendor[] = { + "llvmpipe", // QTCREATORBUG-10666 + "nouveau", // https://bugs.freedesktop.org/show_bug.cgi?id=91632 + nullptr +}; + void QGLXContext::queryDummyContext() { if (m_queriedDummyContext) @@ -710,6 +716,18 @@ void QGLXContext::queryDummyContext() } } } + if (const char *vendor = (const char *) glGetString(GL_VENDOR)) { + for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) { + if (strstr(vendor, qglx_threadedgl_blacklist_vendor[i]) != 0) { + qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " + "blacklisted vendor \"" + << qglx_threadedgl_blacklist_vendor[i] + << "\""; + m_supportsThreading = false; + break; + } + } + } if (glxvendor && m_supportsThreading) { // Blacklist Mesa drivers due to QTCREATORBUG-10875 (crash in creator), From 01f5d41a406b7baf1cb01692c870e5084fc11b1f Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 20 Feb 2019 13:30:52 +0100 Subject: [PATCH 09/11] Make tst_QUdpSocket::lincLocalIPv6 less sadistic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails on CI (Windows 10). Given our qabstractsocket disables read notifications/stops emitting readyRead if it already has pending data (unbuffered, aka UDP socket type) - make sure we do not suffer from this. The change does not affect the test's logic (unless the logic was to fail), it just makes it more fail-proof. Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197 Fixes: QTBUG-73884 Reviewed-by: Edward Welbourne Reviewed-by: Mårten Nordheim (cherry picked from commit d3eb9e944ac73f238b8716bb25b8051377bba946) Reviewed-by: Timur Pocheptsov --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8ebb27e58c..707c1acf48 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1640,15 +1640,14 @@ void tst_QUdpSocket::linkLocalIPv6() sockets << s; } - QUdpSocket neutral; - QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); - QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); - QByteArray testData("hello"); foreach (QUdpSocket *s, sockets) { + QUdpSocket neutral; + QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); + QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); + QSignalSpy spy(s, SIGNAL(readyRead())); - neutralReadSpy.clear(); QVERIFY(s->writeDatagram(testData, s->localAddress(), neutral.localPort())); QTRY_VERIFY(neutralReadSpy.count() > 0); //note may need to accept a firewall prompt From e8d3306c8f86bf21648693521d8be91bb8f1335e Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Wed, 20 Feb 2019 15:21:30 +0200 Subject: [PATCH 10/11] Add changes file for Qt 5.12.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Done-with: Thiago Macieira Change-Id: Ia8c265403aa557be180eaa634474fb5f96a52b9f Reviewed-by: Edward Welbourne Reviewed-by: Tor Arne Vestbø Reviewed-by: Thiago Macieira --- dist/changes-5.12.2 | 105 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 dist/changes-5.12.2 diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2 new file mode 100644 index 0000000000..dc61d135a7 --- /dev/null +++ b/dist/changes-5.12.2 @@ -0,0 +1,105 @@ +Qt 5.12.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - QtTestLib: + * [QTBUG-72928] Blacklisting of tests will be taken into account for + XPASS and XFAIL. A blacklisted test that causes an XPASS will no + longer be a fail. + +**************************************************************************** +* QtCore * +**************************************************************************** + + - [QTBUG-72885] Fixed a number of warnings with Clang or Clang-Tidy in + Qt headers related to alignment of Qt private classes. + + - QDate, QTime and QDateTime; + * [QTBUG-51208] Corrected documentation of how non-placeholder + characters are handled in format patterns passed to toString(). + + - QCoreApplication: + * [QTBUG-57171] Fixed an out-of-bounds access if the translatable + string passed to tr() ended in '%'. + + - QFileInfo: + * [QTBUG-72644] Fixed a bug that would cause QFileInfo to report an + link incorrectly as a non-link. + + - QLocale: + * Fixed a crash if qDebug() is used after main() has exited. + * [QTBUG-73403] Fixed a race condition in getting the system locale + (possible regression from Qt 5.11.x) + + - QSysInfo: + * Fixed a bug on BSD systems in getting the machineUniqueId(). + * Fixed a bug on Windows in 32-bit applications getting the + machineUniqueId() when the OS is 64-bit. + + - QWaitCondition: + * Fixed handling of wait(QDeadlineTimer::Forever) on 32-bit platforms. + +**************************************************************************** +* QtWidgets * +**************************************************************************** + + - ItemViews: + * Fixed a regression with wrongly drawn centered/right aligned item + texts + +**************************************************************************** +* Third-Party Code * +**************************************************************************** + + - libpng was updated to version 1.6.36 + +**************************************************************************** +* Freetype * +**************************************************************************** + + - Upgraded bundled Freetype version to 2.9.1. This also adds support for + the latest emoji font in use on Android 9. + +**************************************************************************** +* Android * +**************************************************************************** + + - Added the --no-strip command line option to androiddeployqt. + + - qmake: + * Can now set the version name and code for Android using + ANDROID_VERSION_NAME and ANDROID_VERSION_CODE respectively in the pro + file. + +**************************************************************************** +* Windows * +**************************************************************************** + + - Fixed an issue where loading fonts from files or data would sometimes + mistakenly classify them as oblique. + +**************************************************************************** +* qmake * +**************************************************************************** + + - [QTBUG-27079] A new feature "cmdline" was added that implies "CONFIG += + console" and "CONFIG -= app_bundle". From 856fb1ab44722f5165fb6b5dec0bd748006acd10 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 5 Mar 2019 10:49:10 +0100 Subject: [PATCH 11/11] xcb: check for nullptr when reading AT_SPI_BUS property We always have to check the return value of xcb_get_property(), but this code did not do it. These xcb functions do not check for validity of the pointer, so we have to make sure that we pass-in something valid: void * xcb_get_property_value (const xcb_get_property_reply_t *R) { return (void *) (R + 1); } int xcb_get_property_value_length (const xcb_get_property_reply_t *R) { return (R->value_len * (R->format / 8)); } Fixes: QTBUG-74067 Change-Id: Iabbc81e6079d96c7314d16dd78783de07f9ad629 Reviewed-by: Mikhail Svetkin Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 524af5a2a7..6f3584f509 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -412,12 +412,15 @@ void *QXcbNativeInterface::atspiBus() auto reply = Q_XCB_REPLY(xcb_get_property, defaultConnection->xcb_connection(), false, defaultConnection->rootWindow(), atspiBusAtom, XCB_ATOM_STRING, 0, 128); - Q_ASSERT(!reply->bytes_after); + if (!reply) + return nullptr; + char *data = (char *)xcb_get_property_value(reply.get()); int length = xcb_get_property_value_length(reply.get()); return new QByteArray(data, length); } - return 0; + + return nullptr; } void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)