Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dispatcher from Bitmap writing #149

Closed
wants to merge 7 commits into from

Conversation

riggaroo
Copy link
Collaborator

@riggaroo riggaroo commented Sep 11, 2023

Fixing the following crash, where writing the Picture to a Bitmap at the same time, can cause a crash.

Fixed by removing the offloading to a different thread.

Nader's feedback: It is reasonable to render content into an offscreen bitmap as part of a typical render pass. The Android graphics pipeline does this internally for various use cases when content is promoted to a layer. While we should persist these bitmaps/layers across frames, doing a 1 off render if not prohibitive if done sparingly.

com.xxx.xxxgo.debug            A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4463c00000000050 in tid 19509 (DefaultDispatch), pid 19419 (.xxxgo.debug)
pid-19635                            A  Cmdline: com.xxx.xxxgo.debug
pid-19635                            A  pid: 19419, tid: 19509, name: DefaultDispatch  >>> com.xxx.xxxgo.debug <<<
pid-19635                            A        #08 pc 000000000025a4f0  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes2.dex] (com.xxx.core_android.compose.component.CapturableState.createBitmapFromPicture+44)
pid-19635                            A        #10 pc 000000000025a4a8  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes2.dex] (com.xxx.core_android.compose.component.CapturableState.access$createBitmapFromPicture+0)
pid-19635                            A        #12 pc 0000000000259d80  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes2.dex] (com.xxx.core_android.compose.component.CapturableState$capture$1$bitmap$1.invokeSuspend+48)
pid-19635                            A        #16 pc 0000000000340746  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.internal.LimitedDispatcher$Worker.run+10)
pid-19635                            A        #18 pc 000000000034fad2  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.scheduling.TaskImpl.run+6)
pid-19635                            A        #20 pc 000000000034eb9e  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely+2)
pid-19635                            A        #22 pc 000000000034d776  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask+34)
pid-19635                            A        #24 pc 000000000034d8a4  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker+56)
pid-19635                            A        #26 pc 000000000034d854  [anon:dalvik-classes15.dex extracted in memory from /data/app/~~nrGd_HydUC_5PO01AJmXgg==/com.xxx.xxxgo.debug-LI5DwnHiAGDWYV_C_DrcLg==/base.apk!classes15.dex] (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run+0)

@riggaroo riggaroo changed the title Removing dispatcher from Bitmap writing, to fix crash when picture is… Removing dispatcher from Bitmap writing Sep 11, 2023
@riggaroo riggaroo requested review from a team and simona-anomis September 12, 2023 21:48
@riggaroo
Copy link
Collaborator Author

Merged as part of this snippet update https://github.com/android/snippets/pull/151/files

@riggaroo riggaroo closed this Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant