Skip to content

v1.3.0 — 1 GB staging leak fix + crash-safe staging

Latest

Choose a tag to compare

@insterbridge insterbridge released this 02 Oct 21:19

Fixes a 1 GB storage leak and a soft-reboot crash caused by deleting staging while it was still mounted.

Fixes:

  • Staging leak (1 GB per install). Staged vendor directories were written as siblings of .staging/ (.staging_vendor_lib64) instead of inside it, so every cleanup path missed them. Each apply leaked a full copy of /vendor/lib64 — 1.0 GB — into /data permanently. Staged dirs now live in .staging/dir_*, and all cleanup paths also sweep the legacy .staging_* form. Upgrading frees the leaked space on the next apply.
  • Staging cost cut ~25x. A payload lib with a new filename in /vendor/lib64 forces a merged copy of that whole directory. New names are now placed in /vendor/lib64/egl, which the linker's sphal namespace searches too (verified against /linkerconfig/ld.config.txt): staging drops from ~1 GB to ~43 MB with identical resolution. Files that replace a stock lib keep their exact path (per-file bind, no staging).
  • Crash-safe staging deletion. Deleting a staging dir that is still the live mount source for /vendor/lib64 empties the mounted directory; vendor HALs then SIGSEGV on dlopen and the system soft-reboots. gm_stage_clean now refuses to delete while any of staging is mounted in init/zygote, driver-select no longer deletes staging synchronously, and a new stage-clean subcommand exposes the guarded cleanup manually.

Also:

  • Reject saved plans from older versions (their staged dirs point at the leaked legacy paths) and rebuild automatically
  • doctor reports the staged directory size; the engine warns above 256 MB
  • Never rm -rf the module dir or .staging* while a driver is active — use driver-clear, action.sh unmount, or reboot first (mounts are in-memory, so a reboot always detaches them)

Verified on-device (Galaxy S23, SM-S911U1, Adreno 740): module size 1.0 GB → 120 MB, staging 43 MB, driver served in init/zygote/surfaceflinger namespaces, VulkanCapsViewer enumerates the custom driver, no restarts over repeated observation windows. Test suites: 40 + 20 + 74 assertions pass.