Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit test watcher_cross_stop fail in wsl2 #4422

Open
cuichenli opened this issue May 24, 2024 · 1 comment
Open

unit test watcher_cross_stop fail in wsl2 #4422

cuichenli opened this issue May 24, 2024 · 1 comment

Comments

@cuichenli
Copy link

  • Version: latest code on v1.x branch
  • Platform: Linux desktop 5.15.146.1-microsoft-standard-WSL2 # 1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux

Problem: test for watcher_cross_stop fail with timeout

Strace output:

execve("build/uv_run_tests_a", ["build/uv_run_tests_a", "watcher_cross_stop"], 0x7ffe7866ac98 /* 28 vars */) = 0
brk(NULL)                               = 0x559cc6488000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fca3948a000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=18066, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 18066, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fca39485000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20t\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1922136, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1970000, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fca392a4000
mmap(0x7fca392ca000, 1396736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7fca392ca000
mmap(0x7fca3941f000, 339968, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17b000) = 0x7fca3941f000
mmap(0x7fca39472000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ce000) = 0x7fca39472000
mmap(0x7fca39478000, 53072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fca39478000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fca392a1000
arch_prctl(ARCH_SET_FS, 0x7fca392a1740) = 0
set_tid_address(0x7fca392a1a10)         = 8112
set_robust_list(0x7fca392a1a20, 24)     = 0
rseq(0x7fca392a2060, 0x20, 0, 0x53053053) = 0
mprotect(0x7fca39472000, 16384, PROT_READ) = 0
mprotect(0x559cc4235000, 4096, PROT_READ) = 0
mprotect(0x7fca394bc000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7fca39485000, 18066)           = 0
geteuid()                               = 1000
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fca392e0050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
getrandom("\x01\xf6\x72\x2c\x63\xf1\xbf\xab", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x559cc6488000
brk(0x559cc64a9000)                     = 0x559cc64a9000
unlink("/tmp/uv-test-sock")             = -1 ENOENT (No such file or directory)
unlink("/tmp/uv-test-sock2")            = -1 ENOENT (No such file or directory)
unlink("/tmp/uv-test-sock3")            = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/tmp", O_RDWR|O_EXCL|O_TMPFILE, 0600) = 3
fcntl(3, F_GETFL)                       = 0x418002 (flags O_RDWR|O_LARGEFILE|O_TMPFILE)
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fca392a1a10) = 8113
pipe2([4, 5], 0)                        = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fca3932a6a0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fca392e0050}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 266240, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fca39260000
mprotect(0x7fca39261000, 262144, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7fca392a0990, parent_tid=0x7fca392a0990, exit_signal=0, stack=0x7fca39260000, stack_size=0x3ff80, tls=0x7fca392a06c0} => {parent_tid=[8114]}, 88) = 8114
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
pselect6(5, [4], NULL, NULL, {tv_sec=5, tv_nsec=0}, NULL) = 0 (Timeout)
kill(8113, SIGTERM)                     = 0
futex(0x7fca392a0990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 8114, NULL, FUTEX_BITSET_MATCH_ANY) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=8113, si_uid=1000, si_status=SIGTERM, si_utime=2 /* 0.02 s */, si_stime=5 /* 0.05 s */} ---
futex(0x7fca392a0990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 8114, NULL, FUTEX_BITSET_MATCH_ANY) = 0
close(4)                                = 0
close(5)                                = 0
write(1, "not ok 1 - watcher_cross_stop\n", 30not ok 1 - watcher_cross_stop
) = 30
write(1, "# timeout\n", 10# timeout
)             = 10
write(1, "# ", 2# )                       = 2
newfstatat(3, "", {st_mode=S_IFREG|0600, st_size=0, ...}, AT_EMPTY_PATH) = 0
write(1, "Output from process `watcher_cro"..., 54Output from process `watcher_cross_stop`: (no output)
) = 54
close(3)                                = 0
exit_group(255)                         = ?
+++ exited with 255 +++

Some extra information: I have tested this in a Ubuntu distro WSL2 as well, but it also failed. On there I added some debug information and looks like after ~300 iteration of uv_udp_bind at line

ASSERT_OK(uv_udp_bind(&sockets[i],
, the test will fail without any information provided.

I also tried increase the ulimit -n but it did not help

ulimit -n
10240

Please kindly let me know if I missed any information. Thanks!

@bnoordhuis
Copy link
Member

What was the uv_udp_bind error you got? It should have printed something like "expected 0, got -32".

My hunch is that wsl2 has trouble with a program creating so many udp sockets.

By the way, you can trace the test itself (instead of the test harness, like you're doing now) with:

$ strace -fyy build/uv_run_tests_a watcher_cross_stop watcher_cross_stop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants