mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix: RPCS3 opens from the emulator rail again (#1191)
RPCS3's AppImage could not start: its own runtime unpacks the image with a dwarfsextract it runs from a memfd, which Android refuses (EACCES), and it has no other way to run it. Emulator AppImages for arm64 now start through the shipped uruntime, which falls back to a file in /tmp. RPCS3 then stopped with "Null object" in utils::shm (errno 13): it reads /proc/sys/vm/overcommit_memory to pick memfd for guest memory, and apps cannot read it. The guest now gets the kernel's default policy (0) there when the real file is unreadable, like file-max.
This commit is contained in:
1 parent
a5c587bd71
commit
ca352bf225
5 files changed
+101
-4
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import android.content.ContextWrapper
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class LinuxRuntimeProcFilesTest {
|
||||
private val root = Files.createTempDirectory("guest-proc-files").toFile()
|
||||
private val context = object : ContextWrapper(RuntimeEnvironment.getApplication()) {
|
||||
override fun getFilesDir() = File(root, "files").apply { mkdirs() }
|
||||
override fun getCacheDir() = File(root, "cache").apply { mkdirs() }
|
||||
override fun getNoBackupFilesDir() = File(root, "no_backup").apply { mkdirs() }
|
||||
}
|
||||
private val fakeProc get() = File(LinuxRuntime.rootDir(context), "etc/droiddeck/proc")
|
||||
|
||||
@After fun tearDown() {
|
||||
root.deleteRecursively()
|
||||
}
|
||||
|
||||
@Test fun theGuestGetsAnOvercommitPolicyItCanRead() {
|
||||
LinuxRuntime.binds(context, null, null, null, null)
|
||||
assertEquals("0\n", File(fakeProc, "overcommit_memory").readText())
|
||||
assertEquals("9223372036854775807\n", File(fakeProc, "file-max").readText())
|
||||
}
|
||||
|
||||
@Test fun aSeededFileIsKept() {
|
||||
File(fakeProc, "overcommit_memory").apply { parentFile!!.mkdirs(); writeText("1\n") }
|
||||
LinuxRuntime.binds(context, null, null, null, null)
|
||||
assertEquals("1\n", File(fakeProc, "overcommit_memory").readText())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user