chrome based apps can not be run under qemu user mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Expired
|
Undecided
|
Unassigned |
Bug Description
chrome uses /proc/self/exe to fork render process.
Here a simple code to reproduce the issue. It's output parent then child but failed with qemu: unknown option 'type=renderer'.
Maybe we can modify exec syscall to replace /proc/self/exe to the real path.
//gcc -o self self.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char** argv) {
if(argc==1){
printf ("parent\n");
if ( fork() == 0 )
{
return execl("
}
} else {
printf ("child\n");
}
return 0;
}
similar reports:
https:/
https:/
Workardound:
compile chrome or your chrome based app with a patch to content/
diff --git a/content/
index bc78aba80ac8.
--- a/content/
+++ b/content/
@@ -60,8 +60,12 @@ base::FilePath ChildProcessHos
#if defined(OS_LINUX)
// Use /proc/self/exe rather than our known binary path so updates
// can't swap out the binary from underneath us.
- if (child_path.empty() && flags & CHILD_ALLOW_SELF)
- child_path = base::FilePath(
+ if (child_path.empty() && flags & CHILD_ALLOW_SELF) {
+ if (!ReadSymbolicL
+ NOTREACHED() << "Unable to resolve " << base::kProcSelfExe << ".";
+ child_path = base::FilePath(
+ }
+ }
#endif
// On most platforms, the child executable is the same as the current
Changed in qemu: | |
status: | Incomplete → New |
qemu patch: user/syscall. c b/linux- user/syscall. c .227d9b1b0e 100644 user/syscall. c user/syscall. c safe_execve( p, argp, envp)); safe_execve( is_proc_ myself( p, "exe") ? exec_path : p, argp, envp));
unlock_ user(p, arg1, 0);
diff --git a/linux-
index 95d79ddc43.
--- a/linux-
+++ b/linux-
@@ -8537,7 +8537,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
* before the execve completes and makes it the other
* program's problem.
*/
- ret = get_errno(
+ ret = get_errno(
goto execve_end;