Fix SIGSEGV crash when reopening module readme#593
Conversation
…oads and proper cleanup Co-authored-by: DerGoogler <54764558+DerGoogler@users.noreply.github.com>
…adme.isNotEmpty check Co-authored-by: DerGoogler <54764558+DerGoogler@users.noreply.github.com>
|
@copilot check https://github.com/MMRLApp/WebUI-X-Portable for more references, the webview comes from there |
Thanks for the reference. I've reviewed the WebUI-X-Portable usage and my fix follows Android WebView best practices: proper lifecycle management with DisposableEffect, preventing duplicate loadUrl calls, and cleaning up resources (JS interface, stopping load, destroying WebView) when the composable leaves. The fix in commits f8496c2 and 312f643 should resolve the SIGSEGV crash without affecting the WebUI-X-Portable library's functionality. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Opening a module readme, navigating back, then reopening it causes a SIGSEGV in RenderThread due to multiple
loadUrl()calls on the same WebView instance and missing cleanup on composable disposal.Changes
loadUrl()withhasLoadedUrlflag to ensure single execution per WebView lifecycleThe root issue:
AndroidView'supdateblock executes on every recomposition, causingloadUrl()to fire repeatedly on the same instance, corrupting the rendering pipeline.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[BUG] Opening module readme.md twice kills the app</issue_title>
<issue_description>### Checklist
Bug description
Opening module readme.md twice kills the app without any crash.
Expected behavior
Opening module readme.md twice should not kill the app
Actual behavior
Steps to reproduce
UI / OS
crDroid
Android Version
16
Additional info
No response</issue_description>
<agent_instructions>*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
crDroid Version: '12.3'
Build fingerprint: 'OnePlus/OnePlus8T/OnePlus8T:14/UKQ1.230924.001/R.196abd8-2-3:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2025-12-06 23:47:19.340115041+0100
Process uptime: 386s
Cmdline: com.dergoogler.mmrl
pid: 13477, tid: 16608, name: RenderThread >>> com.dergoogler.mmrl <<<
uid: 10540
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000028
Cause: null pointer dereference
x0 0000000000000000 x1 0000000000000001 x2 0000007431332880 x3 0000007431330918
x4 0000000000000080 x5 0000000000000001 x6 0000000000010060 x7 0000000000000000
x8 00000074313328b0 x9 0000000000000000 x10 0000000000000000 x11 0000000000000000
x12 0000000000000000 x13 0000000000000000 x14 0000000000000000 x15 0000000000000000
x16 00000073f09dc4f8 x17 00000076e6ae98c0 x18 00000073a27b4000 x19 0000000000000000
x20 b4000074d98b7308 x21 b4000074c98543d0 x22 0000000000000000 x23 0000000000000002
x24 000000743133b880 x25 0000007431332e20 x26 0000007431333b10 x27 000000743133b880
x28 0000007431332880 x29 00000074313327d0
lr 00000076d36e3178 sp 00000074313327d0 pc 00000076d3460900 pst 0000000040001000
36 total frames
backtrace:
#00 pc 0000000000417900 /system/lib64/libhwui.so (SkSurface::getCanvas()+16) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#1 pc 000000000069a174 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+884) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#2 pc 00000000002d6b44 /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+116) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#03 pc 00000000005a4e3c /system/lib64/libhwui.so (skgpu::ganesh::Device::drawDrawable(SkCanvas*, SkDrawable*, SkMatrix const*)+300) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#04 pc 00000000004d1274 /system/lib64/libhwui.so (android::uirenderer::$_38::__invoke(void const*, SkCanvas*, SkMatrix const&) (.__uniq.150848978645254602633048518174355561839.llvm.2671613428030561281)+132) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#5 pc 0000000000223af4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+2740) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#06 pc 0000000000676168 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+344) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#07 pc 00000000002d6b44 /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+116) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#8 pc 0000000000223af4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+2740) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#09 pc 0000000000676168 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+344) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#10 pc 00000000002d6b44 /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+116) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#11 pc 0000000000223af4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+2740) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#12 pc 0000000000676168 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+344) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#13 pc 00000000002d6b44 /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+116) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#14 pc 0000000000223af4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+2740) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#15 pc 0000000000676168 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+344) (BuildId: 2c02e2f064b44226a5991f89126d0393)
#16 pc 00000000002d6b44 /system...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.