[Interest] tst_qatomicinteger build failure (5.9 i386/x86_64)

Thiago Macieira thiago.macieira at intel.com
Sat Sep 2 09:56:37 CEST 2017


On Saturday, 2 September 2017 00:02:58 PDT Christian Gagneraud wrote:
> > Correct. We just ignore the failure. There's nothing we can do about it.
> 
> Really? How do you cope in CI? You don't build for linux-32 anymore?

That looks like it's the case. See 
https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1504282591
for an example of a failed build hat shows all the architectures tested by the 
CI.

There's a second round of slower CI that QA runs every now and then. It may 
contain 32-bit builds, but if so the failure from this test is just ignored.

> > You cannot. Just ignore this failure.
> 
> Scary, i then cannot run the tests about Qt's atomic integer solutions!

Run for the other ones (8-, 16- and 32-bit).

> Does QAtomicInteger<quint64> works safely with Qt 5.6 on a linux 32
> bits box with gcc > 5.1?

Define "safely".

If you mean that it generates proper atomic code to access 64-bit quantities? 
It does. Disassembly of the code produced by GCC and Clang reveals it's 
correct, and if you work around the failure, the rest of the test passes.

If you mean you can replace an existing qunit64 in a structure with a 
QAtomicInteger<quint64> and keep binary compatibility, there's a 50-50% chance 
that it won't. This is the test that is failing.

> Should i use QAtomicInteger<quint64> on 64bits and
> QAtomicInteger<quint32> on 32 bits?

Yes. There are even two helper typedefs for you: quintptr and qregisteruint. 
The former is the size of a pointer, the same size as qssize_t, qptrdiff, 
size_t and ptrdiff_t. The latter is the size of the machine's word, which is 
usually the same as the pointer, except for ILP32 on 64-bit machines.

> If you or I cannot build and so cannot run QAtomicInteger's test
> suites, then how do you or how do I know it works as adverstised?

Again, define "works as advertised". See above for the two possibilities.

I did test manually that the operations on a 64-bit quantity work. And I can 
clearly confirm that the alignment broke.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list