1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

5427 Commits

Author SHA1 Message Date
Santiago Gimeno
94e467ad93
Now working on version 1.49.3 2024-10-18 21:08:15 +02:00
Santiago Gimeno
078180e13d Add SHA to ChangeLog 2024-10-18 21:02:38 +02:00
Santiago Gimeno
e1095c7a43 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)
v1.49.2
2024-10-18 21:02:38 +02:00
Jameson Nash
058c49b7ba
win,fs: match trailing slash presence in junctions to user input (#4590)
Refs: #4582
2024-10-18 21:01:07 +02:00
Jameson Nash
7e6590f31d
win: remap ERROR_NOACCESS and ERROR_BUFFER_OVERFLOW (#4567)
It seemed incorrect to map a segfault to EACCES, since posix would typically
map this to EFAULT. The ERROR_BUFFER_OVERFLOW is literally "the filename is too
long", and is not typically an invalid parameter in posix.

Test originally added in #1060 to test the API, not the value.
2024-10-17 15:37:00 -04:00
Thad House
9cf0710d71
win: fix compilation against Windows 24H2 SDK (#4576)
Compilation against the 24H2 SDK is broken by #4327.

Fix that issue by only conditionally defining the new values.

Closes #4575
2024-10-17 15:36:45 -04:00
Thad House
52a9243317
win: Fix linked list logic in getaddrinfo (#4578)
The logic in #4254 is incorrect, and results in the addrinfo linked
list only having a single result. Fix this by correcting the logic.

Closes #4577
2024-10-17 15:36:07 -04:00
Ben Noordhuis
18d48bc13c
Revert "linux: eliminate a read on eventfd per wakeup (#4400)" (#4585)
This reverts commit e5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083.

Reason: bisecting says it breaks dnstap.

Also revert commit 27134547ff ("kqueue: use EVFILT_USER for async if
available") because otherwise the first commit doesn't revert cleanly,
with enough conflicts in src/unix/async.c that I'm not comfortable
fixing those up manually.

Fixes: https://github.com/libuv/libuv/issues/4584
2024-10-17 20:41:38 +02:00
Hüseyin Açacak
fbe2d85bd5 win,fs: remove trailing slash in junctions
Fixes: https://github.com/libuv/libuv/issues/3329
2024-10-15 09:48:27 +02:00
Santiago Gimeno
be0b00a80d
Now working on version 1.49.2 2024-10-11 09:21:05 +02:00
Santiago Gimeno
bfbd6db0d6 Add SHA to ChangeLog 2024-10-11 09:13:11 +02:00
Santiago Gimeno
8be336f4ee 2024.10.11, Version 1.49.1 (Stable)
Changes since version 1.49.0:

* build: add darwin-syscalls.h to release tarball (Ben Noordhuis)

* linux: use IORING_SETUP_NO_SQARRAY when available (Ben Noordhuis)

* linux: use IORING_OP_FTRUNCATE when available (Ben Noordhuis)

* win: fix pNtQueryDirectoryFile check (Rialbat)

* win: fix WriteFile() error translation (Santiago Gimeno)

* win,fs: uv_fs_rmdir() to return ENOENT on file (Santiago Gimeno)

* win,pipe: ipc code does not support async read (Jameson Nash)

* netbsd: fix build (Adam)

* win,fs: fix bug in fs__readdir (Hüseyin Açacak)

* unix: workaround gcc bug on armv7 (Santiago Gimeno)

* unix: work around arm-linux-gnueabihf-gcc bug (Ben Noordhuis)

* unix: fix uv_tcp_keepalive in smartOS (Santiago Gimeno)

* unix: fix uv_getrusage ru_maxrss on solaris (Poul T Lomholt)
v1.49.1
2024-10-11 09:13:10 +02:00
Poul T Lomholt
7c3abfbf1e
unix: fix uv_getrusage ru_maxrss on solaris (#4572) 2024-10-10 17:04:11 +02:00
Santiago Gimeno
1f36b01ed0
unix: fix uv_tcp_keepalive in smartOS (#4570)
Make sure `UV__SOLARIS_11_4` is not set for `smartOS`/`illumOS`. In our
codebase is used only twice:
- Detect correct implementation of `SO_REUSEPORT`, which is not even
  implemented on `illumOS`.
- Detect the time unit used for the TCP keepalive options. If set to
  `0`, which was the case for `illumOS`, it chose milliseconds, which is
  not correct for `illumOS` either as it uses seconds.
2024-10-09 09:52:00 +02:00
Ben Noordhuis
8d957c56b3
unix: work around arm-linux-gnueabihf-gcc bug (#4565)
Both gcc 11 and 12 emit wrong code for a function call pointer in one
very specific context.

Fixes: https://github.com/libuv/libuv/issues/4532
2024-10-08 08:57:22 +02:00
Santiago Gimeno
0be52c8251
unix: workaround gcc bug on armv7 (#4564)
Disable optimization on `uv__preadv_or_pwritev`.

Fixes: https://github.com/libuv/libuv/issues/4532
Fixes: https://github.com/libuv/libuv/issues/4550
2024-10-07 08:47:16 +02:00
Hüseyin Açacak
1cbffcbd5d win,fs: fix bug in fs__readdir 2024-10-04 13:33:22 +02:00
Adam
670e75ee7e
netbsd: fix build 2024-10-04 09:26:07 +02:00
Jameson Nash
f55efb2f38
win,pipe: ipc code does not support async read (#4555)
The implementation of IPC pipe in libuv on Windows does not properly support
async reading. This means we cannot set the more parameter without likely
causing hangs. Sorry this is yet another followup to #4511.

Fixes #4548
2024-10-03 22:12:22 +02:00
Santiago Gimeno
88b874e63c
win,fs: uv_fs_rmdir() to return ENOENT on file (#4563)
After commit 18266a6969, it changed to return `ENOTDIR`, which makes it
consistent with other platforms but it also can be considered a breaking
change.
2024-10-03 21:29:10 +02:00
Santiago Gimeno
473dafc593
win: fix WriteFile() error translation (#4562)
Translate `ERROR_BROKEN_PIPE` and `ERROR_NO_DATA` to `UV_EPIPE` instead
of their default translation, which will be used for the rest of cases.

Refs: https://github.com/libuv/libuv/issues/4548#issuecomment-2383998849
2024-10-03 18:53:39 +02:00
Rialbat
65e3735320 win: fix pNtQueryDirectoryFile check
Fixed incorrect verification of the pNtQueryDirectoryFile pointer.
2024-10-03 08:59:39 +02:00
Ben Noordhuis
f806be87d3
linux: use IORING_OP_FTRUNCATE when available (#4554)
Route ftruncate() system calls through io_uring instead of the thread
pool when the kernel is new enough to support it (linux >= 6.9).

This commit harmonizes how libuv checks if the kernel is new enough.
Some ops were checking against `uv__kernel_version()` directly while
others stored the result of the version check as a feature flag.

Because the kernel version is cached, and because it is more direct
than a feature flag, I opted for the former approach.
2024-09-30 21:55:34 +02:00
Ben Noordhuis
bcc6d1c1fc
linux: use IORING_SETUP_NO_SQARRAY when available (#4553)
Introduced in Linux 6.6, it tells the kernel to omit the sqarray from
the ring buffer.

Libuv initalizes the array once to an identity mapping and then forgets
about it, so not only does it save a little memory (ca. 1 KiB per ring)
but it also makes things more efficient kernel-side because it removes
a level of indirection.
2024-09-30 19:44:27 +02:00
Ben Noordhuis
675a5a5396
build: add darwin-syscalls.h to release tarball (#4546)
Overlooked in commit 1c778bd0 ("darwin: add udp mmsg support") from
earlier this month.

Fixes: https://github.com/libuv/libuv/issues/4544
2024-09-26 09:45:36 +02:00
Santiago Gimeno
5467ec969a
Now working on version 1.49.1 2024-09-25 10:37:04 +02:00
Santiago Gimeno
511e202e13 Add SHA to ChangeLog 2024-09-25 10:17:21 +02:00
Santiago Gimeno
d2e56a5e8d 2024.09.25, Version 1.49.0 (Stable)
Changes since version 1.48.0:

* test: fix -Wpointer-to-int-cast on 32 bits systems (Ben Noordhuis)

* build: add alias for libuv to CMakeLists.txt (Anthony Alayo)

* linux: create io_uring sqpoll ring lazily (Ben Noordhuis)

* misc: run sample CI when code changes (Jameson Nash)

* linux: fix uv_available_parallelism using cgroup (Thomas Walter)

* doc: fix tty example segfault (hiiizxf)

* udp,unix: fix sendmsg use-after-free (Geddy)

* cygwin: implement uv_resident_set_memory (Farzin Monsef)

* win: almost fix race detecting ESRCH in uv_kill (Santiago Gimeno)

* test: disable env var test under win32+asan (Ben Noordhuis)

* unix,fs: fix realpath calls that use the system allocator (Saúl Ibarra
  Corretgé)

* sunos: sync tcp keep-alive with other unices (Andy Pan)

* linux: fix /proc/self/stat executable name parsing (Farzin Monsef)

* test,ci: fix [AM]San, disable ASLR (Ben Noordhuis)

* win: remove _alloca usage (Ben Noordhuis)

* unix: reinstate preadv/pwritev fallback code (Ben Noordhuis)

* linux: don't delay EPOLL_CTL_DEL operations (Ben Noordhuis)

* doc: fix typos in ChangeLog (tgolang)

* unix,win: error on zero delay tcp keepalive (Saúl Ibarra Corretgé)

* win: simplify uv_once implementation (Saúl Ibarra Corretgé)

* doc: correct udp socket options documentation (Ben Noordhuis)

* linux: don't use sendmmsg() for single datagrams (Ben Noordhuis)

* unix: fix fd leaks in SCM_RIGHTS error path (Ben Noordhuis)

* win: robustify uv_os_getenv() error checking (Ben Noordhuis)

* test: use newer ASSERT_MEM_EQ macro (Ben Noordhuis)

* unix: de-duplicate conditions for using kqueue (Brad King)

* darwin: simplify uv_hrtime (Saúl Ibarra Corretgé)

* mailmap: update saghul's main email address (Saúl Ibarra Corretgé)

* win: remove no longer needed define (Saúl Ibarra Corretgé)

* doc: fix some typos (josedelinux)

* linux,darwin: make `uv_fs_copyfile` behaves like `cp -r` (Juan José
  Arboleda)

* dragonfly: disable SO_REUSEPORT for UDP socket bindings (Andy Pan)

* test: remove the obsolete HAVE_KQUEUE macro (Andy Pan)

* unix: use the presence of SOCK_* instead of OS macros for socketpair
  (Andy Pan)

* bsd: support pipe2() on *BSD (Andy Pan)

* unix: support SO_REUSEPORT with load balancing for TCP (Andy Pan)

* doc: add entries for extended getpw (Juan José Arboleda)

* test: fix the flaky test-tcp-reuseport (Andy Pan)

* aix,ibmi: fix compilation errors in fs_copyfile (Jeffrey H. Johnson)

* unix: support SO_REUSEPORT with load balancing for UDP (Andy Pan)

* tcpkeepalive: distinguish OS versions and use proper time units (Andy
  Pan)

* win: map ERROR_BAD_EXE_FORMAT to UV_EFTYPE (Hüseyin Açacak)

* doc: add instruction how to install with Conan (Uilian Ries)

* unix,win: remove unused req parameter from macros (Viacheslav
  Muravyev)

* build: fix android ci build (Ben Noordhuis)

* unix,win: export wtf8 functions properly (Ben Noordhuis)

* hurd: add includes and macro prerequisites (Olivier Valentin)

* hurd: stub uv_thread_setpriority() (Olivier Valentin)

* ci: use macOS 12 for macOS and iOS builds (Saúl Ibarra Corretgé)

* darwin: fix crash on iOS(arm64) (郑苏波 (Super Zheng))

* Create dependabot.yml for updating github-actions (Jameson Nash)

* doc: correct names of Win32 APIs in fs.rst (zeertzjq)

* ci: bump upload and download-artifact versions (dependabot[bot])

* ci: bump actions/setup-python from 4 to 5 (dependabot[bot])

* ci: bump KyleMayes/install-llvm-action from 1 to 2 (dependabot[bot])

* win,error: remap ERROR_NO_DATA to EAGAIN (Jameson Nash)

* test: handle zero-length udp datagram (Ben Noordhuis)

* misc: remove splay trees macros (Viacheslav Muravyev)

* test,openbsd: remove superfluous ifdef guard (Ben Noordhuis)

* win,fs: use posix delete semantics, if supported (Ian Butterworth)

* win: fix env var in uv_os_homedir and uv_os_tmpdir (Hüseyin Açacak)

* fsevents: detect watched directory removal (Santiago Gimeno)

* ci: bump actions/checkout to 4 (dependabot[bot])

* linux: eliminate a read on eventfd per wakeup (Andy Pan)

* test: pipe_overlong_path handle ENAMETOOLONG (Abdirahim Musse)

* win,fs: use the new Windows fast stat API (Hüseyin Açacak)

* win,pipe: fix race with concurrent readers (Jameson Nash)

* win,signal: fix data race dispatching SIGWINCH (Jameson Nash)

* build: ubsan fixes (Matheus Izvekov)

* linux: disable SQPOLL io_uring by default (Santiago Gimeno)

* win: fix fs.c ubsan failure (Matheus Izvekov)

* test: rmdir can return `EEXIST` or `ENOTEMPTY` (Richard Lau)

* test: check for `UV_CHANGE` or `UV_RENAME` event (Richard Lau)

* unix,fs: silence -Wunused-result warning (Santiago Gimeno)

* linux: support abstract unix socket autobinding (Ben Noordhuis)

* kqueue: use EVFILT_USER for async if available (Andy Pan)

* win: remove deprecated GetVersionExW call (Shelley Vohr)

* doc: document uv_loop_option (握猫猫)

* doc: fix the `uv_*_set_data` series of functions (握猫猫)

* doc: properly label enumerations and types (握猫猫)

* doc: document specific macOS fs_event behavior (Santiago Gimeno)

* win,pipe: restore fallback handling for blocking pipes (Jameson Nash)

* unix,win: remove unused rb-tree macro parameters (Viacheslav Muravyev)

* win: compute parallelism from process cpu affinity (Ben Noordhuis)

* win: use NtQueryInformationProcess in uv_os_getppid (Zuohui Yang)

* win,pipe: fix missing assignment to success (Jameson Nash)

* win: fix uv_available_parallelism on win32 (Ben Noordhuis)

* win,pipe: fix another missing assignment to success (Jameson Nash)

* kqueue: disallow ill-suited file descriptor kinds (Andy Pan)

* unix: restore tty attributes on handle close (Ben Noordhuis)

* test: delete test with invalid assumption (Ben Noordhuis)

* dragonflybsd: fix compilation failure (Jeffrey H. Johnson)

* test: run android tests on ci (Edigleysson Silva (Edy))

* darwin: add udp mmsg support (Raihaan Shouhell)

* unix: work around arm-linux-gnueabihf-gcc bug (Ben Noordhuis)

* unix: expand uv_available_parallelism() to support more platforms
  (Ondřej Surý)

* doc: add known issue in armv7 (Santiago Gimeno)
v1.49.0
2024-09-25 10:17:20 +02:00
Santiago Gimeno
cc2e0aa3cf
doc: add known issue in armv7 (#4541)
Refs: https://github.com/libuv/libuv/issues/4532
2024-09-24 21:31:51 +02:00
Ondřej Surý
e1a5465255 unix: expand uv_available_parallelism() to support more platforms 2024-09-24 10:54:48 +02:00
Ben Noordhuis
32603fd5ff
unix: work around arm-linux-gnueabihf-gcc bug (#4537)
Both gcc 11 and 12 emit wrong code for a function call pointer in one
very specific context.

Fixes: https://github.com/libuv/libuv/issues/4532
2024-09-19 19:53:19 +02:00
Raihaan Shouhell
1c778bd001
darwin: add udp mmsg support (#4527) 2024-09-17 23:15:37 +02:00
Edigleysson Silva (Edy)
5bb19f35ea
test: run android tests on ci (#4517) 2024-09-17 21:30:24 +02:00
Jeffrey H. Johnson
88af4a87d2
dragonflybsd: fix compilation failure (#4534)
Fixes: https://github.com/libuv/libuv/issues/4533
Signed-off-by: Jeffrey H. Johnson <trnsz@pobox.com>
2024-09-17 21:27:18 +02:00
Ben Noordhuis
9dddebab0d
test: delete test with invalid assumption (#4530)
Delete the fs_event_error_reporting test. It fails in different ways,
most frequently on the TSan sanitizer buildbot, due to running out of
file descriptors when that is not expected, or vice versa, *not*
running out of file descriptors when that *is* expected.

The test creates a large number of event loops and expects to,
eventually, hit EMFILE but it sometimes hits it too early, and
sometimes not at all.

I don't think TSan is really responsible here, it just makes the
invalid assumption in the test itself more visible.

Fixes: https://github.com/libuv/libuv/issues/4368
2024-09-12 22:19:10 +02:00
Ben Noordhuis
a49f264dff
unix: restore tty attributes on handle close (#4399)
Libuv stores the `struct termios` for use inside uv_tty_reset_mode().

Node.js uses said function to restore the tty to its original mode
on SIGINT or SIGTERM, when there is no opportunity to shut down the
process normally.

Track uv_tty_t handle closing, otherwise we might be trying to use a
stale termios.

The current solution is not ideal because there can be multiple handles
that refer to the same tty/pty and, for various reasons, we can't really
determine when we close the last handle. The last handle may not even be
inside the current process.

Still, all things considered, it's probably (hopefully!) an improvement
over the status quo.

Refs: https://github.com/libuv/libuv/issues/4398
2024-09-11 10:33:54 +02:00
Andy Pan
44e61dab7e
kqueue: disallow ill-suited file descriptor kinds (#4513)
Follows up on https://github.com/libuv/libuv/pull/659.

Signed-off-by: Andy Pan <i@andypan.me>
2024-09-09 20:22:15 +02:00
Jameson Nash
0a00e80c36
win,pipe: fix another missing assignment to success (#4523)
Yet another followup to #4511. The functional/legacy/increment_spec.lua
test failed most of the time without this, and passes consistently with
it. It seemed unexpected this code path gets reached (perhaps imply
that the user wrote zero bytes?), but good to fix of course.
2024-09-05 09:46:37 -04:00
Ben Noordhuis
5ff1fc724f
win: fix uv_available_parallelism on win32 (#4525)
Fixes commit 58dfb6c89b from a few days ago. DWORD_PTR is 32 bits on
x86 Windows. Use the right bit count when checking the population count.

Interestingly enough, it manifested itself as double counting online
processors, presumably because the compiler emits a ROR instead of SHR.

Fixes: https://github.com/libuv/libuv/issues/4524
2024-09-02 11:24:11 +02:00
Jameson Nash
f00d4b6775
win,pipe: fix missing assignment to success (#4515) 2024-08-28 19:59:46 -04:00
Zuohui Yang
5cbc82e369
win: use NtQueryInformationProcess in uv_os_getppid (#4514)
Get parent process ID using NtQueryInformationProcess, it's faster than
using CreateToolhelp32Snapshot.
2024-08-26 20:17:53 +02:00
Ben Noordhuis
58dfb6c89b
win: compute parallelism from process cpu affinity (#4521)
Use GetProcessAffinityMask() to estimate the available parallelism.
Before this commit, it simply used the number of available CPUs.

Fixes: https://github.com/libuv/libuv/issues/4520
2024-08-26 10:22:42 +02:00
Viacheslav Muravyev
b5eb41d882
unix,win: remove unused rb-tree macro parameters (#4518) 2024-08-25 22:54:09 +02:00
Jameson Nash
c869cd1d8a
win,pipe: restore fallback handling for blocking pipes (#4511)
In #4470, I accidentally copied the bug from unix, where calling
uv_stream_set_blocking can cause the whole process to hang on a read.
However, unlike unix, where libuv attempts to set the O_NONBLOCK flag in
uv_pipe_open (as long as the handle never gets passed to uv_spawn), the
NT kernel is not capable of enabling OVERLAPPED operation later (but
fortunately, it also cannot disable it later too).

This implementation might be good to copy to unix (using FIONREAD) to
address the same bug that happens there if the user has called uv_spawn
or uv_stream_set_non_blocking on this handle in the past.
2024-08-22 11:08:08 -04:00
Santiago Gimeno
5cc7175514
doc: document specific macOS fs_event behavior (#4503) 2024-08-17 13:44:37 +02:00
握猫猫
3e1733a053
doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
握猫猫
8809d1df8d
doc: fix the uv_*_set_data series of functions
They have no return value.
2024-08-16 09:13:42 +02:00
握猫猫
1790abb3b2
doc: document uv_loop_option 2024-08-15 11:01:20 +02:00
Shelley Vohr
31d9165999
win: remove deprecated GetVersionExW call (#4486) 2024-08-15 00:47:57 +02:00
Andy Pan
27134547ff kqueue: use EVFILT_USER for async if available
Establishes a user event for kqueue to eliminate the overhead
of the pipe and the system call read(2) per wakeup event.

---------

Signed-off-by: Andy Pan <i@andypan.me>

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
2024-08-13 09:18:24 +02:00