deps: update libuv to 1.49.2

Fixes: https://github.com/nodejs/node/issues/56137
Refs: https://github.com/nodejs/node/pull/56223
PR-URL: https://github.com/nodejs/node/pull/56224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
Luigi Pinca authored and Antoine du Hamel committed 2024-12-18 22:31:05 +01:00
1 parent 3298ef4891
commit 4e9113eada
15 files changed
+67 -174

No files matched your search

+2
View File
@@ -588,3 +588,5 @@ Raihaan Shouhell <raihaanhimself@gmail.com>
Rialbat <miha-wead@mail.ru>
Adam <adam@NetBSD.org>
Poul T Lomholt <ptlomholt@users.noreply.github.com>
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Thad House <ThadHouse@users.noreply.github.com>
+19 -1
View File
@@ -1,4 +1,22 @@
2024.10.11, Version 1.49.1 (Stable)
2024.10.18, Version 1.49.2 (Stable)
Changes since version 1.49.1:
* win,fs: remove trailing slash in junctions (Hüseyin Açacak)
* Revert "linux: eliminate a read on eventfd per wakeup" (Ben Noordhuis)
* win: Fix linked list logic in getaddrinfo (Thad House)
* win: fix compilation against Windows 24H2 SDK (Thad House)
* win: remap ERROR_NOACCESS and ERROR_BUFFER_OVERFLOW (Jameson Nash)
* win,fs: match trailing slash presence in junctions to user input (Jameson
Nash)
2024.10.11, Version 1.49.1 (Stable), 8be336f4ee296d20e1c071a44d6adf279e202236
Changes since version 1.49.0:
+1 -1
View File
@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57)
AC_INIT([libuv], [1.49.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.49.2], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
+1 -1
View File
@@ -32,7 +32,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 49
#define UV_VERSION_PATCH 1
#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""
+14 -114
View File
@@ -38,34 +38,6 @@
#include <sys/eventfd.h>
#endif
#if UV__KQUEUE_EVFILT_USER
static uv_once_t kqueue_runtime_detection_guard = UV_ONCE_INIT;
static int kqueue_evfilt_user_support = 1;
static void uv__kqueue_runtime_detection(void) {
int kq;
struct kevent ev[2];
struct timespec timeout = {0, 0};
/* Perform the runtime detection to ensure that kqueue with
* EVFILT_USER actually works. */
kq = kqueue();
EV_SET(ev, UV__KQUEUE_EVFILT_USER_IDENT, EVFILT_USER,
EV_ADD | EV_CLEAR, 0, 0, 0);
EV_SET(ev + 1, UV__KQUEUE_EVFILT_USER_IDENT, EVFILT_USER,
0, NOTE_TRIGGER, 0, 0);
if (kevent(kq, ev, 2, ev, 1, &timeout) < 1 ||
ev[0].filter != EVFILT_USER ||
ev[0].ident != UV__KQUEUE_EVFILT_USER_IDENT ||
ev[0].flags & EV_ERROR)
/* If we wind up here, we can assume that EVFILT_USER is defined but
* broken on the current system. */
kqueue_evfilt_user_support = 0;
uv__close(kq);
}
#endif
static void uv__async_send(uv_loop_t* loop);
static int uv__async_start(uv_loop_t* loop);
static void uv__cpu_relax(void);
@@ -158,10 +130,8 @@ void uv__async_close(uv_async_t* handle) {
static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
#ifndef __linux__
char buf[1024];
ssize_t r;
#endif
struct uv__queue queue;
struct uv__queue* q;
uv_async_t* h;
@@ -169,12 +139,7 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
assert(w == &loop->async_io_watcher);
#ifndef __linux__
#if UV__KQUEUE_EVFILT_USER
for (;!kqueue_evfilt_user_support;) {
#else
for (;;) {
#endif
r = read(w->fd, buf, sizeof(buf));
if (r == sizeof(buf))
@@ -191,7 +156,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
abort();
}
#endif /* !__linux__ */
uv__queue_move(&loop->async_handles, &queue);
while (!uv__queue_empty(&queue)) {
@@ -215,58 +179,34 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
static void uv__async_send(uv_loop_t* loop) {
const void* buf;
ssize_t len;
int fd;
ssize_t r;
#ifdef __linux__
uint64_t val;
int r;
fd = loop->async_io_watcher.fd; /* eventfd */
for (val = 1; /* empty */; val = 1) {
r = write(fd, &val, sizeof(uint64_t));
if (r < 0) {
/* When EAGAIN occurs, the eventfd counter hits the maximum value of the unsigned 64-bit.
* We need to first drain the eventfd and then write again.
*
* Check out https://man7.org/linux/man-pages/man2/eventfd.2.html for details.
*/
if (errno == EAGAIN) {
/* It's ready to retry. */
if (read(fd, &val, sizeof(uint64_t)) > 0 || errno == EAGAIN) {
continue;
}
}
/* Unknown error occurs. */
break;
}
return;
}
#else
#if UV__KQUEUE_EVFILT_USER
struct kevent ev;
buf = "";
len = 1;
fd = loop->async_wfd;
if (kqueue_evfilt_user_support) {
fd = loop->async_io_watcher.fd; /* magic number for EVFILT_USER */
EV_SET(&ev, fd, EVFILT_USER, 0, NOTE_TRIGGER, 0, 0);
r = kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL);
if (r == 0)
return;
else
abort();
#if defined(__linux__)
if (fd == -1) {
static const uint64_t val = 1;
buf = &val;
len = sizeof(val);
fd = loop->async_io_watcher.fd; /* eventfd */
}
#endif
fd = loop->async_wfd; /* write end of the pipe */
do
r = write(fd, "x", 1);
r = write(fd, buf, len);
while (r == -1 && errno == EINTR);
if (r == 1)
if (r == len)
return;
if (r == -1)
if (errno == EAGAIN || errno == EWOULDBLOCK)
return;
#endif
abort();
}
@@ -275,9 +215,6 @@ static void uv__async_send(uv_loop_t* loop) {
static int uv__async_start(uv_loop_t* loop) {
int pipefd[2];
int err;
#if UV__KQUEUE_EVFILT_USER
struct kevent ev;
#endif
if (loop->async_io_watcher.fd != -1)
return 0;
@@ -289,36 +226,6 @@ static int uv__async_start(uv_loop_t* loop) {
pipefd[0] = err;
pipefd[1] = -1;
#elif UV__KQUEUE_EVFILT_USER
uv_once(&kqueue_runtime_detection_guard, uv__kqueue_runtime_detection);
if (kqueue_evfilt_user_support) {
/* In order not to break the generic pattern of I/O polling, a valid
* file descriptor is required to take up a room in loop->watchers,
* thus we create one for that, but this fd will not be actually used,
* it's just a placeholder and magic number which is going to be closed
* during the cleanup, as other FDs. */
err = uv__open_cloexec("/dev/null", O_RDONLY);
if (err < 0)
return err;
pipefd[0] = err;
pipefd[1] = -1;
/* When using EVFILT_USER event to wake up the kqueue, this event must be
* registered beforehand. Otherwise, calling kevent() to issue an
* unregistered EVFILT_USER event will get an ENOENT.
* Since uv__async_send() may happen before uv__io_poll() with multi-threads,
* we can't defer this registration of EVFILT_USER event as we did for other
* events, but must perform it right away. */
EV_SET(&ev, err, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, 0);
err = kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL);
if (err < 0)
return UV__ERR(errno);
} else {
err = uv__make_pipe(pipefd, UV_NONBLOCK_PIPE);
if (err < 0)
return err;
}
#else
err = uv__make_pipe(pipefd, UV_NONBLOCK_PIPE);
if (err < 0)
@@ -329,13 +236,6 @@ static int uv__async_start(uv_loop_t* loop) {
uv__io_start(loop, &loop->async_io_watcher, POLLIN);
loop->async_wfd = pipefd[1];
#if UV__KQUEUE_EVFILT_USER
/* Prevent the EVFILT_USER event from being added to kqueue redundantly
* and mistakenly later in uv__io_poll(). */
if (kqueue_evfilt_user_support)
loop->async_io_watcher.events = loop->async_io_watcher.pevents;
#endif
return 0;
}
-22
View File
@@ -35,10 +35,6 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#if defined(__APPLE__) || defined(__DragonFly__) || \
defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/event.h>
#endif
#define uv__msan_unpoison(p, n) \
do { \
@@ -508,22 +504,4 @@ int uv__get_constrained_cpu(uv__cpu_constraint* constraint);
#endif
#endif
#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
/* EVFILT_USER is available since OS X 10.6, DragonFlyBSD 4.0,
* FreeBSD 8.1, and NetBSD 10.0.
*
* Note that even though EVFILT_USER is defined on the current system,
* it may still fail to work at runtime somehow. In that case, we fall
* back to pipe-based signaling.
*/
#define UV__KQUEUE_EVFILT_USER 1
/* Magic number of identifier used for EVFILT_USER during runtime detection.
* There are no Google hits for this number when I create it. That way,
* people will be directed here if this number gets printed due to some
* kqueue error and they google for help. */
#define UV__KQUEUE_EVFILT_USER_IDENT 0x1e7e7711
#else
#define UV__KQUEUE_EVFILT_USER 0
#endif
#endif /* UV_UNIX_INTERNAL_H_ */
-11
View File
@@ -367,17 +367,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
continue;
}
#if UV__KQUEUE_EVFILT_USER
if (ev->filter == EVFILT_USER) {
w = &loop->async_io_watcher;
assert(fd == w->fd);
uv__metrics_update_idle_time(loop);
w->cb(loop, w, w->events);
nevents++;
continue;
}
#endif
if (ev->filter == EVFILT_VNODE) {
assert(w->events == POLLIN);
assert(w->pevents == POLLIN);
-6
View File
@@ -1414,12 +1414,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
w->events = w->pevents;
e.events = w->pevents;
if (w == &loop->async_io_watcher)
/* Enable edge-triggered mode on async_io_watcher(eventfd),
* so that we're able to eliminate the overhead of reading
* the eventfd via system call on each event loop wakeup.
*/
e.events |= EPOLLET;
e.data.fd = w->fd;
fd = w->fd;
+2 -2
View File
@@ -69,7 +69,6 @@ int uv_translate_sys_error(int sys_errno) {
}
switch (sys_errno) {
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ELEVATION_REQUIRED: return UV_EACCES;
case ERROR_CANT_ACCESS_FILE: return UV_EACCES;
@@ -96,7 +95,7 @@ int uv_translate_sys_error(int sys_errno) {
case WSAECONNRESET: return UV_ECONNRESET;
case ERROR_ALREADY_EXISTS: return UV_EEXIST;
case ERROR_FILE_EXISTS: return UV_EEXIST;
case ERROR_BUFFER_OVERFLOW: return UV_EFAULT;
case ERROR_NOACCESS: return UV_EFAULT;
case WSAEFAULT: return UV_EFAULT;
case ERROR_HOST_UNREACHABLE: return UV_EHOSTUNREACH;
case WSAEHOSTUNREACH: return UV_EHOSTUNREACH;
@@ -127,6 +126,7 @@ int uv_translate_sys_error(int sys_errno) {
case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE;
case WSAEMFILE: return UV_EMFILE;
case WSAEMSGSIZE: return UV_EMSGSIZE;
case ERROR_BUFFER_OVERFLOW: return UV_ENAMETOOLONG;
case ERROR_FILENAME_EXCED_RANGE: return UV_ENAMETOOLONG;
case ERROR_NETWORK_UNREACHABLE: return UV_ENETUNREACH;
case WSAENETUNREACH: return UV_ENETUNREACH;
+9 -8
View File
@@ -2566,16 +2566,17 @@ static void fs__create_junction(uv_fs_t* req, const WCHAR* path,
path_buf[path_buf_len++] = path[i];
}
path_buf[path_buf_len++] = L'\\';
if (add_slash)
path_buf[path_buf_len++] = L'\\';
len = path_buf_len - start;
/* Insert null terminator */
path_buf[path_buf_len++] = L'\0';
/* Set the info about the substitute name */
buffer->MountPointReparseBuffer.SubstituteNameOffset = start * sizeof(WCHAR);
buffer->MountPointReparseBuffer.SubstituteNameLength = len * sizeof(WCHAR);
/* Insert null terminator */
path_buf[path_buf_len++] = L'\0';
/* Copy the print name of the target path */
start = path_buf_len;
add_slash = 0;
@@ -2593,18 +2594,18 @@ static void fs__create_junction(uv_fs_t* req, const WCHAR* path,
path_buf[path_buf_len++] = path[i];
}
len = path_buf_len - start;
if (len == 2) {
if (len == 2 || add_slash) {
path_buf[path_buf_len++] = L'\\';
len++;
}
/* Insert another null terminator */
path_buf[path_buf_len++] = L'\0';
/* Set the info about the print name */
buffer->MountPointReparseBuffer.PrintNameOffset = start * sizeof(WCHAR);
buffer->MountPointReparseBuffer.PrintNameLength = len * sizeof(WCHAR);
/* Insert another null terminator */
path_buf[path_buf_len++] = L'\0';
/* Calculate how much buffer space was actually used */
used_buf_size = FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer) +
path_buf_len * sizeof(WCHAR);
+3 -2
View File
@@ -191,8 +191,9 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) {
if (addrinfow_ptr == NULL)
break;
cur_off = align_offset(cur_off, sizeof(void *));
addrinfo_ptr = (struct addrinfo *)(alloc_ptr + cur_off);
addrinfo_ptr->ai_next = addrinfo_ptr;
struct addrinfo *next_addrinfo_ptr = (struct addrinfo *)(alloc_ptr + cur_off);
addrinfo_ptr->ai_next = next_addrinfo_ptr;
addrinfo_ptr = next_addrinfo_ptr;
}
req->addrinfo = (struct addrinfo*)alloc_ptr;
} else {
+10
View File
@@ -4125,6 +4125,12 @@ typedef const UNICODE_STRING *PCUNICODE_STRING;
# define DEVICE_TYPE DWORD
#endif
#ifndef NTDDI_WIN11_ZN
# define NTDDI_WIN11_ZN 0x0A00000E
#endif
/* API is defined in newer SDKS */
#if (NTDDI_VERSION < NTDDI_WIN11_ZN)
typedef struct _FILE_STAT_BASIC_INFORMATION {
LARGE_INTEGER FileId;
LARGE_INTEGER CreationTime;
@@ -4142,6 +4148,7 @@ typedef struct _FILE_STAT_BASIC_INFORMATION {
FILE_ID_128 FileId128;
LARGE_INTEGER VolumeSerialNumber;
} FILE_STAT_BASIC_INFORMATION;
#endif
/* MinGW already has a definition for REPARSE_DATA_BUFFER, but mingw-w64 does
* not.
@@ -4783,6 +4790,8 @@ typedef struct _TCP_INITIAL_RTO_PARAMETERS {
#endif
/* from winnt.h */
/* API is defined in newer SDKS */
#if (NTDDI_VERSION < NTDDI_WIN11_ZN)
typedef enum _FILE_INFO_BY_NAME_CLASS {
FileStatByNameInfo,
FileStatLxByNameInfo,
@@ -4790,6 +4799,7 @@ typedef enum _FILE_INFO_BY_NAME_CLASS {
FileStatBasicByNameInfo,
MaximumFileInfoByNameClass
} FILE_INFO_BY_NAME_CLASS;
#endif
typedef BOOL(WINAPI* sGetFileInformationByName)(
PCWSTR FileName,
+1 -1
View File
@@ -64,7 +64,7 @@ TEST_IMPL(error_message) {
TEST_IMPL(sys_error) {
#if defined(_WIN32)
ASSERT_EQ(uv_translate_sys_error(ERROR_NOACCESS), UV_EACCES);
ASSERT_EQ(uv_translate_sys_error(ERROR_NOACCESS), UV_EFAULT);
ASSERT_EQ(uv_translate_sys_error(ERROR_ELEVATION_REQUIRED), UV_EACCES);
ASSERT_EQ(uv_translate_sys_error(WSAEADDRINUSE), UV_EADDRINUSE);
ASSERT_EQ(uv_translate_sys_error(ERROR_BAD_PIPE), UV_EPIPE);
+4 -4
View File
@@ -2379,8 +2379,8 @@ int test_symlink_dir_impl(int type) {
strcpy(test_dir_abs_buf, "\\\\?\\");
uv_cwd(test_dir_abs_buf + 4, &test_dir_abs_size);
test_dir_abs_size += 4;
strcat(test_dir_abs_buf, "\\test_dir\\");
test_dir_abs_size += strlen("\\test_dir\\");
strcat(test_dir_abs_buf, "\\test_dir");
test_dir_abs_size += strlen("\\test_dir");
test_dir = test_dir_abs_buf;
#else
uv_cwd(test_dir_abs_buf, &test_dir_abs_size);
@@ -2435,8 +2435,8 @@ int test_symlink_dir_impl(int type) {
r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL);
ASSERT_OK(r);
#ifdef _WIN32
ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 5);
ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5));
ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 4);
ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 4));
#else
ASSERT_OK(strcmp(req.ptr, test_dir_abs_buf));
#endif
@@ -28,7 +28,7 @@ const fs = require('fs');
const tmpdir = require('../common/tmpdir');
// Test creating and reading symbolic link
const linkData = fixtures.path('cycles/');
const linkData = fixtures.path('cycles');
const linkPath = tmpdir.resolve('cycles_link');
tmpdir.refresh();