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

SIGBUS in QDeclarativeVMEVariant::setValue

    XMLWordPrintable

Details

    Description

      SIGBUS occured when QML application compiled by gcc for MIPS executed.

      Detail:

      src/declarative/qml/qdeclarativevmemetaobject.cpp
      
      private:
          int type;
          void *data[4]; // Large enough to hold all types
      
          inline void cleanup();
      };
      
      

      QDeclarativeVMEVariant::data member is 4 byte alignment by gcc for MIPS,
      but this member is required 8 byte alignment.

      for example

      void QDeclarativeVMEVariant::setValue(double v)
      {
          if (type != QMetaType::Double) {
              cleanup();
              type = QMetaType::Double;
          }
          *(double *)(dataPtr()) = v;
      }
      
      

      To resolve this problem , coding for gcc

      private:
          int type;
          void *data[4] __attribute__((aligned(8))); // Large enough to hold all types
      
          inline void cleanup();
      };
      

      I have no idea for other compilers.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            aakenned Aaron Kennedy
            kacky Takaya Kakizaki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes