DynamoRIO / DynamoRIO/dynamorio
handle clone flag CLONE_NEWPID for creating new pid namespace
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
Try to start chrome with DR on ChromeOS ARM, saw assert core/unix/os.c:7176 parent != 0
From parent process's log:
system call 120
syscall: clone with flags = 0x70000011
args: 0x70000011, 0xbef2d98c, 0x00000000, 0x00000000, 0x00000000
WARNING: CLONE_VM not set!
...
Exit from system call
post syscall: sysnum=0x00000078, result=0x00005c6b (23659)
syscall: clone returned 0x00005c6b
It means the parent (23653) create process 23659
Using gdb to attach to process 23659:
(gdb) info threads
Id Target Id Frame
- 1 process 23659 "chrome" 0x7123eb5c in post_system_call (dcontext=0x46a981e0) at /home/zhaoqin/Workspace/DynamoRIO/dynamorio.git/core/unix/os.c:7173
(gdb) info proc
process 23659
...
However, all the call from the process about pid, tid, ppid returns 1 or 0.
(gdb) p dynamorio_syscall(20, 0)
$8 = 1
(gdb) p dynamorio_syscall(64, 0)
$9 = 0
(gdb) p get_process_id()
$10 = 1
(gdb) p get_sys_thread_id()
$11 = 1
(gdb) p get_parent_id()
$12 = 0
(gdb) p dynamorio_syscall(20, 0)
$13 = 1
(gdb) p dynamorio_syscall(64, 0)
$14 = 0
And that's why the assert is triggerred.
before that, the parent process has created a process successfully:
system call 120
syscall: clone with flags = 0x10000011
args: 0x10000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000
WARNING: CLONE_VM not set!
...
Exit from system call
post syscall: sysnum=0x00000078, result=0x00005c68 (23656)
syscall: clone returned 0x00005c68
...
dispatch: target = 0xb4e7c266
Exit from system call
SYSLOG_INFORMATION: -- parent 23653 forked child 23656 --
The assert happens consistently, so not a flaky or racy.
Contributor guide
Assessment
This issue has not been assessed yet.