Repository navigation
possible libuv issue with macos 10.15: empty udp message not registering #30030
Description
Activity
- addeddgramIssues and PRs related to UDP and the dgram module.Issues and PRs related to UDP and the dgram module.
on Oct 18, 2019 Does this also happen with Node 12.11.1?
@addaleax Yes, just tried with the binary using https://nodejs.org/dist/v12.11.1/
Reacted by Anna Henningsen- addedmacosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
on Oct 18, 2019 /cc @nodejs/platform-macos
@daviehh Have you tried recreating this with e.g. Python? I’m not on a mac but I have the suspicion that this may actually be just a platform quirk of macOS that we can’t do anything about.
@addaleax I have actually tried Python, empty udp message works there:
receiving:
import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(("127.0.0.1", 6000)) while True: data, addr = sock.recvfrom(1024) print("received message:", data)sending:
import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto(b"", ("127.0.0.1", 6000))It seems our test suite also fails due to this on macOS Catalina.
=== release test-dgram-connect-send-empty-buffer === Path: parallel/test-dgram-connect-send-empty-buffer Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-connect-send-empty-buffer.js --- TIMEOUT --- === release test-dgram-connect-send-empty-array === Path: parallel/test-dgram-connect-send-empty-array Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-connect-send-empty-array.js --- TIMEOUT --- === release test-dgram-connect-send-empty-packet === Path: parallel/test-dgram-connect-send-empty-packet Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-connect-send-empty-packet.js --- TIMEOUT --- === release test-dgram-send-empty-array === Path: parallel/test-dgram-send-empty-array Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-send-empty-array.js --- TIMEOUT --- === release test-dgram-send-empty-buffer === Path: parallel/test-dgram-send-empty-buffer Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-send-empty-buffer.js --- TIMEOUT --- === release test-dgram-send-empty-packet === Path: parallel/test-dgram-send-empty-packet Command: out/Release/node /Users/luigi/code/node/test/parallel/test-dgram-send-empty-packet.js --- TIMEOUT --- [03:46|% 100|+ 2791|- 6]: Done- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
on Oct 20, 2019 Thanks! I first noticed this issue with a beta version of another language that uses libuv (julia), so it's likely that it's a libuv bug; is it good for the bug report to be here or is it better to report to libuv? Not sure how to write a simple c code that directly uses libuv to reproduce the issue though.
Yeah, I've reproduced the issue in
libuv. Apparently the message is actually sent (I've checked it with tcpdump) but not received.It looks like a problem with
kqueuenot reporting the event. The python example does not seem to apply to our case as it's waiting onrecvfromsyscall.@nodejs/libuv Has anybody reported this to Apple yet? I’m assuming that that’s the thing to do here, no?
Yes... except sending a bug report to Apple is like throwing matter into a black hole: it disappears and is never seen again.
I have a channel to get some additional information from Apple given the bug report number. Has anyone reported it?
Oh... I just realized that I might have reported this in 2014 and provided a fix. Here is a repo (by other person) that reproduces the issue using outdated libuv version: https://github.com/misterdjules/udp-empty-dgram-repro
13 remaining items
Apple has told me that they have identified a fix and will ship it in a future OS update, but have not provided any further details than that.
Reacted by Ash Cripps@Keno At least that something, thanks for letting us know!
#22546 (Can only find the PR to remove the skip)
The skip is very old and was added in the old repository (see #30030 (comment)).
- added a commit that references this issue
on Mar 8, 2020 I'm seeing multiple instances of our test suite not respecting the mark of flaky in these tests, any idea what's up?
https://ci.nodejs.org/job/node-test-commit-osx/32536/#showFailuresLink
nvm failure is due to
test-timers-blocking-callback- added a commit that references this issue
on Mar 14, 2020 The issue seems to be fixed in macOS 10.15.4
Closing as based on the comments this is fixed, and the tests are no longer skipped in CI on macOS.
v12.12.0
macos catalina/10.15 (19A602)
n/a
When sending an empty udp message, the message will not be received until another non-empty udp message is received.
Example/Reproduce: (may only affect macos 10.15?)
file
server.jsfile
client_test.jsfile
client_0.jsrun the server code, then run the
client_0.js: no response in server.followed by running client_test.js: server got empty and the "abc" message.