Qt Base (Core, Gui, Widgets, Network, ...)
Go to file
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
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
LICENSES Add REUSE.toml files 2024-11-05 14:36:16 +01:00
bin CMake: Don't hard-code "libexec" in qt-configure-module 2024-08-16 12:36:35 +02:00
cmake Add `*_check` build targets for auto cmake tests 2025-01-06 15:25:15 +01:00
coin Coin: Tweak VxWorks testrunner 2024-12-30 12:22:23 +02:00
config.tests Enable broken_threadlocal_dtors for VxWorks 2024-11-05 14:36:17 +01:00
dist Add REUSE.toml files 2024-11-05 14:36:16 +01:00
doc Android: document androidtestrunner tool 2024-12-19 21:09:54 +02:00
examples Mime type browser example: Add translator loader code 2025-01-06 18:56:19 +01:00
lib
libexec Android: fix warnings in runner script 2024-12-03 20:18:21 +00:00
mkspecs wasm: unifiy eventdispatcher asyncify code paths 2024-12-02 19:45:18 +01:00
qmake QString: toward UTF-8 arg() support [3½/4]: port unary arg() to QAnyStringView 2024-12-03 21:24:07 +01:00
src QThread/Unix: revert to pthread destruction instead of thread_local 2025-01-06 17:48:27 -03:00
tests QThread/Unix: revert to pthread destruction instead of thread_local 2025-01-06 17:48:27 -03:00
util Update CLDR to v46 2025-01-06 18:56:19 +01:00
.cmake.conf Bump version to 6.10.0 2024-12-13 14:54:23 +00:00
.gitattributes
.gitignore Git ignore Visual Studio CMake build directories 2023-11-24 23:42:05 +01:00
.tag
CMakeLists.txt cmake: add _extra_files IDE target from heuristics 2024-04-12 08:36:01 +08:00
REUSE.toml Add REUSE.toml files 2024-11-05 14:36:16 +01:00
config_help.txt Introduce emoji-segmenter to 3rdparty code 2024-11-18 15:52:13 +01:00
configure Do not assume FHS in scripts 2024-06-25 11:44:00 +02:00
configure.bat configure.bat: Fix errors on Windows 2024-03-05 11:56:24 +01:00
configure.cmake wasm: Fix warning message for Emscripten version mismatch 2024-12-10 19:45:16 +01:00
dependencies.yaml
licenseRule.json Include relevant Unicode Inc. copyright line in generated data files 2024-08-30 19:58:47 +02:00
qt_cmdline.cmake Introduce FFmpeg-related configure options 2024-12-03 22:52:45 +01:00