If a previous test in the same process or previously leaked a shared
memory or semaphore handle, tests could fail and cascade down. They
could also interfere with one another. So prevent this issue by
assigning a monotonically-increasing identifier per test function or row
tested and improving how we clean up those we did create.
This shows we need the API to explicitly clean up.
Change-Id: I12a088d1ae424825abd3fffd171db61d6b68a411
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's hard to maintain it with multiple backends and I don't see the need
for it.
Change-Id: I12a088d1ae424825abd3fffd171d7bf6bbdf9a99
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And we particularly want to avoid calling with Create twice.
Change-Id: I12a088d1ae424825abd3fffd171d6ab1fb87221f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native key.
Documentation in a new commit, when the dust settles.
Drive-by updates to the tst_QSharedMemory::attach row names, to fix
grammar and remove spaces and apostrophe.
Change-Id: I12a088d1ae424825abd3fffd171d3025c77f94d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native Qt.
Documentation in a new commit, when the dust settles.
Change-Id: I12a088d1ae424825abd3fffd171d2b549eeed040
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Apple sandboxes restrict use of the System V / XSI IPC mechanisms. It's
currently the only restriction we check for. Attempting to use them will
result in SIGSYS delivered to the application, so we shouldn't try.
Linux system call filtration can do the same. In fact, systemd's
SystemCallFilter= options do default to SIGSYS too and it has an @ipc
group that could be used to block SysV. However, the same group blocks
the creation of pipes, so it's not in much use.
Change-Id: I12a088d1ae424825abd3fffd171d79f7cd5b2b9d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is the new implementation of how to make platform-safe native keys,
for which no past compatibility is required nor promised. Unlike when we
started in Qt 4.4, it doesn't look there are many restrictions in names
anyway.
Important differences are:
* POSIX RT: no restrictions, we prepend the necessary '/'
* System V/XSI: no restrictions, it's just a file path anyway;
we pass absolute paths unchanged; otherwise we prepend RuntimeLocation
* Windows: no restrictions, but we do recognize Global\ and Local\
kernel objects without munging them
The use of the RuntimeLocation may cause a warning on Unix systems
(other than Apple ones and Android) if $XDG_RUNTIME_DIR isn't set.
We do enforce the Apple 30-character limit here, otherwise you get
ENAMETOOLONG.
Change-Id: I12a088d1ae424825abd3fffd171d3a0e09e06361
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The implementation only has #if now for Apple compatibility; otherwise,
we're relying on the QNativeIpcKey::Type parameter, because I intend to
allow Unix systems to support both POSIX realtime and System V / XSI
shared memory and semaphores.
Most of the uses of QtIpcCommon::isIpcSupported() will be constant
expressions because they don't depend on the ipcType.
Change-Id: I12a088d1ae424825abd3fffd171d38dfb6b5de74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Common to both QSharedMemory and QSystemSemaphore, this will hold the
native key and will replace the concept of non-native key in those
classes.
Change-Id: Id8d5e3999fe94b03acc1fffd171c03197aea6016
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
It's much easier to tell what happened.
Change-Id: I12a088d1ae424825abd3fffd171dbeb58c46fd6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In QSystemSemaphore (QSharedMemory already has it).
When running tst_QSharedMemory::useTooMuchMemory on 64-bit Linux with
POSIX IPC, we run out of file descriptors before we run out of memory.
Change-Id: I12a088d1ae424825abd3fffd171d6f34c002b5a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's just the setUnixErrorString() functions.
Change-Id: I12a088d1ae424825abd3fffd171d2880ebaf49c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Into separate classes. This temporarily compiles QSharedMemoryPosix
on most Unix systems despite defaulting to SystemV.
Change-Id: I12a088d1ae424825abd3fffd171d25efdee8d2de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Into separate classes. This temporarily compiles QSystemSemaphorePosix
on most Unix systems despite defaulting to SystemV.
Change-Id: I12a088d1ae424825abd3fffd171d23191fbb6db3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The two features are independent of one another. This also exports them
to qtcore-config_p.h, but leaves the QT_POSIX_IPC macro from
qtcore-config.h alone. Those four are also included on Windows builds,
so we won't need to #if them out of Windows.
Change-Id: I12a088d1ae424825abd3fffd171d1f0ae8e8f469
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This removes the second portion of the #if mess of shared code between
QSharedMemory and QSystemSemaphore for SystemV.
Change-Id: Id8d5e3999fe94b03acc1fffd171c073c2873206e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
So we don't have to mess around with #ifs to support the build.
Drive-by replace with unlink() some calls to QFile::remove(), which
create a QFSFileEngine, to call QFSFileEngine::remove, which calls
QFileSystemEngine::removeFile. Since we've just created the file with
qt_safe_open(), we may as well use the low-level Unix function to remove
too.
Change-Id: Id8d5e3999fe94b03acc1fffd171c06c7efc0b0f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's not a lot of files, but it's actually more in the same dir than
mime/ does right now. I'm about to add two more files, though I'll also
merge a few more later.
Change-Id: Id8d5e3999fe94b03acc1fffd171bfe2ea36a35a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QWidgetTextControlPrivate::mouseReleaseEvent() has early returns
implemented, e.g. when link has been right clicked or no selection
anchor has been found. These early returns, however, still consume
the event.
This leads to events getting lost instead of getting propagated:
As an example, a QLabel with rich text uses QWidgetTextControl. While
it propagates mouse press events back to its parent, mouse release
events get lost. A QLabel with plain text propagates both events
back correctly.
This patch adds QEvent::ignore() to the early return.
Since no test class exists for QWidgetTextControl, it adds a test in
tst_QLabel.
Fixes: QTBUG-110055
Pick-to: 6.5 6.4
Change-Id: I950f8c3f135793b01c59832835bb429db2282169
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The code is now unused as svg graphics have been introduced for
window decorations.
Change-Id: Iefe4543af2483fd9ff3eb6ce15b9905620927a9b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.
Task-number: QTBUG-99238
Change-Id: Iea9cda4fe0ae56043cc4d7db29ce53d9d737d645
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
AUTOUIC doesn't handle relative paths to .ui files in parent
directories when using Ninja Multi-Config.
The designer tool in qttools has such a ui file. This leads to the
following error when trying to build qttools together with examples as
ExternalProjects and Ninja Multi-Config:
ninja: error: 'src/designer/src/designer/designer_autogen/
include_Debug/ui_preferencesdialog.h', needed by
'src/designer/src/designer/designer_autogen:Debug',
missing and no known rule to make it
Until cmake is fixed, we can work around the issue by not adding
designer as a dependency when building EP examples, because no example
tries to use the app.
We can't exclude all apps from example dependencies because some
modules use qt_internal_add_app for tools as well, which are called
from public CMake API and also examples.
An example of this is qtapplicationmanager.
Given that we can't exclude all apps, introduce a function to
allow skipping single targets when building EP examples.
This will allow excluding designer specifically.
The examples will now depend on a new ${repo}_src_for_examples target
rather than ${repo}_src, which will exclude skipped targets.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-110369
Change-Id: I2f900253bbf7bac917f2293ef604ab3ea8f298e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Drop events are now handled in the wasm window element, which allows
the browser to select the drop target automatically. This also fixes
the case where drop data transfer finishes reading when a window
has already been closed and destroyed - the cancellation flag is now
owned by window so it gets invalidated as soon as window is gone.
The code has also been structured with a new DragEvent passthrough.
Fixes: QTBUG-109581
Change-Id: Ie3eb7446e2181fd540517f39397e8b35f111d009
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
These methods don't seem to be used by anyone now, but not sure
how it was before, so to not run into any BiC issues, just add
a comment to remove them in Qt 7.
Change-Id: Ie30a3d2adcbbb7530d9cf72f03b78ecfa06e426c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The 'WITH OIDS' was deprecated some time ago and removed with
PostgreSQL 12 so we have to adjust our test table creations. Don't know
why it was used in the first place at all.
Pick-to: 6.2 6.4 6.5
Change-Id: I6e18ac01e64368b1dd64e02bcb75fa70e05467a3
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The growBy() function takes the _increment_ of the size(), so needs to
add size() to increment for the call to realloc().
Add a test which hangs (vanilla build) or explodes (valgrind build)
without the fix.
Amends 26b227e128.
Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Pick-to: 6.5 6.4
Fixes: QTBUG-110412
Change-Id: I7ea91342fdcb779825c88013a3f86ba6d90ef530
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
various fixes like missing includes, linking, obsolete API usage, etc.
Pick-to: 6.5
Change-Id: I786bff396933b87cd39559ac8964d386ef368df1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This makes the exceptions prints tagged with the app's name/tag,
and also can allow QTest::ignoreMessage() to handle exceptions as now
it cannot filter messages out because they're printed by the Android
system.
Pick-to: 6.5
Change-Id: I9f5132b9ec5b5cd8fb35707eaaf68aa517f417ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Some public functions are still using int instead qsizetype which
can't be changed until Qt7.
Change-Id: Ib6f210c344acce9f3836e8a5493a741eb8b2b385
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Thanks to Ahmad for noting.
Amends 6bc227a06a.
Pick-to: 6.5
Change-Id: Ie6191bfc21d69f88a9a135f0d5f6b4fa8b09e8ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It wasn't added when this class was created in 5.0 because we couldn't
add move constructors and still keep the ability to compile Qt with
C++98 compilers. We've forgot to correct this shortcoming since 5.6.
Fixes: QTBUG-109842
Pick-to: 6.5
Change-Id: I69ecc04064514f939896fffd17376b8243b73c52
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
If an object had elements and then was emptied, it will have a non-null
d pointer, which wasn't taken into account in the comparison.
Fixes: QTBUG-109840
Pick-to: 6.5 6.4 6.2
Change-Id: I69ecc04064514f939896fffd17376aa18184653c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
range_access.h:274:5: error: inlining failed in call to ‘always_inline’
‘constexpr std::size_t std::size(const _Tp (&)[_Nm]) noexcept [with _Tp
= short unsigned int; long unsigned int _Nm = 34]’: target specific
option mismatch
qsimd.cpp:367:35: note: called from here
Pick-to: 6.5
Change-Id: Ide4dbd0777a44ed0870efffd1739097c71991822
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Passing a NumberMode lets it exclude floating-specific details for
integer parsing. For now this is only partially exploited, but later
work shall make more use of it.
Fixes: QTBUG-81756
Change-Id: If11d3a5a122d0714f645e58a51ee0d0c47ebe61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's always a constexpr (or static const that could be constexpr; fix
the cases of this while I'm here) or an integer literal, so we can, so
we might as well.
Change-Id: I61e9bcdb27f4a05f011ccce16b5f15d0dade0782
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
In addition to the fix, I've removed some legacy codes in the
`configure` file and delegated most of the work to
the `QtWriteArgsFile.cmake` which was being used by `configure.bat`. I
am not sure how this was supposed to work before since it was not really
working, but now, `config.opt` lives in the build directory, together
with `config.opt.in` (a template file), and the `config.redo` (and
`config.redo.in`) which holds the full redo command. The template files
are being used to preserve the quoted variables and to help
QtWriteArgFiles process the opt files more consistency.
Also fixed an issue on Unix, where ./configure was failing to run if
its path contained spaces, e.g., `Qt Src/qt5/configure`.
Fixes: QTBUG-108287
Change-Id: I9843b690a1fd3177a93e55e08a3484a4c85ba2e8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use a stack buffer, and perform the recoding from L1 to U8 in chunks.
Solves the L1 case of
Task-number: QTBUG-109284
Pick-to: 6.5
Change-Id: Ia9ac7d8b27fd452d24d9e27f0575f9fc83b6dcbc
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add TARGET instruction in property setter, used in debug mode on macOS.
Task-number: QTBUG-107842
Task-number: QTBUG-109227
Change-Id: I8704b7009c36ea8ddbf8773abfaf2b5f34f728ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We wasting time and resources by signing binaries that
are for internal use only.
Change-Id: Ic3271af7f11dac05979ff14a7ffa3f9075fe0ecb
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This reverts commit 6a18bc8090.
Reason for revert: The reason for the original revert has been fixed
in c146d25a87.
Change-Id: I996960633dc75a7ef3ae12ab7f759658af7932c5
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Any QHttp1Configuration object created has 'ShortData data' as active
member. std::exchange()ing or qt_ptr_swap()ping 'Private *d', then, is
accessing the inactive member of the union, and that's UB.
Fix by swapping and copying the whole union, as opposed to any of its
members, and, in the move constructor, activating Private *d.
This is now safe, as assigning to 'd' ends 'data's life-time and
starts 'd's. Even if we assign a well-formed object to a moved-from
object, we either swap or copy the whole union, so SEP. For
self-move-assignment in the moved-from state (Hinnant Criterion),
we're using std::swap() on the whole union, so SEP.
In addition, activating `Private *d` in moved-from objects means that
a future ~Public's use of unconditional 'delete d' won't invoke UB,
either.
Thanks to Peppe for insisting on fixing this.
Pick-to: 6.5
Change-Id: Ic1323b8416d6b17ae21768c625de1daba0944133
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>