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

QtPositioning error in Qt 5.3 RC on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.3.1
    • 5.3.0 RC1
    • Positioning
    • None
    • Ubuntu 13.10 x64
    • Android

    Description

      This is sample of my code, where I create sources of position and satellites:

      QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
      if (source) {
      QStringList posSourcesList = QGeoPositionInfoSource::availableSources();
      qDebug() << "Position sources count: " << posSourcesList.count();
      foreach (const QString &src, posSourcesList)

      { qDebug() << "pos source in list: " << src; }

      source->startUpdates();
      connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
      this, SLOT(positionUpdated(QGeoPositionInfo)));
      }
      //----------------------------------------------------------------------------------

      QGeoSatelliteInfoSource *satelliteSource = QGeoSatelliteInfoSource::createDefaultSource(this);
      if(satelliteSource)
      {
      QStringList sourcesList = QGeoSatelliteInfoSource::availableSources();
      qDebug() << "Satellites sources count: " << sourcesList.count();
      foreach (const QString &src, sourcesList)

      { qDebug() << "source in list: " << src; }

      satelliteSource->startUpdates();
      connect(satelliteSource, SIGNAL(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)),
      this, SLOT(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)));
      }

      I get segmentation with the output:

      D/Qt (16403): ../test_GPS/gpshandler.cpp:14 (GPSHandler::GPSHandler(QObject*)): Position sources count: 1
      D/Qt (16403): ../test_GPS/gpshandler.cpp:16 (GPSHandler::GPSHandler(QObject*)): pos source in list: "android"
      D/QtPositioning(16403): Regular updates using GPS
      D/QtPositioning(16403): Regular updates using network
      D/Qt (16403): ../test_GPS/gpshandler.cpp:37 (GPSHandler::GPSHandler(QObject*)): Satellites sources count: 1
      D/Qt (16403): ../test_GPS/gpshandler.cpp:39 (GPSHandler::GPSHandler(QObject*)): source in list: "android"
      F/Qt (16403): jnipositioning.cpp:496 (void satelliteUpdated(JNIEnv*, jobject, jobjectArray, jint, jboolean)): satelliteUpdated: source == 0

      Here is the backtrace:

      0 ?? /home/qtproj/build-test_GPS-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_0-Debug/libc.so 0x4010a8e8
      1 abort /home/qtproj/build-test_GPS-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_0-Debug/libc.so 0x40108948
      2 QMessageLogger::fatal(char const*, ...) const /opt/Qt-5.3.0_rc/5.3/android_armv7/lib/libQt5Core.so 0x75357ff6
      3 satelliteUpdated(_JNIEnv*, _jobject*, _jobjectArray*, int, unsigned char) /opt/Qt-5.3.0_rc/5.3/android_armv7/plugins/position/libqtposition_android.so 0x751a8c08
      4 ?? 0x40b3a910
      5 ?? 0x40b3a910

      When I’m creating only QGeoPositionInfoSource or only QGeoSatelliteInfoSource, this error doesn’t occur.

      Attachments

        1. gpshandler.cpp
          3 kB
        2. gpshandler.h
          0.6 kB
        3. main.cpp
          0.2 kB
        4. patch_position_android.patch
          2 kB
        5. test_GPS.pro
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ablasche Alex Blasche
            alan73 alan73
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes