-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
Reproduction steps:
- Download the reproducer QuickJS leak reproducer #2896
- Launch the treehouse dev server of the example ./gradlew :samples:emoji-search:presenter-treehouse:serveDevelopmentZipline
- Use the 'Open' and back buttons on the iOS treehouse example (
samples/emoji-search/ios-uikit) to create and close several instances ofTreehouseApp
Probable cause of the leak:
RealTreehouseApp.close indirectly schedules a resource unloading coroutine on dispatchers.zipline (RealTreehouseApp.stop -> CodeHost.stop -> CodeSession.stop). It starts working because of CoroutineStart.ATOMIC strategy but then crashes in ZiplineScope.close.
This exception can be seen by adding a breakpoint to CodeSession.handleUncaughtException:
java.lang.IllegalStateException: Zipline closed
at app.cash.zipline.Zipline$endpoint$1.call(Zipline.kt:64)
at app.cash.zipline.internal.bridge.OutboundCallHandler.callInternal$zipline_release(OutboundCallHandler.kt:116)
at app.cash.zipline.internal.bridge.OutboundCallHandler.call(OutboundCallHandler.kt:75)
at app.cash.redwood.treehouse.AppLifecycle$Companion$Adapter$GeneratedOutboundService.close(AppLifecycle.kt:26)
at app.cash.zipline.ZiplineScope.close(ZiplineScope.kt:93)
at app.cash.redwood.treehouse.ZiplineCodeSession.ziplineStop(ZiplineCodeSession.kt:73)
at app.cash.redwood.treehouse.CodeSession$stop$1.invokeSuspend(CodeSession.kt:85)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
at java.lang.Thread.run(Thread.java:1119)
The reproducer contains a probable fix of the leak on Android but it doesn't help on iOS.
Leak on iOS:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels