qtbase/tests/auto/widgets/kernel
Thiago Macieira 1da7558bfd QThread/Unix: revert to pthread destruction instead of thread_local
Amends 65093a84c2, 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
Pick-to: 6.9 6.8
Change-Id: Ie294dce7263b4189f89ffffd9155ec71d31b89d9
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-01-06 17:48:27 -03:00
..
qaction tst_QAction::disableShortcutsWithBlockedWidgets remove setActiveWindow 2024-04-30 18:30:16 +02:00
qactiongroup Change license for tests files 2024-02-04 09:56:42 +01:00
qapplication QThread/Unix: revert to pthread destruction instead of thread_local 2025-01-06 17:48:27 -03:00
qboxlayout QBoxLayout: don't crash on passing invalid index 2024-12-18 19:36:46 +00:00
qformlayout Change license for tests files 2024-02-04 09:56:42 +01:00
qgesturerecognizer Ubuntu 24.04 x64 - Blacklist tst_qgesturerecognizer touchReply 2024-12-27 12:26:18 +02:00
qgridlayout Tests: Reduce the number of module includes 2024-11-04 19:17:47 +01:00
qlayout QLayout: Consume ChildRemoved event, when layout is disabled 2024-04-10 19:01:06 +00:00
qshortcut Change for QTRY_COMPARE in flaky auto test tst_QShortcut::context() 2024-11-12 12:25:30 +01:00
qsizepolicy Fix duplicate datatags and other issues in tst_QSizePolicy 2024-10-02 13:29:14 +02:00
qstackedlayout Add widgetAdded signal for QStackedWidget and QStackedLayout 2024-12-02 15:43:32 +00:00
qtooltip tst_QTooltip::qtbug64550_stylesheet() remove setActiveWindow() 2024-04-26 18:19:37 +02:00
qwidget Extend blacklisting of tst_QWidget::showMinimizedKeepsFocus to macOS 15 2024-12-19 19:26:36 +01:00
qwidget_window tests: blacklist tst_QWidget_window::mouseMoveWithPopup() on u2404 x11 2024-10-01 22:13:22 +02:00
qwidgetaction Change license for tests files 2024-02-04 09:56:42 +01:00
qwidgetmetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qwidgetrepaintmanager widgets: Use per-surface-format RHI support and compositor 2024-06-01 00:24:34 +02:00
qwidgetsvariant Change license for tests files 2024-02-04 09:56:42 +01:00
qwindowcontainer tests: blacklist tst_QWindowContainer::testFocus() on Wayland 2024-10-02 05:45:59 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00