Repository navigation
QEMU env: one TMPDIR for both launch paths; the -snapshot failure in issue 68 was QEMU run by hand - #147
Merged
Conversation
…by hand (#68) The -snapshot failure from the PR 66 re-check is not in the app. Both the child process and the in-process :vm path put their overlays in the cache dir. The message comes from QEMU run as a uid other than the app's (adb shell) with TMPDIR pointing at the app's cache dir. QemuCommand.env now builds the environment for both paths, with a unit test, and PHONE-SMOKE.md explains TMPDIR for hand-run QEMU.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 68 asked why
-snapshotfailed in the app with "Could not open .../cache/vl.XXXX" (seen in the exec-path re-check at the end of PR 66). That failure doesn't come from the app. Both launch paths already put the overlays in the cache dir and work. The message appears when QEMU runs as a uid other than the app's, for example fromadb shell, with TMPDIR set to the app's cache dir. The cache dir isdrwxrws--x u0_aNNN u0_aNNN_cache, so the shell user can't create files in it.What changed:
QemuCommand.env(tmpDir, settings)builds QEMU's environment (TMPDIR, QEMU_VCPU_AFFINITY). The child process and the in-process :vm path both use it, where each path used to build its own. There is no behaviour change.QemuEnvTest: TMPDIR is the cache dir on both paths, the auto vCPU affinity follows smp, and an empty affinity is left out.-snapshotand TMPDIR for QEMU run by hand, and on the harmless SELinuxioctl 0x581f(FS_IOC_FSGETXATTR) denial logged once per overlay.No Pyre change is needed.
create_tmp_filein block.c is upstream code and behaves correctly on bionic.How it was tested (shared emulator, sdk_gphone64_arm64, API 36, using the main CI APK from run 40935281916):
vm_dirextra, with-snapshotadded from files/qemu-extra-args.txt. All 9 drives (2 pflash, 7 NVMe) got overlays in/data/data/<pkg>/cache/vl.*, as the SELinux audit lines show. QEMU then got past the block layer and crashed on the fake kernel (exit 139), as expected. There was no temp-file error.in_processon: the same 9 overlays were created in the cache dir byqemu-mainin the :vm process. The process then crashed on the fake kernel.run-as <pkg>withTMPDIR=<cache>and the bundled binary (-M a13-test -snapshot -drive ...):info blockshows the overlay.../cache/vl.ZEWAY3, and QEMU exits 0.adb shell(uid shell) withTMPDIR=<app cache>givesCould not open temporary file '/data/user/0/io.github.dylanneve1.iosonpixel/cache/vl.30W2X3': Permission denied.Not tested:
testDebugUnitTestruns it.-snapshoton the Pixel 10. That needs a check by Dylan, though nothing here is device-specific.Closes #68