Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.0 Beta1
-
None
-
Windows 7 64 bits
Qt Android for Windows 32-bit 5.3.0-beta1 (Enterprise)
Device: Samsung Galaxy S3 (4.3)
Description
The application crash when I do many calls of lastKnownPosition() in a row.
Create a new quick project( 2.2)
Start GPS
Do 1000 call of lastKnownPosition
=> crash. It seems that java objects are created at each call of the function, even if it's the same value (this kind of behaviour must be describe in the function documentation in this case)
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QGeoPositionInfoSource> #include <qDebug> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); //MyGPS::test(); QGeoPositionInfoSource * source = QGeoPositionInfoSource::createDefaultSource(0); if(source) { source->setUpdateInterval(10000); source->startUpdates(); for(int i = 0 ; i < 1000 ; ++i) { qDebug() << "Before lastKnownPosition"; QGeoPositionInfo lastPosition = source->lastKnownPosition(); qDebug() << "After lastKnownPosition"; } } return app.exec(); }
Error Log :
.... Many pair of Before/After ..... D/Qt ( 3275): ../test2/main.cpp:19 (int main(int, char**)): Before lastKnownPosition E/dalvikvm( 3275): JNI ERROR (app bug): local reference table overflow (max=512) W/dalvikvm( 3275): JNI local reference table (0x59ca5228) dump: W/dalvikvm( 3275): Last 10 entries (of 512): W/dalvikvm( 3275): 511: 0x41d88cd8 java.lang.Class<android.os.Parcel> W/dalvikvm( 3275): 510: 0x42382f60 java.lang.Class<android.location.Location> W/dalvikvm( 3275): 509: 0x427ecc10 android.location.Location W/dalvikvm( 3275): 508: 0x42382f60 java.lang.Class<android.location.Location> W/dalvikvm( 3275): 507: 0x427eca48 android.location.Location W/dalvikvm( 3275): 506: 0x42382f60 java.lang.Class<android.location.Location> W/dalvikvm( 3275): 505: 0x427ec880 android.location.Location W/dalvikvm( 3275): 504: 0x42382f60 java.lang.Class<android.location.Location> W/dalvikvm( 3275): 503: 0x427ec6b8 android.location.Location W/dalvikvm( 3275): 502: 0x42382f60 java.lang.Class<android.location.Location> W/dalvikvm( 3275): Summary: W/dalvikvm( 3275): 256 of java.lang.Class (2 unique instances) W/dalvikvm( 3275): 1 of int[] (3 elements) W/dalvikvm( 3275): 255 of android.location.Location (255 unique instances) E/dalvikvm( 3275): Failed adding to JNI local ref table (has 512 entries) I/dalvikvm( 3275): "Thread-6559" prio=10 tid=11 RUNNABLE I/dalvikvm( 3275): | group="main" sCount=0 dsCount=0 obj=0x427ddea0 self=0x41af66d0 I/dalvikvm( 3275): | sysTid=3290 nice=-16 sched=0/0 cgrp=apps handle=1102902376 I/dalvikvm( 3275): | state=R schedstat=( 255726773 78359019 1242 ) utm=12 stm=13 core=2 I/dalvikvm( 3275): at android.os.Parcel.nativeWriteInterfaceToken(Native Method) I/dalvikvm( 3275): at android.os.Parcel.writeInterfaceToken(Parcel.java:444) I/dalvikvm( 3275): at android.location.ILocationManager$Stub$Proxy.getLastLocation(ILocationManager.java:641) I/dalvikvm( 3275): at android.location.LocationManager.getLastKnownLocation(LocationManager.java:1144) I/dalvikvm( 3275): at org.qtproject.qt5.android.positioning.QtPositioning.lastKnownPosition(QtPositioning.java:140) I/dalvikvm( 3275): at dalvik.system.NativeStart.run(Native Method) I/dalvikvm( 3275): E/dalvikvm( 3275): VM aborting F/libc ( 3275): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 3290 (t.example.test2)