remote-android / redroid-doc

redroid (Remote-Android) is a multi-arch, GPU enabled, Android in Cloud solution. Track issues / docs here
4.28k stars 308 forks source link

Webview fail and errors on version 14.0 if cgroup v2 #487

Open ath0mas opened 1 year ago

ath0mas commented 1 year ago

Describe the bug First thanks a lot for the release and availability of version 14.0! Running it and various default apps, like Settings and Files, works fine. But the webview test app and any own app based on webview, like hybrid apps or so, are failing. It logs many errors in logcat.

Same failure happens on 14.0-64only. While this is working as expected on 10.0 to 13.0, both default and 64only. Context: ubuntu 22 and docker 24, so default to cgroup v2.

make sure the required kernel modules present

collect debug logs curl -fsSL https://raw.githubusercontent.com/remote-android/redroid-doc/master/debug.sh | sudo bash -s -- [CONTAINER] omit CONTAINER if not exist any more. Not yet available. Planning it.

Screenshots If applicable, add screenshots to help explain your problem.

zhouziyang commented 1 year ago

I cannot reproduce this issue. Can you follow troubleshooting to provide the detailed debug logs?

ath0mas commented 1 year ago

Good news if it's only on my side. I'll debug and share logs quickly.

ath0mas commented 1 year ago

I ran the debug.sh and among all debug files I mostly noticed crash.txt with the following content:

crash.txt content

--------- beginning of crash
10-30 14:25:49.644  1567  1567 E AndroidRuntime: FATAL EXCEPTION: main
10-30 14:25:49.644  1567  1567 E AndroidRuntime: Process: com.android.devicelockcontroller, PID: 1567
10-30 14:25:49.644  1567  1567 E AndroidRuntime: java.lang.ExceptionInInitializerError
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.SystemDeviceLockManagerImpl.getInstance(SystemDeviceLockManagerImpl.java:68)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.policy.DevicePolicyControllerImpl.(DevicePolicyControllerImpl.java:103)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.policy.DevicePolicyControllerImpl.(DevicePolicyControllerImpl.java:89)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.DeviceLockControllerApplication.getPolicyController(DeviceLockControllerApplication.java:81)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.DeviceLockControllerApplication.getStateController(DeviceLockControllerApplication.java:74)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.DeviceLockControllerApplication.onCreate(DeviceLockControllerApplication.java:67)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:205)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:294)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8177)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
10-30 14:25:49.644  1567  1567 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.devicelock.IDeviceLockService android.devicelock.DeviceLockManager.getService()' on a null object reference
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.SystemDeviceLockManagerImpl.(SystemDeviceLockManagerImpl.java:51)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.SystemDeviceLockManagerImpl.(SystemDeviceLockManagerImpl.java:55)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.SystemDeviceLockManagerImpl.(SystemDeviceLockManagerImpl.java:0)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    at com.android.devicelockcontroller.SystemDeviceLockManagerImpl$SystemDeviceLockManagerHolder.(SystemDeviceLockManagerImpl.java:60)
10-30 14:25:49.644  1567  1567 E AndroidRuntime:    ... 17 more
10-30 14:26:39.975   229   264 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager:procStart
10-30 14:26:39.975   229   264 E AndroidRuntime: java.lang.AssertionError: Unable to create process group for com.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0 (2168)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.startProcess(ProcessList.java:2440)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.lambda$handleProcessStart$1(ProcessList.java:2069)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.$r8$lambda$swBGAihsWK-ua7Y-9peg-di3_lY(ProcessList.java:0)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList$$ExternalSyntheticLambda3.run(R8$$SyntheticClass:0)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.handleProcessStart(ProcessList.java:2095)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.lambda$startProcessLocked$0(ProcessList.java:2035)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList.$r8$lambda$RYfds-QGIevfi1LguTPr20cBG60(ProcessList.java:0)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.am.ProcessList$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:0)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:958)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:205)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:294)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at android.os.HandlerThread.run(HandlerThread.java:67)
10-30 14:26:39.975   229   264 E AndroidRuntime:    at com.android.server.ServiceThread.run(ServiceThread.java:46)
10-30 14:26:40.129  2168  2168 E AndroidRuntime: FATAL EXCEPTION: main
10-30 14:26:40.129  2168  2168 E AndroidRuntime: PID: 2168
10-30 14:26:40.129  2168  2168 E AndroidRuntime: DeadSystemException: The system died; earlier logs will point to the root cause
10-30 14:26:40.131  2132  2132 F libc    : Fatal signal 5 (SIGTRAP), code 128 (SI_KERNEL), fault addr 0x0 in tid 2132 (m.webview_shell), pid 2132 (m.webview_shell)
10-30 14:26:40.234    87    87 F libc    : /buildbot/src/android/ndk-release-r23/toolchain/llvm-project/libcxx/../../../toolchain/llvm-project/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating" failed
10-30 14:26:40.234    87    87 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 87 (binder:87_2), pid 87 (binder:87_2)
10-30 14:26:40.270  2226  2226 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-30 14:26:40.270  2226  2226 F DEBUG   : Build fingerprint: 'redroid/redroid_x86_64/redroid_x86_64:14/UP1A.231005.007.A1/eng.frank.20231013.082327:userdebug/test-keys'
10-30 14:26:40.270  2226  2226 F DEBUG   : Revision: '0'
10-30 14:26:40.270  2226  2226 F DEBUG   : ABI: 'x86'
10-30 14:26:40.270  2226  2226 F DEBUG   : Timestamp: 2023-10-30 14:26:40.245317381+0000
10-30 14:26:40.270  2226  2226 F DEBUG   : Process uptime: 0s
10-30 14:26:40.270  2226  2226 F DEBUG   : Cmdline: /vendor/bin/hw/android.hardware.audio.service
10-30 14:26:40.270  2226  2226 F DEBUG   : pid: 87, tid: 87, name: binder:87_2  >>> /vendor/bin/hw/android.hardware.audio.service <<<
10-30 14:26:40.270  2226  2226 F DEBUG   : uid: 1041
10-30 14:26:40.270  2226  2226 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
10-30 14:26:40.270  2226  2226 F DEBUG   : Abort message: '/buildbot/src/android/ndk-release-r23/toolchain/llvm-project/libcxx/../../../toolchain/llvm-project/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating" failed'
10-30 14:26:40.270  2226  2226 F DEBUG   :     eax 00000000  ebx 00000057  ecx 00000057  edx 00000006
10-30 14:26:40.270  2226  2226 F DEBUG   :     edi f546f48e  esi ffe3ff00
10-30 14:26:40.270  2226  2226 F DEBUG   :     ebp f613f540  esp ffe3fea8  eip f613f549
10-30 14:26:40.270  2226  2226 F DEBUG   : 25 total frames
10-30 14:26:40.270  2226  2226 F DEBUG   : backtrace:
10-30 14:26:40.270  2226  2226 F DEBUG   :       #00 pc 00000549  [vdso] (__kernel_vsyscall+9)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #01 pc 000780c8  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 5407da352ad7533f24e3d7497e5235c0)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #02 pc 0007c011  /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 5407da352ad7533f24e3d7497e5235c0)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #03 pc 0007c531  /apex/com.android.runtime/lib/bionic/libc.so (__assert2+49) (BuildId: 5407da352ad7533f24e3d7497e5235c0)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #04 pc 000cb554  /vendor/lib/libc++_shared.so (BuildId: dbfa6bc85c9f80f5ee21e5ce5958bd32c820118f)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #05 pc 000cb688  /vendor/lib/libc++_shared.so (BuildId: dbfa6bc85c9f80f5ee21e5ce5958bd32c820118f)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #06 pc 000e4a69  /vendor/lib/libc++_shared.so (BuildId: dbfa6bc85c9f80f5ee21e5ce5958bd32c820118f)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #07 pc 000e499d  /vendor/lib/libc++_shared.so (std::terminate()+45) (BuildId: dbfa6bc85c9f80f5ee21e5ce5958bd32c820118f)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #08 pc 000ca5e8  /vendor/lib/libc++_shared.so (std::__ndk1::thread::~thread()+40) (BuildId: dbfa6bc85c9f80f5ee21e5ce5958bd32c820118f)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #09 pc 000067a5  /vendor/lib/hw/audio.primary.redroid.so
10-30 14:26:40.270  2226  2226 F DEBUG   :       #10 pc 000191f2  /vendor/lib/hw/android.hardware.audio@7.0-impl.so (virtual thunk to android::hardware::audio::V7_0::implementation::Device::~Device()+98) (BuildId: ebac11fb7a9fe746ac0136dc00539d60)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #11 pc 0000ec3f  /apex/com.android.vndk.v34/lib/libutils.so (android::RefBase::decStrong(void const*) const+95) (BuildId: b773befe0bf1bc2eff56afb3bd1ee0f3)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #12 pc 0002de14  /vendor/lib/hw/android.hardware.audio@7.0-impl.so (android::hardware::audio::V7_0::implementation::StreamOut::~StreamOut()+500) (BuildId: ebac11fb7a9fe746ac0136dc00539d60)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #13 pc 0002dff4  /vendor/lib/hw/android.hardware.audio@7.0-impl.so (virtual thunk to android::hardware::audio::V7_0::implementation::StreamOut::~StreamOut()+52) (BuildId: ebac11fb7a9fe746ac0136dc00539d60)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #14 pc 0000ec3f  /apex/com.android.vndk.v34/lib/libutils.so (android::RefBase::decStrong(void const*) const+95) (BuildId: b773befe0bf1bc2eff56afb3bd1ee0f3)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #15 pc 0008ed14  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hidl::base::V1_0::BnHwBase::~BnHwBase()+196) (BuildId: 2de33d5c909c17986815ca292fffb0ff)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #16 pc 000b52bc  /vendor/lib/android.hardware.audio@7.0.so (android::hardware::audio::V7_0::BnHwStreamOut::~BnHwStreamOut()+204) (BuildId: 9bed9b28c4b485296c2e02548eefa37b)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #17 pc 000b5494  /vendor/lib/android.hardware.audio@7.0.so (virtual thunk to android::hardware::audio::V7_0::BnHwStreamOut::~BnHwStreamOut()+52) (BuildId: 9bed9b28c4b485296c2e02548eefa37b)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #18 pc 0000ec3f  /apex/com.android.vndk.v34/lib/libutils.so (android::RefBase::decStrong(void const*) const+95) (BuildId: b773befe0bf1bc2eff56afb3bd1ee0f3)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #19 pc 0009a7e7  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::IPCThreadState::processPendingDerefs()+119) (BuildId: 2de33d5c909c17986815ca292fffb0ff)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #20 pc 0009a9a8  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::IPCThreadState::joinThreadPool(bool)+184) (BuildId: 2de33d5c909c17986815ca292fffb0ff)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #21 pc 0004391e  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::joinBinderRpcThreadpool()+46) (BuildId: 2de33d5c909c17986815ca292fffb0ff)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #22 pc 000461ca  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::joinRpcThreadpool()+26) (BuildId: 2de33d5c909c17986815ca292fffb0ff)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #23 pc 000038a5  /vendor/bin/hw/android.hardware.audio.service (main+6037) (BuildId: 95728962d85eec73a043d0f8132574dc)
10-30 14:26:40.270  2226  2226 F DEBUG   :       #24 pc 000562ea  /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+106) (BuildId: 5407da352ad7533f24e3d7497e5235c0)

I can provide other debug files if you think they may contain interesting elements.

zhouziyang commented 1 year ago

java.lang.AssertionError: Unable to create process group for

Try get cgroup v1 mounted.

I'm considering to hack this in AMS.

ath0mas commented 1 year ago

Ubuntu 22 with Docker 24 in my case and indeed it has cgroup v2 mounted by default.

I did force it back to v1 while debugging this more today and it gives great results! WebView Tester is usable again on 14, and long-time skipped 9 seem to finally work as expected for me (I had a black screen until now and never took time to dig into it).

I'm considering to hack this in AMS.

What do you mean? And what is AMS?

zhouziyang commented 1 year ago

I mean ignore some cgroup related fails in system.

ath0mas commented 11 months ago

I saw cgroup v1 is not required anymore for 8.1 and 9.0 (4f3f8bf46b2e7f79b1fa292282e85637feab483a and corresponding images republished a week ago). I am still using cgroup v1 for all versions since I forced it down 2 weeks ago because of this issue for 14.0 and webview.

Do you confirm that for now cgroup v2 should be fine for all versions, but that for 14.0+webview not yet?

zhouziyang commented 11 months ago

8.1.0-231115, 9.0.0-231123 should work with cgroup v2 enabled (Webview possible not work on all Linux Kernel versions).

webview patches for Android U (cgroup v2 enabled) already published (redroid-patches/android-14.0.0_r11/frameworks/base/0001-ignore-cgroup-error.patch), but image is not published yet.

ath0mas commented 11 months ago

Thanks for the updates and I am eager to test v14 with cgroup v2 when image with patch is published. I would be able to switch all my setups back to default v2 👍.