using `nix-ld-rs` to load openssl makes ping response time from LAN address spiky
I have had this weird issue that if I add `pkgs.openssl` (or `pkgs.openssl_3_3`) to the enabled libraries for `nix-ld` module, and after a reboot, response time from pinging my LAN router becomes spiky, ranging from the normal sub 1ms to sometimes 10+ ms even hundreds of ms. This issue affects other IP protocol communication, e.g. browsing the web become sluggish.
I tried `strace`ing the ping command, and the only difference between the normal ping and a problematic ping is that the `recvmsg` syscall returns `EAGAIN` error, e.g.
```
sendto(3, "\10\0\2717\377\377\0\3\220\203zf\0\0\0\0l\10\t\0\0\0\0\0\20\21\22\23\24\25\26\27"..., 64, 0, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.199.1")}, 16) = 64
recvmsg(3, {msg_namelen=128}, 0) = -1 EAGAIN (Resource temporarily unavailable)
```
whereas a ping with normal response looks like:
```
sendto(3, "\10\0q\201\377\377\0\4\221\203zf\0\0\0\0\262\275\t\0\0\0\0\0\20\21\22\23\24\25\26\27"..., 64, 0, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.199.1")}, 16) = 64
recvmsg(3, {msg_name={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.199.1")}, msg_namelen=128 => 16, msg_iov=[{iov_base="\0\0\3012\0\5\0\3\220\203zf\0\0\0\0l\10\t\0\0\0\0\0\20\21\22\23\24\25\26\27"..., iov_len=192}], msg_iovlen=1, msg_control=[{cmsg_len=32, cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD, cmsg_data={tv_sec=1719305105, tv_usec=638725}}, {cmsg_len=20, cmsg_level=SOL_IP, cmsg_type=IP_TTL, cmsg_data=[64]}], msg_controllen=56, msg_flags=0}, 0) = 64
```
While the error explains the slow response time, it didn't give hints to the root cause.
Any help/guidance on debugging this issue is appreciated!
Some context:
- OS: NixOS 24.05
- tried both `nix-ld` and `nix-ld-rs`, but no difference
0 条评论