Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-273

Sensors crashes when constructing a sensor object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 1.0.1
    • 1.0.0
    • Sensors
    • None
    • Symbian
    • 5e22e6ad9f7069b36605a1263dd90443b1cd475f

      Sensors crashes with a segfault when constructing a sensor object.

      QAccelerometer *acc = new QAccelerometer;
      

      A workaround is to create a QSensor and use a string literal for the type.

      QSensor *acc = new QSensor("QAccelerometer");
      

      The cause appears to be that the ::type members have different values depending on whether they're accessed from inside or outside of the QtSensors DLL. Accessing the value outside of the DLL results in a segfault.

      const char *bad_value = QAccelerometer::type;
      char crash = QAccelerometer::type[0]; // segfault unless this code is compiled into the QtSensors DLL
      

        1. extra_const.patch
          9 kB
          Lincoln Ramsay (closed Nokia identity)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            lramsay Lincoln Ramsay (closed Nokia identity) (Inactive)
            lramsay Lincoln Ramsay (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes