nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.64k stars 664 forks source link

Test sys::test_socket::test_af_alg_aead hangs on Ubuntu 20.04/AMD64 beta #1311

Closed tommythorn closed 2 years ago

tommythorn commented 4 years ago

(spun off issue 1308)

Tested nix@566e2d7dad025c9b2bef98115b584328c145675d using rust 1.47.0 (stable) on Ubuntu 20.04/AMD64 (up to date at time of testing)

cargo test hangs on

...
test sys::test_timerfd::test_timerfd_interval ... ok
test sys::test_socket::test_af_alg_aead ... test sys::test_socket::test_af_alg_aead has been running for over 60 seconds

strace -rf says

...
16749      0.000034 openat(AT_FDCWD, "/proc/self/status", O_RDONLY|O_CLOEXEC) = 3
16749      0.000024 statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=0, ...}) = 0
16749      0.000023 read(3, "Name:\ttest-027f8be683\nUmask:\t000", 32) = 32
16749      0.000028 read(3, "2\nState:\tS (sleeping)\nTgid:\t1674", 32) = 32
16749      0.000014 read(3, "8\nNgid:\t0\nPid:\t16748\nPPid:\t16690\nTracerPid:\t16687\nUid:\t502\t502\t5", 64) = 64
16749      0.000014 read(3, "02\t502\nGid:\t502\t502\t502\t502\nFDSize:\t64\nGroups:\t4 20 24 27 30 46 119 130 131 135 502 \nNStgid:\t16748\nNSpid:\t16748\nNSpgid:\t16687\nNS", 128>
16749      0.000014 read(3, "sid:\t8366\nVmPeak:\t  140700 kB\nVmSize:\t   75164 kB\nVmLck:\t       0 kB\nVmPin:\t       0 kB\nVmHWM:\t    1348 kB\nVmRSS:\t    1348 kB\nRssAnon:\t >
16749      0.000017 read(3, "   2240 kB\nVmPTE:\t      52 kB\nVmSwap:\t       0 kB\nHugetlbPages:\t       0 kB\nCoreDumping:\t0\nTHP_enabled:\t1\nThreads:\t2\nSigQ:\t0/127789\nSigP>
16749      0.000015 read(3, "000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,000>
16749      0.000014 read(3, "", 670)    = 0
16749      0.000012 close(3)            = 0
16749      0.000152 socket(AF_ALG, SOCK_SEQPACKET, 0) = 3
16749      0.000027 bind(3, {sa_family=AF_ALG, sa_data="aead\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0gcm(aes)\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>
16749      0.000027 setsockopt(3, SOL_ALG, ALG_SET_AEAD_AUTHSIZE, NULL, 4) = 0
16749      0.000018 setsockopt(3, SOL_ALG, ALG_SET_KEY, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 32) = 0
16749      0.000021 accept(3, NULL, NULL) = 4
16749      0.000025 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2>
16749      0.000036 read(4, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwB\301hx\213z\377`\264\346\204\271-~k\276g\356Y\r\34474\r\267\23\262\375\355\245\356\202*\245_\370y\356\341J\220\356|\2>
16749      0.000022 close(4)            = 0
16749      0.000019 accept(3, NULL, NULL) = 4
16749      0.000019 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwB\301hx\213z\377`\264\346\204\271-~k\276g\356Y\r\34474\r\267\23\2>
16749      0.000023 read(4,  <unfinished ...>
16748     59.999205 <... futex resumed>) = -1 ETIMEDOUT (Connection timed out)
16748      0.000070 futex(0x560f56330a10, FUTEX_WAKE_PRIVATE, 1) = 0
16748      0.000084 write(1, "test sys::test_socket::test_af_alg_aead ... ", 44) = 44
16748      0.000133 write(1, "test sys::test_socket::test_af_alg_aead has been running for over 60 seconds\n", 77) = 77
16748      0.000061 futex(0x560f56330a88, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
16690     71.406186 <... wait4 resumed>0x7ffc82814720, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
16748      0.000059 <... futex resumed>) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)

Reproduced on a different box running Ubuntu 20.10 beta.

@glebpom might have insights.

cemeyer commented 3 years ago

1317