Droidspaces-OSS icon indicating copy to clipboard operation
Droidspaces-OSS copied to clipboard

Experiencing freezing and rebooting issues when starting the container.

Open TTT-TYL opened this issue 8 months ago • 66 comments

Test device: OnePlus 15, kernel version 6.12. Encountering freezing and rebooting when starting the container, which prevents the container from starting.

TTT-TYL avatar Mar 28 '26 18:03 TTT-TYL

hey, to know what's wrong, please take these steps:

  1. reproduce the issue (let the freeze and panic happen - then boot back to the system)
  2. dump the last kernel message - this should contain all the details regarding your issue:

cp /proc/last_kmsg /sdcard/last_kmsg.txt <- run this inside a termux root shell

  1. upload it here.

ravindu644 avatar Mar 28 '26 18:03 ravindu644

Okay. Install the latest APK from the CI:

https://github.com/ravindu644/Droidspaces-OSS/actions/runs/23694407235/artifacts/6161242588

Generate the bug report after your issue happened (even after reboot after a panic)

Drop the bugreport tarball to here.

ravindu644 avatar Mar 28 '26 20:03 ravindu644

There is no last_kmsg file in my proc directory. I can only generate a bug report to submit to you. Thank you.

Droidspaces-bugreport_2026-03-29_08-06-18.tar.gz

TTT-TYL avatar Mar 29 '26 01:03 TTT-TYL

There is no last_kmsg file in my proc directory. I can only generate a bug report to submit to you. Thank you.

Droidspaces-bugreport_2026-03-29_08-06-18.tar.gz

Hmm, it is hard to judge what exactly caused your panic.

I guess modern kernel stores panic logs under /sys/fs/pstore/..

Can you check that path and send everything there inside a ZIP, AFTER the panic happened ?

ravindu644 avatar Mar 29 '26 05:03 ravindu644

I also added the ability to get pstore logs. please check this one out:

https://github.com/ravindu644/Droidspaces-OSS/actions/runs/23703042943/artifacts/6164019628

ravindu644 avatar Mar 29 '26 06:03 ravindu644

Hello, I have configured CONFIG_PSTORE=y in my kernel, but the "/sys/fs/pstore/" directory is still empty.

TTT-TYL avatar Mar 29 '26 07:03 TTT-TYL

After the first container startup crashes and restarts, the second startup does not crash and restart, but the container still cannot start. The logs are as follows. Starting start operation... Command: /data/local/Droidspaces/bin/droidspaces --config='/data/local/Droidspaces/Containers/ubuntu/container.config' start

[-] Container name is mandatory (--name). [-] No rootfs target specified (requires -r or -i).

Command failed (exit code: 1)

Operation failed!

TTT-TYL avatar Mar 29 '26 07:03 TTT-TYL

I guess modern kernel stores panic logs under /sys/fs/pstore/..

My device is the Redmi K90 Pro Max (myron). My attempt was to add configurations to the kernel, such as enabling cgroup devices as shown in this workflow, which allowed the device to boot normally and function properly.

However, after additionally enabling PIDS as demonstrated in this subsequent workflow, the kernel started crashing repeatedly and failed to boot.

The pmsg-ramoops-0 log file I retrieved is as follows:

pmsg-ramoops-0.txt

P.S.: In the 6.12 kernel, the file paths of several patches have changed, so the patch files may need to be updated accordingly.

adk23333 avatar Mar 29 '26 08:03 adk23333

After the first container startup crashes and restarts, the second startup does not crash and restart, but the container still cannot start. The logs are as follows. Starting start operation... Command: /data/local/Droidspaces/bin/droidspaces --config='/data/local/Droidspaces/Containers/ubuntu/container.config' start

[-] Container name is mandatory (--name). [-] No rootfs target specified (requires -r or -i).

Command failed (exit code: 1)

Operation failed!

okay - this happens due to a corrupted container.config generated during your crash :(

you can re-install the container again to fix this issue.

ravindu644 avatar Mar 29 '26 09:03 ravindu644

I have the same problem

Droidspaces-bugreport_2026-03-29_16-27-54.tar.gz

it seems like your phone crashes when mounting the rootfs.img, which is strange:

[2026-03-29 08:18:29.315] [main] Image checked and repaired successfully.

can you try without using the rootfs.img ?

also, your log lacks last_kmesg or pstore logs too.. so, it's hard to exactly tell what's going on..

but, I have an idea..!

ravindu644 avatar Mar 29 '26 09:03 ravindu644

@TTT-TYL @MengHanLOVE1027

Hey, this is the plan:

First of all, we need to access the live dmesg when starting the container using ADB shell. Whenever a kernel panic happens, the logs will show exactly what caused it and print all the details we need to debug.

If you have Linux, you can easily pipe the dmesg output to a text file and attach it here:

# Clear the kernel message buffer so we won’t see any log noise
adb shell "su -c 'dmesg -C'"

# Start watching dmesg in real time while saving its output to a file
adb shell "su -c 'dmesg -w'" | tee kernel_logs.txt

This will tell us exactly what's causing the panics :)

ravindu644 avatar Mar 29 '26 09:03 ravindu644

It seems like building GKI kernels by nuking CRC checks and patching KABI is unreliable on modern 6.x+ kernels.

The recommended approach is to compile as many LKMs as possible and distribute them across the vendor_boot, vendor_dlkm, and system_dlkm partitions. This fixes all the issues AND doesn’t require any patches at all, like I did with my GKI kernel:

https://github.com/ravindu644/android_kernel_a166p

But it’s very complicated, and not all manufacturers release the source code for their out-of-tree modules.

ravindu644 avatar Mar 29 '26 09:03 ravindu644

PIDS

Okay, do not enable it. it's not required for Droidspaces anyways

ravindu644 avatar Mar 29 '26 09:03 ravindu644

@TTT-TYL @MengHanLOVE1027

Hey, this is the plan:

First of all, we need to access the live dmesg when starting the container using ADB shell. Whenever a kernel panic happens, the logs will show exactly what caused it and print all the details we need to debug.

If you have Linux, you can easily pipe the dmesg output to a text file and attach it here:

Clear the kernel message buffer so we won’t see any log noise

adb shell "su -c 'dmesg -C'"

Start watching dmesg in real time while saving its output to a file

adb shell "su -c 'dmesg -w'" | tee kernel_logs.txt This will tell us exactly what's causing the panics :)

Then i get this successfully:

kernel_logs.txt

Droidspaces-bugreport_2026-03-29_16-27-54.tar.gz

Without using the rootfs.img, i get the different zip

Image

MengHanLOVE1027 avatar Mar 29 '26 09:03 MengHanLOVE1027

Okay, do not enable it. it's not required for Droidspaces anyways

Not just it—actually, opening any other recommended cgroup option besides cgroup devices will cause a crash.

I'll take a look at your repository.

adk23333 avatar Mar 29 '26 10:03 adk23333

Okay, do not enable it. it's not required for Droidspaces anyways

Not just it—actually, opening any other recommended cgroup option besides cgroup devices will cause a crash.

I'll take a look at your repository.

umm. okay. then, I recommend you to cook many LKMs as possible. you can use my approaches:

https://github.com/ravindu644/android_kernel_a166p

if your kernel source doesn't compile an LKM, you have 2 options:

  1. If the kernel source does have the source code for an out-of-tee module, but it isn't wired up to the build system -> you can wire it up
  2. If the kernel source does have the source code for an out-of-tee module, you can pull the stock .ko file and wire it up with the compiled LKMs too.

ravindu644 avatar Mar 29 '26 10:03 ravindu644

Without using the rootfs.img, i get the different zip

hmm, that means the phone is crashing as soon as droidspaces started :/ ; it didn't even able to write the log file.

is it crashing in the requirement checker too ?

ravindu644 avatar Mar 29 '26 10:03 ravindu644

Without using the rootfs.img, i get the different zip

hmm, that means the phone is crashing as soon as droidspaces started :/ ; it didn't even able to write the log file.

is it crashing in the requirement checker too ?

Image

MengHanLOVE1027 avatar Mar 29 '26 10:03 MengHanLOVE1027

Without using the rootfs.img, i get the different zip

hmm, that means the phone is crashing as soon as droidspaces started :/ ; it didn't even able to write the log file. is it crashing in the requirement checker too ?

Image

okay. according to your dmesg, I'm suspecting this as a memory allocation failure in droidspaces, that only triggers in Kernel 6.x +, in android ?

[ 5173.029814] binder: cannot allocate buffer: no space left
[ 5173.029818] binder: 8480:16081 transaction reply to 9374:9711 failed 3563117/29201/-28, code 0 size 2113536-0 line 3548

process 9374 is trying to allocate a ~2.1 MB buffer over Binder. Trying to push 2MB through Binder causes it to instantly fail (no address space).

So, we can re-run the dmesg collection again to 100% verify this is the exact reason behind the crash:

# Clear the kernel message buffer so we won’t see any log noise
adb shell "su -c 'dmesg -C'"

# Start watching dmesg in real time while saving its output to a file
adb shell "su -c 'dmesg -w'" | tee kernel_logs2.txt

# now, start the container

after that, please drop the kernel_logs2.txt for inspection.

ravindu644 avatar Mar 29 '26 10:03 ravindu644