qt6-bb10/tests/auto/corelib/kernel
Thiago Macieira 5acbda4b06 QThread/Unix: revert to pthread destruction instead of thread_local
Amends 65093a84c2b94b1543fd4593bc45d491951d28d4, which changed how we
destroyed the main thread's QThreadData. This merges the call to
destroy_current_thread_data() for both types of Unix systems: those with
broken thread_local destructors and those with working ones. It turns
out that the function got called too early for us in those working
systems (see updated comment).

The clean up of the QThreadData is split into two different mechanisms:
 * for any auxiliary thread, when it exits, PThread will call back to
   destroy_current_thread_data()
 * for the thread that called ::exit(), PThread won't, but ::exit() will
   invoke set_thread_data()::TlsKey's destructor

This is different from the situation that existed prior to commit
65093a84c2b94b1543fd4593bc45d491951d28d4: first, there's no code in
qcoreapplication.cpp for this (all in qthread_unix.cpp). Second one may
call ::exit() from any thread, whether that is the thread that called
main(), the thread Qt thinks is theMainThread, or any other.

This commit moves the tst_QCoreApplication check for no extant objects
to a new test. I've chosen to add a new test instead of running a helper
binary via QProcess because we do have a couple of !QT_CONFIG(process)
platforms in the CI, and this is too important.

Credit to OSS-Fuzz for finding this, though it is not itself a fuzzying
problem (all tests of a given structure were crashing on exit).

Fixes: QTBUG-132381
Task-number: QTBUG-130895
Task-number: QTBUG-129927
Task-number: QTBUG-129846
Task-number: QTBUG-130341
Task-number: QTBUG-117996
Change-Id: Ie294dce7263b4189f89ffffd9155ec71d31b89d9
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1da7558bfd7626bcc40a214a90ae5027f32f6c7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6dc19b55fc6d6dd3198b744f713101cf3b77c0c8)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-01-14 02:21:01 -03:00
..
qapplicationstatic Change license for tests files 2024-02-04 09:56:42 +01:00
qchronotimer QChronoTimer: remove static singleShot() functions 2024-08-29 20:41:50 +00:00
qcoreapplication QThread/Unix: revert to pthread destruction instead of thread_local 2025-01-14 02:21:01 -03:00
qdeadlinetimer tst_QDeadlineTimer: fix format-string in toString() implementation 2024-07-22 21:00:13 +00:00
qelapsedtimer QElapsedTimer: use new comparison helper macros 2024-05-14 00:32:34 +02:00
qeventdispatcher tst_QEventDispatcher: port to QTEST_THROW_ON_FAIL 2024-06-18 08:09:13 +00:00
qeventloop Change license for tests files 2024-02-04 09:56:42 +01:00
qjniarray JNI: Constrain QJniArray::toContainer to compatible target containers 2024-07-20 01:13:40 +00:00
qjnienvironment Change license for tests files 2024-02-04 09:56:42 +01:00
qjniobject JNI: replace va_arg helper with variadic template 2025-01-13 14:52:09 +01:00
qjnitypes JNI: replace va_arg helper with variadic template 2025-01-13 14:52:09 +01:00
qmath Change license for tests files 2024-02-04 09:56:42 +01:00
qmetacontainer QMetaSequence and QMetaAssociation: use new comparison helper macros 2024-04-29 22:28:51 +02:00
qmetaenum QDebug: cast the QFlags value to the right-sized unsigned type (2/2) 2024-08-12 09:43:38 +00:00
qmetamethod QMetaMethod: use new comparison helper macros 2024-04-30 00:11:33 +02:00
qmetaobject Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qmetaobjectbuilder QMetaMethodBuilder: limit the bits of attribute()/setAttribute() 2024-10-29 20:51:12 +00:00
qmetaproperty Fix QFlag properties built by QMetaObjectBuilder 2024-10-29 20:51:12 +00:00
qmetatype QMetaType: use modern comparisons 2024-05-10 21:54:54 +02:00
qmimedata QMimeData: fix setData on URI list without ending CRLF 2024-04-22 13:57:38 -07:00
qobject tst_QObject: don't leak QtDeclarative::theData 2024-11-07 01:13:51 +00:00
qpermission Change license for tests files 2024-02-04 09:56:42 +01:00
qpointer QPointer: Use new comparison helper macros 2024-05-30 20:51:46 +02:00
qproperty Avoid referring to invalidated observer during binding evaluation 2024-10-07 17:26:50 +00:00
qsignalblocker Change license for tests files 2024-02-04 09:56:42 +01:00
qsignalmapper Change license for tests files 2024-02-04 09:56:42 +01:00
qsocketnotifier Change license for tests files 2024-02-04 09:56:42 +01:00
qtimer Timers: add Qt::TimerId enum class 2024-03-03 19:56:55 +02:00
qtranslator QTranslator: work around uiLanguages not including lang_Terr variants 2024-10-31 23:15:29 +02:00
qvariant qtypeinfo.h: move QTypeTraits part to qttypetraits.h 2024-06-04 13:42:16 +00:00
qwineventnotifier Change license for tests files 2024-02-04 09:56:42 +01:00
qwinregistrykey Replace QWinRegistryKey::dwordValue with QWinRegistryKey::value<T> 2024-11-09 20:00:08 +00:00
CMakeLists.txt Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00