Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v1.x' into v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechsTech committed Oct 23, 2024
2 parents 470fb79 + d4ab6fb commit 6d4e68f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/CI-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,20 @@ jobs:
adb shell "cd /data/local/tmp/build ; env UV_TEST_TIMEOUT_MULTIPLIER=5 ./uv_run_tests_a"
build-macos:
runs-on: macos-12
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
steps:
- uses: actions/checkout@v4
- name: Envinfo
run: npx envinfo
- name: Disable Firewall
run: |
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
- name: Setup
run: |
brew install ninja automake libtool
Expand Down Expand Up @@ -112,7 +121,11 @@ jobs:
make -C build-auto -j4
build-ios:
runs-on: macos-12
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
steps:
- uses: actions/checkout@v4
- name: Configure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
./build-ubsan/uv_run_tests_a
sanitizers-macos:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ struct uv__queue {
XX(ESOCKTNOSUPPORT, "socket type not supported") \
XX(ENODATA, "no data available") \
XX(EUNATCH, "protocol driver not attached") \
XX(ENOEXEC, "exec format error") \

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
Expand Down
6 changes: 6 additions & 0 deletions include/uv/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,10 @@
# define UV__EUNATCH (-4023)
#endif

#if defined(ENOEXEC) && !defined(_WIN32)
# define UV__ENOEXEC UV__ERR(ENOEXEC)
#else
# define UV__ENOEXEC (-4022)
#endif

#endif /* UV_ERRNO_H_ */
15 changes: 13 additions & 2 deletions test/test-udp-multicast-join.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ static uv_udp_t client;
static uv_udp_send_t req;
static uv_udp_send_t req_ss;

static int darwin_ebusy_errors;
static int cl_recv_cb_called;

static int sv_send_cb_called;

static int close_cb_called;

static void alloc_cb(uv_handle_t* handle,
Expand Down Expand Up @@ -128,6 +127,13 @@ static void cl_recv_cb(uv_udp_t* handle,

#if !defined(__NetBSD__)
r = uv_udp_set_source_membership(&server, MULTICAST_ADDR, NULL, source_addr, UV_JOIN_GROUP);
#if defined(__APPLE__)
if (r == UV_EBUSY) {
uv_close((uv_handle_t*) &server, close_cb);
darwin_ebusy_errors++;
return;
}
#endif
ASSERT_OK(r);
#endif

Expand Down Expand Up @@ -160,6 +166,8 @@ TEST_IMPL(udp_multicast_join) {
r = uv_udp_set_membership(&server, MULTICAST_ADDR, NULL, UV_JOIN_GROUP);
if (r == UV_ENODEV)
RETURN_SKIP("No multicast support.");
if (r == UV_ENOEXEC)
RETURN_SKIP("No multicast support (likely a firewall issue).");
ASSERT_OK(r);

r = uv_udp_recv_start(&server, alloc_cb, cl_recv_cb);
Expand All @@ -175,6 +183,9 @@ TEST_IMPL(udp_multicast_join) {
/* run the loop till all events are processed */
uv_run(uv_default_loop(), UV_RUN_DEFAULT);

if (darwin_ebusy_errors > 0)
RETURN_SKIP("Unexplained macOS IP_ADD_SOURCE_MEMBERSHIP EBUSY bug");

ASSERT_EQ(2, cl_recv_cb_called);
ASSERT_EQ(2, sv_send_cb_called);
ASSERT_EQ(2, close_cb_called);
Expand Down

0 comments on commit 6d4e68f

Please sign in to comment.