diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-06-18 22:46:15 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-06-19 12:16:00 +0200 |
commit | ea4d6b987ae10f1bb910081b523c3b22b11f7b64 (patch) | |
tree | 721b6ae9bf490312894d645a7f02d343c34cba72 /tests/auto/corelib/thread | |
parent | 797a493f5093187d2a849d9c483b79229a1316f0 (diff) |
Skip tests that terminate threads under ASAN
Thread termination might prevent stack unwinding, which then
generates ASAN errors such as
ERROR: AddressSanitizer: stack-buffer-underflow on address
0x7f3c1d7858b0 at pc 0x7f3c243d8918 bp 0x7f3c1d7857f0 sp 0x7f3c1d7857e8
Skip such tests so that we can enable blocking CI runs under ASAN.
Fixes: QTBUG-104421
Pick-to: 6.4 6.3
Change-Id: I169235a12190e3f72525cddfe1a44a4bee19eca1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'tests/auto/corelib/thread')
-rw-r--r-- | tests/auto/corelib/thread/qthread/tst_qthread.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index b5f2ebdabf..54309cbcb1 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -462,6 +462,10 @@ void tst_QThread::terminate() #if defined(Q_OS_ANDROID) QSKIP("Thread termination is not supported on Android."); #endif +#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) + QSKIP("Thread termination might result in stack underflow address sanitizer errors.") +#endif + Terminate_Thread thread; { QMutexLocker locker(&thread.mutex); @@ -528,6 +532,10 @@ void tst_QThread::terminated() #if defined(Q_OS_ANDROID) QSKIP("Thread termination is not supported on Android."); #endif +#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) + QSKIP("Thread termination might result in stack underflow address sanitizer errors.") +#endif + SignalRecorder recorder; Terminate_Thread thread; connect(&thread, SIGNAL(finished()), &recorder, SLOT(slot()), Qt::DirectConnection); @@ -1739,6 +1747,10 @@ Q_SIGNALS: void tst_QThread::terminateAndPrematureDestruction() { +#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) + QSKIP("Thread termination might result in stack underflow address sanitizer errors.") +#endif + WaitToRun_Thread thread; QSignalSpy spy(&thread, &WaitToRun_Thread::running); thread.start(); @@ -1755,6 +1767,10 @@ void tst_QThread::terminateAndPrematureDestruction() void tst_QThread::terminateAndDoubleDestruction() { +#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) + QSKIP("Thread termination might result in stack underflow address sanitizer errors.") +#endif + class ChildObject : public QObject { public: |