Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.9
-
None
-
928ddf32a (dev)
Description
The actual bug here is that PositioningMethod comes without an explicit underlying type. Therefore the compiler is free to interpret the given bit patterns as either signed or unsigned integer. However, the Q_DECLARE_FLAGS nails the flags down to signed. This only works because the QML engine has no clue what underlying type the compiler has chosen for the enum, then just assumes signed, and casts accordingly. Obviously this is a really brittle affair.
Unfortunately this is a public header. Can we change the underlying type of a public enum? I guess that breaks compatibility in some way or other.
The original symptom was that the tests started failing when QFlags briefly picked up the underlying type the compiler had chosen for the enum:
********* Start testing of declarative_positioning_core ********* Config: Using QtTest library 6.9.0, Qt 6.9.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0 20190222 (lookup) [qnx710 1535#57]), qnx unknown INFO : declarative_positioning_core::PositionSource::initTestCase() entering PASS : declarative_positioning_core::PositionSource::initTestCase() INFO : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() entering INFO : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() QCOMPARE(, ) Loc: [/home/qt/work/qt/qtpositioning/tests/auto/declarative_positioning_core/tst_positionsource.qml(330)] INFO : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() QCOMPARE(, ) Loc: [/home/qt/work/qt/qtpositioning/tests/auto/declarative_positioning_core/tst_positionsource.qml(331)] INFO : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() QCOMPARE(, ) Loc: [/home/qt/work/qt/qtpositioning/tests/auto/declarative_positioning_core/tst_positionsource.qml(332)] INFO : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() QCOMPARE(, ) Loc: [/home/qt/work/qt/qtpositioning/tests/auto/declarative_positioning_core/tst_positionsource.qml(333)] FAIL! : declarative_positioning_core::PositionSource::test_bindPositionSourceProperties() Compared values are not the same Actual (): 4294967040 Expected (): -256 Loc: [/home/qt/work/qt/qtpositioning/tests/auto/declarative_positioning_core/tst_positionsource.qml(333)] INFO : declarative_positioning_core::PositionSource::cleanupTestCase() entering PASS : declarative_positioning_core::PositionSource::cleanupTestCase() Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 6ms ********* Finished testing of declarative_positioning_core ********* qt-testrunner.py INFO: Test process exited with code: 1 qt-testrunner.py INFO: Test has FAILed despite all repetitions! re-runs:5 failures:5 CMake Error at tst_declarative_positioning_coreWrapperRelWithDebInfo.cmake:18 (message): /home/qt/work/install/libexec/qt-testrunner.py -- /home/qt/work/qt/qtpositioning/coin_qnx_qemu_runner.sh /home/qt/work/qt/qtpositioning_standalone_tests/tests/auto/declarative_positioning_core/tst_declarative_positioning_core execution failed with exit code 2. 31/34 Test #31: tst_declarative_positioning_core ...............***Failed 11.30 sec 97% tests passed, 1 tests failed out of 31
Details: https://testresults.qt.io/coin/integration/qt/qtpositioning/tasks/1723679988
Tested changes (refs/builds/qtci/dev/1723673437):
https://codereview.qt-project.org/c/qt/qtpositioning/+/583168/2 Update dependencies on 'dev' in qt/qtpositioning
Attachments
Issue Links
- resulted in
-
QTBUG-128131 Extract correct signedness for flagged enum types
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-128122 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
583367,3 | Revert "QMetaType: extract the signedness of a QFlags enum type" | dev | qt/qtbase | Status: MERGED | +2 | 0 |