Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-46949

Crash in QAtomInteger for iOS on A5X platforms

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.1
    • 5.5.0 RC
    • Core: Other
    • None
    • iOS/tvOS/watchOS
    • 7833f4852ab4c44a1fae75cfb1221e19a7b3256c

    Description

      Running this simple program on iOS 8 will crash on an iPad 3.
      Has 32bit A5X armv7 chip

      #include <QAtomicInteger>
      #include <QtQml/qqmldebug.h>
      #include <QDebug>
      
      int main(int, char *[])
      {
      #if defined(Q_ATOMIC_INT64_IS_SUPPORTED)
          static QAtomicInteger<quint64> m_curId = QAtomicInteger<quint64>(1);
      #else
          static QAtomicInteger<quint32> m_curId = QAtomicInteger<quint32>(1);
      #endif
          quint64 id = m_curId.fetchAndAddOrdered(1);
      
          qDebug() << id;
      
          return 0;
      }
      

      Not including qqmldebug.h makes the crash go away.

      It runs fine on an iPhone 6 (arm64).

      call stack:

      #0	0x0002a82e in unsigned long long QBasicAtomicOps<8>::fetchAndAddRelaxed<unsigned long long>(unsigned long long&, QAtomicAdditiveType<unsigned long long>::AdditiveT) at /Users/mike/Developers/build-QAtomicIntTest-iphoneos_clang_Qt_5_5_0_qt5_ios-Debug/../qt5_ios/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/arch/qatomic_armv6.h:650
      #1	0x0002a7fc in unsigned long long QGenericAtomicOps<QBasicAtomicOps<8> >::fetchAndAddOrdered<unsigned long long>(unsigned long long&, QAtomicAdditiveType<unsigned long long>::AdditiveT) [inlined] at /Users/mike/Developers/build-QAtomicIntTest-iphoneos_clang_Qt_5_5_0_qt5_ios-Debug/../qt5_ios/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/thread/qgenericatomic.h:253
      #2	0x0002a7ec in QBasicAtomicInteger<unsigned long long>::fetchAndAddOrdered(unsigned long long) at /Users/mike/Developers/build-QAtomicIntTest-iphoneos_clang_Qt_5_5_0_qt5_ios-Debug/../qt5_ios/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/thread/qbasicatomic.h:175
      #3	0x0002a6c4 in main at /Users/mike/Developers/QAtomicIntTest/main.cpp:12
      

      Attachments

        1. main-arv7-release.asm
          4 kB
          James Turner
        2. main-arm64.asm
          3 kB
          Mike Krus
        3. main-armv7.asm
          6 kB
          Mike Krus
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            mkrus Mike Krus
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes