Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28567] Android: V8 crash related to logs

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2021-10-25T13:37:16.000+0000
Updated2021-11-02T03:57:44.000+0000

Description

We see the following crash:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.example.app <<<

backtrace:
  #00  pc 000000000002237c  /system/lib64/libc.so (abort+116)
  #00  pc 00000000004667a0  /system/lib64/libart.so (art::Runtime::Abort(char const*)+1196)
  #00  pc 0000000000008ce0  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
  #00  pc 00000000002e68c4  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1640)
  #00  pc 0000000000350584  /system/lib64/libart.so (art::JNI::GetObjectField(_JNIEnv*, _jobject*, _jfieldID*)+1068)
  #00  pc 00000000005f8280  /data/app/com.example.app-gPjx4OxvV-WUyi4KR0LrvQ==/split_config.arm64_v8a.apk!lib/arm64-v8a/libkroll-v8.so (offset 0x177000) (titanium::Proxy::hasListenersForEventType(v8::FunctionCallbackInfo<v8::Value> const&)+352)
  #00  pc 0000000000d3c4d8  /data/app/com.example.app-gPjx4OxvV-WUyi4KR0LrvQ==/split_config.arm64_v8a.apk!lib/arm64-v8a/libkroll-v8.so (offset 0x177000) (v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo)+540)
  #00  pc 0000000000d3bbd0  /data/app/com.example.app-gPjx4OxvV-WUyi4KR0LrvQ==/split_config.arm64_v8a.apk!lib/arm64-v8a/libkroll-v8.so (offset 0x177000)
  #00  pc 0000000000d3b3b8  /data/app/com.example.app-gPjx4OxvV-WUyi4KR0LrvQ==/split_config.arm64_v8a.apk!lib/arm64-v8a/libkroll-v8.so (offset 0x177000)
  #00  pc 0000000000c4bf28  /data/app/com.example.app-gPjx4OxvV-WUyi4KR0LrvQ==/split_config.arm64_v8a.apk!lib/arm64-v8a/libkroll-v8.so (offset 0x177000)

Comments

  1. Joshua Quick 2021-11-02

    [~hknoechel], this isn't enough info to isolate the issue. Is there no exception message? Or a deeper stack trace? If I were to "guess", a module may be attempting to fire an event or add/remove a listener while the app is in the background... and while a JS runtime does NOT exist. Such as your "titanium-firebase-cloud-messaging" module? Titanium's C++ code has never done NULL checks on the V8 Isolate pointer (the JS runtime instance) because we let our modules dispose themselves when the JS runtime terminates. https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/Proxy.cpp#L296 That said, we do JS runtime existence checks on the Java side before calling the C++ side. So, this theoretically shouldn't happen unless your module is older than 2 years (which is when I added this check as can be seen in blame). https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/java/org/appcelerator/kroll/runtime/v8/V8Object.java#L54 Maybe the thing to test out is to set your app's "exitOnClose" to true (the default), back out of your app, and then trigger one of your modules? _(I'm not really sure what else to suggest.)_

JSON Source