Shabinder Singh
08/07/2023, 6:28 PMZipline
to implement a plugin system.
• Most of the plugins are working, but one is making my app crash without any helpful information, no catchable exception is thrown, even application level UncaughtExceptionHandler
isn't being invoked.
• App just straight crashes out when loading that plugin, can follow till ZiplineLoader.load
using a debugger, then it just closes with following in logcat.
Would appreciate if you guys can help me make sense of whats going on, point in the right direction.
Full Error trace in thread 🧵Shabinder Singh
08/07/2023, 6:28 PMFatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xa9bb6ffed65f03c6 in tid 1400 (DefaultDispatch), pid 1341 (ndbound.preview)
2023-08-07 23:52:43.486 1341-1393 EGL_emulation in.shabinder.soundbound.preview D app_time_stats: avg=1101.57ms min=4.20ms max=35475.07ms count=33
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A Cmdline: in.shabinder.soundbound.preview
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A pid: 1341, tid: 1400, name: DefaultDispatch >>> in.shabinder.soundbound.preview <<<
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #00 pc 000000000005d6f0 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so (BuildId: 75be7cfbfc363fdc714c69f104ad8a92d2b77b84)
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #01 pc 0000000000055500 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #02 pc 000000000005d1a4 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #03 pc 00000000000562fc /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #04 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #05 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #06 pc 000000000005622c /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #07 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #08 pc 000000000005622c /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #09 pc 000000000005622c /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #10 pc 000000000005622c /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #11 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #12 pc 000000000005622c /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #13 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #14 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #15 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #16 pc 000000000005d1a4 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #17 pc 00000000000562fc /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #18 pc 00000000000563b8 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #19 pc 000000000004f818 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #20 pc 000000000005e544 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #21 pc 00000000000403a4 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so
2023-08-07 23:52:43.595 1472-1472 DEBUG crash_dump64 A #22 pc 0000000000042c50 /data/app/~~rjydBkrqsHT23TVoRZYBgQ==/in.shabinder.soundbound.preview-kt6F8SHLSTrrNg_RqPwgIw==/lib/arm64/libquickjs.so (Java_app_cash_zipline_QuickJs_execute+24)
Landry Norris
08/07/2023, 6:48 PMShabinder Singh
08/07/2023, 6:54 PMShabinder Singh
08/07/2023, 9:11 PMsupervisorScope{}
and async{}
in ZiplineServices
am i missing something ? is this a known limitation ? or should I report it in github issues ?
PS: yup, can confirm, using either async{}
/ launch{}
results in said crash.
PS2: using GlobalScope
also leads to crashes...jessewilson
08/07/2023, 10:13 PMjessewilson
08/07/2023, 10:14 PMjessewilson
08/07/2023, 10:14 PMShabinder Singh
08/07/2023, 10:15 PMjessewilson
08/07/2023, 10:16 PMjessewilson
08/07/2023, 10:16 PMjessewilson
08/07/2023, 10:17 PMShabinder Singh
08/07/2023, 10:18 PMsupervisorScope {
listOf(
async{} , async
).awaitAll()
}
mutli threaded, I suppose not if I init like below
private val ziplineExecutorService = Executors.newSingleThreadExecutor { Thread(it, "Zipline") }
private val ziplineDispatcher = ziplineExecutorService.asCoroutineDispatcher(
?Shabinder Singh
08/07/2023, 10:19 PMShabinder Singh
08/07/2023, 10:21 PMjessewilson
08/07/2023, 10:21 PMjessewilson
08/07/2023, 10:22 PMjessewilson
08/07/2023, 10:22 PMjessewilson
08/07/2023, 10:23 PMShabinder Singh
08/07/2023, 10:25 PMjessewilson
08/07/2023, 10:27 PMjessewilson
08/07/2023, 10:27 PMjessewilson
08/07/2023, 10:28 PMjessewilson
08/07/2023, 10:28 PMjessewilson
08/07/2023, 10:28 PMShabinder Singh
08/07/2023, 10:31 PMThere’s lots of different ways to accomplish this.Can you mention the name of the widely used ones ? will give a read before trying to impl and even learn.
jessewilson
08/07/2023, 10:33 PMjessewilson
08/07/2023, 10:33 PMjessewilson
08/07/2023, 10:35 PMjessewilson
08/07/2023, 10:35 PMjessewilson
08/07/2023, 10:36 PMjessewilson
08/07/2023, 10:36 PMjessewilson
08/07/2023, 10:37 PMShabinder Singh
08/07/2023, 10:41 PMmove every class that touches a Zipline API to be given the dispatcherthis looks better for at least my use case, can create a repo which will use all the plugins and schedule loads on the said dispatcher. Again thanks for all this info, looks good will try to impl and see where I land, feel free to share any other recommendations / catches which I should keep in mind.
Shabinder Singh
08/08/2023, 6:19 PMjessewilson
08/08/2023, 10:16 PMShabinder Singh
08/12/2023, 3:24 PMShabinder Singh
11/08/2023, 12:11 PMjessewilson
11/08/2023, 1:51 PMShabinder Singh
11/08/2023, 1:57 PMShabinder Singh
11/08/2023, 2:05 PMjessewilson
11/08/2023, 2:07 PMat captureStack (runtime/coreRuntime.kt:12)
at ClassCastException_init_$Create$ (kotlin-kotlin-stdlib-js-ir.js)
at THROW_CCE (runtime/hacks.kt)
at <anonymous> (soundbound-extensions-lib.js)
at <anonymous> (opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/Polymorphic.kt:20)
jessewilson
11/08/2023, 2:08 PMClassCastException
jessewilson
11/08/2023, 2:09 PMJson
instance has different configuration in guest vs. host code?Shabinder Singh
11/08/2023, 2:09 PMjessewilson
11/08/2023, 2:10 PMjessewilson
11/08/2023, 2:10 PMShabinder Singh
11/08/2023, 2:13 PMapp.cash.zipline.ZiplineException: CompletionHandlerException: Exception in completion handler InvokeOnCompletion@4[job@5] for DeferredCoroutine{Completed}@5
Which completion Handler 👀 ?Shabinder Singh
11/08/2023, 2:21 PMShabinder Singh
11/08/2023, 2:33 PMjessewilson
11/08/2023, 2:38 PMEventListener
, look at the encoded JSON, and maybe write a commonTest
unit test that encodes and decodes them directly?Shabinder Singh
11/08/2023, 2:39 PMjessewilson
11/08/2023, 2:39 PMjessewilson
11/08/2023, 2:40 PMList
contains an element that isn’t in the type parameters? Like a List<Int>
that contains a String?Shabinder Singh
11/08/2023, 2:40 PMShabinder Singh
11/08/2023, 2:44 PMShabinder Singh
11/08/2023, 2:46 PMjessewilson
11/08/2023, 2:49 PMjessewilson
11/08/2023, 2:49 PMjessewilson
11/08/2023, 2:49 PMShabinder Singh
11/08/2023, 2:50 PMShabinder Singh
11/08/2023, 2:51 PMShabinder Singh
11/15/2023, 11:31 PMShabinder Singh
11/16/2023, 12:12 AMShabinder Singh
11/16/2023, 12:29 AMjessewilson
11/16/2023, 12:55 AMjessewilson
11/16/2023, 12:55 AMShabinder Singh
11/16/2023, 1:52 PMShabinder Singh
11/16/2023, 1:54 PMShabinder Singh
11/16/2023, 1:59 PMjessewilson
11/16/2023, 3:25 PMShabinder Singh
11/16/2023, 3:48 PMShabinder Singh
11/16/2023, 3:48 PMjessewilson
11/16/2023, 6:15 PMjessewilson
11/16/2023, 6:15 PMShabinder Singh
11/16/2023, 8:43 PMShabinder Singh
11/16/2023, 9:08 PMShabinder Singh
11/16/2023, 9:22 PMShabinder Singh
11/17/2023, 12:36 AMjessewilson
11/17/2023, 5:02 AMShabinder Singh
11/17/2023, 12:06 PMrelatedSongs()
never returns but atleast, the whole app doesnt crash anymore.
will be awaiting ur message when you have checked the reproducer and diagnosed the cause of this weird issue.Shabinder Singh
11/17/2023, 12:30 PMjessewilson
11/17/2023, 5:16 PMShabinder Singh
11/17/2023, 5:16 PMjessewilson
11/17/2023, 5:26 PMjessewilson
11/17/2023, 5:26 PMShabinder Singh
11/17/2023, 5:27 PM