0

I'm making an Android Application, everything works fine until I tried to make the application available with the screen off. I acquire a PARTIAL_WAKE_LOCK aswell as a WIFI_MODE_FULL_HIGH_PERF. It seems that there is a SafeHandle being used that asserts the equality of two vars, which fails and causes an exception to be thrown. Taken from Azure:-

 public SpeechSynthesisResult SpeakText(String var1) {
        IntRef var2 = new IntRef(0L);
        Contracts.throwIfFail(this.speakText(this.synthHandle, var1, var2));
        return new SpeechSynthesisResult(var2);
    }

The interesting part of this error, is that when using debug it will actually speak out the text just fine (since I setup breakpoints and there is time before the exception is thrown). I believe this safeHandle may be some sort of thread security measure, but I'm not sure.

Some logs:-

F/libc    (14943): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x73756c50656ee7 in tid 5685 (Thread-16), pid 14943 (ta.elementalabs)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 14943, tid: 5685, name: Thread-16  >>> com.elementa.elementalabs <<<
uid: 10359
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x73756c50656ee7
    x0  b40000791a5be290  x1  0000000000000010  x2  0000000000000000  x3  00000077bfe95890
    x4  b40000786a5cb4ff  x5  00000077bfe95800  x6  206e616320776f48  x7  3f706c6568204920
    x8  3f73756c50656e4f  x9  682e0967af026884  x10 0000000000000001  x11 0000000000000000
    x12 b40000789a5b9738  x13 0000000000000000  x14 000000007ffbffff  x15 0000000000000012
    x16 00000077c17905f8  x17 0000007b4acbe81c  x18 00000000000ba245  x19 00000077bfe95690
    x20 b40000791a5be290  x21 00000077bfe957f0  x22 0000000000000000  x23 00000077bfe98000
    x24 000000000000000f  x25 00000077bfe98000  x26 000000000000004d  x27 0000000000000004
    x28 00000077bfe95910  x29 00000077bfe95680
    lr  00000077c13b7d8c  sp  00000077bfe94270  pc  00000077c13b7d98  pst 0000000060000000
backtrace:
      #00 pc 00000000002f7d98  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #01 pc 00000000002e4388  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #02 pc 000000000027f610  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #03 pc 00000000001be1a8  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000) (synthesizer_speak_text+128)
      #04 pc 0000000000016b84  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.java.bindings.so (offset 0xf46000) (Java_com_microsoft_cognitiveservices_speech_SpeechSynthesizer_speakText+156)
      #05 pc 000000000013ced4  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #06 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #07 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #08 pc 00000000003184a8  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #09 pc 000000000030e7d4  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #10 pc 000000000067f240  /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+576) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #11 pc 000000000012d914  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #12 pc 00000000001c188a  [anon:dalvik-classes6.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes6.dex] (com.microsoft.cognitiveservices.speech.SpeechSynthesizer.SpeakText+18)
      #13 pc 000000000067ce64  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #14 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #15 pc 00000000000072fe  [anon:dalvik-classes5.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes5.dex] (com.elementa.elementalabs.MainActivity.speakText+186)
      #16 pc 000000000067ce64  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #17 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #18 pc 00000000000076d0  [anon:dalvik-classes5.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes5.dex] (com.elementa.elementalabs.MainActivity.wakewordActivated+24)
      #19 pc 000000000067ce64  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #20 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #21 pc 00000000000063d2  [anon:dalvik-classes5.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes5.dex] (com.elementa.elementalabs.MainActivity.onCreate$lambda-5+10)
      #22 pc 000000000067fdc0  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #23 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #24 pc 000000000000625c  [anon:dalvik-classes5.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes5.dex] (com.elementa.elementalabs.MainActivity.lambda$og9JLYYMUtAnM1Y7cWoT7Zlo0vE)
      #25 pc 000000000067fdc0  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #26 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #27 pc 0000000000003fd8  [anon:dalvik-classes5.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes5.dex] (com.elementa.elementalabs.-$$Lambda$MainActivity$og9JLYYMUtAnM1Y7cWoT7Zlo0vE.onEvent+8)
      #28 pc 000000000067e89c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #29 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #30 pc 00000000001ce31e  [anon:dalvik-classes6.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes6.dex] (com.microsoft.cognitiveservices.speech.util.EventHandlerImpl.fireEvent+50)
      #31 pc 000000000067ce64  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #32 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #33 pc 00000000001bb770  [anon:dalvik-classes6.dex extracted in memory from /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!classes6.dex] (com.microsoft.cognitiveservices.speech.KeywordRecognizer.recognizedEventCallback+40)
      #34 pc 0000000000305dd0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3728063326046250456)+268) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #35 pc 000000000066b8cc  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #36 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #37 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #38 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #39 pc 0000000000555614  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+468) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #40 pc 00000000005557b4  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #41 pc 0000000000413f7c  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+660) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #42 pc 00000000003796a0  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2512) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #43 pc 0000000000367750  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+72) (BuildId: b0b1b97e51dc36cf4439284e5ac2a281)
      #44 pc 000000000001ad30  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.java.bindings.so (offset 0xf46000)
      #45 pc 000000000001ea54  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.java.bindings.so (offset 0xf46000)
      #46 pc 0000000000152b38  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #47 pc 00000000002285a8  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #48 pc 0000000000226b70  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #49 pc 0000000000226d9c  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #50 pc 000000000026166c  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #51 pc 000000000026af50  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #52 pc 00000000002ec948  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #53 pc 00000000002ebf34  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #54 pc 00000000002ed6e8  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #55 pc 00000000002ebfe4  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #56 pc 00000000002eeab8  /data/app/~~rD-9CNu-uAFhkQUHj8pA4Q==/com.elementa.elementalabs-5w_O4yJJWRjdskFXpPGAvw==/base.apk!libMicrosoft.CognitiveServices.Speech.core.so (offset 0x74e000)
      #57 pc 00000000000b0048  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 07fbaeed7b7a19203975f06be6f1d5ef)
      #58 pc 00000000000503c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 07fbaeed7b7a19203975f06be6f1d5ef)

I've noticed there are SIGSEGV errors, which may mean invalid pointer? What should I lookout for to diagnose this issue? Thanks in advance.

R. Jafri
  • 3
  • 2

1 Answers1

0

Debugging of SIGSEGV issues are more complicated because it is depends on project. So you can go through the flow of your app memory and catch utilization.

Assuming it was running successfully on debug. Try to clear the cache and reload the project on production.

If you are using any native library you can make sure that were are using correctly or not.

Make sure your usage of memory and pointing the variables can be used for specific usage. The SIGSEGV issue is only happens when it points to the Invalid pointer.

Refer here

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15