On Fri, 29 Oct 2021 19:02:15 +0800 Li Feng wrote: > On Fri, Oct 29, 2021 at 5:34 PM Stefano Brivio wrote: > > > > On Fri, 29 Oct 2021 16:54:47 +0800 > > Li Feng wrote: > > > > > [...] > > > > > > Thanks for the detailed explanation. > > > I finally found out that the `qrap` was the root cause. > > > I patched the qemu, and it works well. > > > > Have you found out what was the offending syscall? I'll probably hit > > this later too, but that would help me double checking what the problem > > was. > > I made a mistake in the previous mail, using `./passt -f` works, but > if running in background, > it still exits without any output. > > This is the strace output. > > ``` > $ strace -f ./passt > ... > ... > accept(6, NULL, NULL) = 7 > epoll_ctl(5, EPOLL_CTL_ADD, 7, {events=EPOLLIN|EPOLLRDHUP|EPOLLET, > data={u32=7, u64=7}}) = 0 > getrandom("\x40\xfc\xc5\x4a\x29\x3e\xdb\xcd\x25\x92\xc6\xc3\xc7\xcb\x57\x5a", > 16, GRND_RANDOM) = 16 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 8 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 9 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 10 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 11 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 12 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 13 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 14 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 15 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 16 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 17 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 18 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 19 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 20 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 21 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 22 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 23 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 24 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 25 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 26 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 27 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 28 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 29 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 30 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 31 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 32 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 33 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 34 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 35 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 36 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 37 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 38 > socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 39 > clone(child_stack=NULL, > flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLDstrace: Process > 172939 attached > , child_tidptr=0x7f7b89b1da10) = 172939 > [pid 172921] exit_group(0 > [pid 172939] set_robust_list(0x7f7b89b1da20, 24 > [pid 172921] <... exit_group resumed>) = ? > [pid 172921] +++ exited with 0 +++ > <... set_robust_list resumed>) = ? > +++ killed by SIGSYS (core dumped) +++ > ``` > Which is the bad syscall? Oh, it's set_robust_list(), it's normal that exit_group() doesn't return. That new usage probably comes from: https://sourceware.org/git/?p=glibc.git;a=commit;h=9a7565403758f65c07fe3705e966381d9cfd35b6 and that code path is not really needed for passt, so I would have a quick try at avoiding it rather than adding a syscall, perhaps with a small replacement of daemon() using clone() instead of fork(). Meanwhile, this should work for you: diff --git a/passt.c b/passt.c index 6436a45..2a4ba8b 100644 --- a/passt.c +++ b/passt.c @@ -280,3 +280,3 @@ static void pid_file(struct ctx *c) { * #syscalls openat fstat fcntl lseek clone setsid exit_group getpid - * #syscalls clock_gettime newfstatat + * #syscalls clock_gettime newfstatat set_robust_list * #syscalls:pasta rt_sigreturn -- Stefano