diff options
author | Michał Łoś <michal.los@siili.com> | 2024-05-15 16:41:13 +0200 |
---|---|---|
committer | Michał Łoś <michal.los@siili.com> | 2024-05-17 09:23:51 +0200 |
commit | e82b79d3824936d6cfa939a6053d3bde78af8735 (patch) | |
tree | 7fe6fce6f6442757a5e93f73d3fffb0f5deeda81 /src/gui/widgets/qabstractbutton.h | |
parent | 0beaa63d4adf6a30c9f48919c1d9f4908de738b4 (diff) |
Don't rely on TLS to call QThread::finish on VxW
On VxWorks, its pthread implementation fails on call to
`pthead_setspecific` which is made by first `QObject` constructor during
`QThreadPrivate::finish()`. This causes call to `QThreadData::current`,
since `QObject` doesn't have parent, and since the pthread is already
removed, it tries to set `QThreadData` for current pthread key, which
crashes.
The aforementioned `QObject`'s instances are created in multiple places
during `QThreadPrivate::finish` method, first one in during call to
`qCDebug()`.
The sequence currently leading to call to `QThreadData::current` starts
with `qCDebug` call in `QThreadPrivate::finish`, which:
- creates `QDebug` object, which
- creates `Stream`, which
- creates `QTextStream`, which
- creates `QTextStreamPrivate`, which
- creates `QDeviceClosedNotifier`, which
- is a `QObject`, which
- calls `QThreadData::current()` because its `parent` is nullptr.
Even ignoring debug print, next line calls
`QCoreApplication::sendPostedEvents` which calls `QThreadData::current`
directly.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I4d405eebdff0c63c6cd66fba4eaa95c3818ceaea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/widgets/qabstractbutton.h')
0 files changed, 0 insertions, 0 deletions