deptofdefense / AndroidTacticalAssaultKit-CIV

Other
35 stars 17 forks source link

ATAK crashes without attempting to auto unload plugin after Android restart #262

Open davonprewitt opened 2 years ago

davonprewitt commented 2 years ago

On 4.4.0 CIV dev, ATAK crashes on start when Android restarts.

We install our plugin - works fine after installing.

After restarting Android, ATAK crashes. ATAK also did not attempt to auto unload the plugin after the crash. We manually uninstall the plugin, attempt to reopen ATAK and it STILL crashes.

The error message is not clear on the issue. Please help.

2022-10-04 10:23:12.116 30107-30107 DEBUG                   pid-30107                            A  Cmdline: com.atakmap.app.civ
2022-10-04 10:23:12.116 30107-30107 DEBUG                   pid-30107                            A  pid: 29771, tid: 29868, name: GLThread 55  >>> com.atakmap.app.civ <<<
2022-10-04 10:23:12.116 30107-30107 DEBUG                   pid-30107                            A  Abort message: 'JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xad
                                                                                                        string: ' �%y'
                                                                                                        input: '0x20 <0xad> 0x12 0x25 0x79'
                                                                                                        in call to NewStringUTF
                                                                                                        from void com.atakmap.map.opengl.GLLabelManager.setTextFormat(long, int, java.lang.String, float, boolean, boolean, boolean, boolean)'
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #09 pc 00000000000ec3d8  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libatakjni.so (TAKEngineJNI::Interop::Renderer::ManagedTextFormatFactory::createTextFormat(std::unique_ptr<TAK::Engine::Renderer::TextFormat2, void (*)(TAK::Engine::Renderer::TextFormat2 const*)>&, TAK::Engine::Renderer::TextFormatParams const&)+100) (BuildId: f5ec7b14addc12b14550ef4b8509a57ba7f0c457)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #10 pc 000000000031a378  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libtakengine.so (TAK::Engine::Renderer::TextFormat2_createTextFormat(std::unique_ptr<TAK::Engine::Renderer::TextFormat2, void (*)(TAK::Engine::Renderer::TextFormat2 const*)>&, TAK::Engine::Renderer::TextFormatParams const&)+92) (BuildId: d5b992f52b47350992a74e4b55036f8c63e13aa2)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #11 pc 000000000031c450  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libtakengine.so (TAK::Engine::Renderer::GLText2_intern(TAK::Engine::Renderer::TextFormatParams const&)+228) (BuildId: d5b992f52b47350992a74e4b55036f8c63e13aa2)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #12 pc 000000000034e7a4  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libtakengine.so (TAK::Engine::Renderer::Core::GLLabel::setTextFormat(TAK::Engine::Renderer::TextFormatParams const*)+24) (BuildId: d5b992f52b47350992a74e4b55036f8c63e13aa2)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #13 pc 00000000003576f4  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libtakengine.so (TAK::Engine::Renderer::Core::GLLabelManager::setTextFormat(unsigned int, TAK::Engine::Renderer::TextFormatParams const*)+212) (BuildId: d5b992f52b47350992a74e4b55036f8c63e13aa2)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #14 pc 0000000000098138  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/lib/arm64/libatakjni.so (Java_com_atakmap_map_opengl_GLLabelManager_setTextFormat+220) (BuildId: f5ec7b14addc12b14550ef4b8509a57ba7f0c457)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #17 pc 00000000005e0b62  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.map.opengl.GLLabelManager.setTextFormat+24)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #19 pc 00000000005e0b3e  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.map.opengl.GLLabelManager.setTextFormat+70)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #21 pc 0000000000392ac8  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.android.maps.graphics.GLMarker2.ensureLabel+54)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #23 pc 00000000003943e6  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.android.maps.graphics.GLMarker2.updateLabelVisibility+8)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #25 pc 000000000039372e  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.android.maps.graphics.GLMarker2.batch+1098)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #27 pc 0000000000397d18  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.android.maps.graphics.GLQuadtreeNode2$GLBatchRenderer.draw+250)
2022-10-04 10:23:12.117 30107-30107 DEBUG                   pid-30107                            A        #29 pc 000000000039877a  /data/app/~~kFkJkvYH2wJnKRqOmkxEVg==/com.atakmap.app.civ-bd7h6zAMUq_k_63XtNLh-Q==/oat/arm64/base.vdex (com.atakmap.android.maps.graphics.GLQuadtreeNode2$Renderable.draw+124)
kc2rxo commented 2 years ago

Interesting find. I have ATAK v4.5.1.2 (f73e8194) manually install on a Samsung S21+ with the following software load:

One UI: 4.1
Android: 12
Kernel: 5.4.147-qgki-24900553-abG996U1UES5CVI8
Build Number: SP1A.210812.016.G996U1UES5CVI8

I am getting a massive stack trace once the main map loads on ATAK - the same error as here. I had some private plugins install and thought initially they were to blame:

2022-10-25 13:17:37.753 18910-19014/com.atakmap.app.civ A/atakmap.app.ci: java_vm_ext.cc:594] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xad
    java_vm_ext.cc:594]     string: ' �R�t'
    java_vm_ext.cc:594]     input: '0x20 <0xad> 0x52 0xc5 0x74'
    java_vm_ext.cc:594]     in call to NewStringUTF
    java_vm_ext.cc:594]     from void com.atakmap.map.opengl.GLLabelManager.setTextFormat(long, int, java.lang.String, float, boolean, boolean, boolean, boolean)
2022-10-25 13:17:37.825 18910-19014/com.atakmap.app.civ A/atakmap.app.ci: runtime.cc:675] Runtime aborting...

[... rest removed for brevity, lots of threads dying ...]

but a clean install produces the same issue (stack trace in opposite order; threads dying first then error that started it all):

[... rest removed for brevity, lots of threads dying ...]

2022-10-25 14:35:29.067 23270-23374/com.atakmap.app.civ A/atakmap.app.ci: runtime.cc:675]   at com.atakmap.android.maps.graphics.GLMarker2.draw(SourceFile:742)
    runtime.cc:675]   at com.atakmap.android.maps.graphics.GLQuadtreeNode2$Renderable.draw(SourceFile:1057)
    runtime.cc:675]   at com.atakmap.map.opengl.GLAsynchronousMapRenderable2.draw(SourceFile:310)
    runtime.cc:675]   - locked <0x01e2e843> (a com.atakmap.android.maps.graphics.GLQuadtreeNode2)
    runtime.cc:675]   at com.atakmap.android.maps.graphics.GLRootMapGroupLayer.draw(SourceFile:66)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLMultiLayer.drawImpl(SourceFile:91)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLAbstractLayer2.draw(SourceFile:56)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLProxyLayer.drawImpl(SourceFile:128)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLAbstractLayer2.draw(SourceFile:56)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLMultiLayer.drawImpl(SourceFile:91)
    runtime.cc:675]   at com.atakmap.map.layer.opengl.GLAbstractLayer2.draw(SourceFile:56)
    runtime.cc:675]   at com.atakmap.map.opengl.GLMapView.render(Native method)
    runtime.cc:675]   at com.atakmap.map.opengl.GLMapView.render(SourceFile:1479)
    runtime.cc:675]   at com.atakmap.map.opengl.GLMapRenderer.onDrawFrame(SourceFile:96)
    runtime.cc:675]   at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1593)
    runtime.cc:675]   at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1287)
    runtime.cc:675]
2022-10-25 14:35:29.067 23270-23374/com.atakmap.app.civ A/atakmap.app.ci: runtime.cc:683] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xad
    runtime.cc:683]     string: ' ��Yw'
    runtime.cc:683]     input: '0x20 <0xad> 0xb2 0x59 0x77'
    runtime.cc:683]     in call to NewStringUTF
    runtime.cc:683]     from void com.atakmap.map.opengl.GLLabelManager.setTextFormat(long, int, java.lang.String, float, boolean, boolean, boolean, boolean)

I have a few phones locked from updates from Samsung that work just fine with same version installed.

davonprewitt commented 2 years ago

I reproduced the same error again on 4.4.0.13 - this time having an initial map location in the US on open. It seems to crash with the exact same error when the map is in view of (0, 0) as a coordinate.

kc2rxo commented 2 years ago

I have wiped my old ATAK (4.5.1.2) and installed cleanly the latest from here (4.5.1.13). My problem on Samsung S21+ still exists.

However I noticed it does not matter where the map loads. Every time the app first loads the GPS location is not set and when it seems to get a GPS position and put the marker on the map the app crashes. I have another S21+ with the same software load running completely fine - so I am a bit lost on why they are acting so different.

If I am quick enough and enter the main settings menu the app never crashes until I return to the map screen.

2022-11-02 14:06:31.203 29494-29494/com.atakmap.app.civ D/LocationMapComponent: GPS available, sending a system broadcast for now until CotService is augmented
2022-11-02 14:06:31.203 29494-29494/com.atakmap.app.civ D/BreadcrumbReceiver: START LOGGING self
2022-11-02 14:06:31.203 29494-29494/com.atakmap.app.civ D/BreadcrumbReceiver: START LOGGING NEW CRUMB TRAIL for self UID: ANDROID-13fcf334fb3ca9fc
2022-11-02 14:06:31.205 29494-29494/com.atakmap.app.civ D/ReportingRate: Report ASAP, reason=GPS now available
2022-11-02 14:06:31.220 29494-29628/com.atakmap.app.civ A/atakmap.app.ci: java_vm_ext.cc:594] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xad
    java_vm_ext.cc:594]     string: ' �2v'
    java_vm_ext.cc:594]     input: '0x20 <0xad> 0x32 0x01 0x76'
    java_vm_ext.cc:594]     in call to NewStringUTF
    java_vm_ext.cc:594]     from void com.atakmap.map.opengl.GLLabelManager.setTextFormat(long, int, java.lang.String, float, boolean, boolean, boolean, boolean)

@davonprewitt I feel like we are both experiencing the same underlying issue; something to do with placing markers onto the map - do you agree?

Edit: I think I can confirm that it has to do with the placing of markers. Just re-ran the app again and watched closely. The box for the users location right before the crash disappears as if its being refreshed to load in the new information.

davonprewitt commented 2 years ago

I agree @kc2rxo. This is definitely a map-related issue. This seems to be specific to how Samsung libraries interact with the ATAK mapping library as this issue does not exist for Android devices from other manufacturers.

kc2rxo commented 2 years ago

Out of curiosity what Android device are you using? I have a range of Samsung devices and Pixels.

davonprewitt commented 2 years ago

Samsung S20 and Pixel 3 + 4.

kc2rxo commented 2 years ago

So I just did a pass on all my devices (Samsung S21+ [4x], Samsung S10 [1x], Pixel 6 Pro [1x] and Samsung Tab S5e [1x]).

Half my S21's do not work with ATAK as described above. My Pixel 6 Pro also crashes (more like locks up and stops responding before Android kills it). All other devices seem to be fine back to ATAK v4.5.1.2 (the primary version I am running due some development restrictions at this moment). I tested one S21+ with ATAK v4.5.1.13 with no change to the behavior (still crashing).

I can confirm that turning off Location on the device (and ignoring ATAKs warning about missing GPS) allows the application to not crash. That is until I manually attempt to place the user marker on the map - then the error manifests.

Using the application AIDA64 the only noticeable difference I see among the devices are Android version, API level and Android Security Patch Level and Google Play Services versions.

Device Android Version API Level Android Security Patch Level Google Play Service Version ATAK Working
S21+ 01 12 31 2022-10-01 22.41.13 (190400-480714934) No
S21+ 02 12 31 2022-05-01 22.15.14 (190400-441847897) Yes
S21+ 03 12 31 2022-10-01 22.42.12 (190400-481949630) Yes
S21+ 04 12 31 2022-10-01 22.36.16 (190400-476895098) No
Pixel 6 Pro 13 33 2022-10-05 22.42.12 (190400-481949630) No
Tab S5e 11 30 2022-09-01 22.41.13 (150400-480714934) Yes
S10 12 31 2022-07-01 22.36.16 (190400-476895098) Yes

What a strange collection of working and non-working devices.

Edit: missed S10

bisgroves commented 1 year ago

These issues have been resolved in newer versions of ATAK 4.6, 4.7 and 4.8.

solita-michalguspiel commented 1 year ago

Works on: