Commit Graph

5230 Commits

Author SHA1 Message Date
Pleuvens
011a1ac1a3
test: switch to new-style ASSERT_EQ macros (#4159)
Switch from old-style ASSERT macro to new-style ASSERT_EQ,... macros.

Using new-style macros makes it easier to debug test failures

Fixes: https://github.com/libuv/libuv/issues/2974
2023-10-06 19:50:15 +02:00
Ben Noordhuis
56fada47f2
src: default to stream=stderr in handle printer (#4161)
Make printing handles from gdb a little easier because it doesn't always
know how to locate the stdout or stderr globals from libc.

With this commit `call uv_print_all_handles(0, 0)` prints the handles
from the default loop to stderr.
2023-10-03 13:30:16 +02:00
Ben Noordhuis
737f4f953f darwin: remove workaround for data corruption bug
XNU kernels anno ~2010 had a data corrruption bug where concurrent
write and pwrite calls sometimes resulted in blocks of zeroes being
written instead of the actual data.

Libuv works around that by serializing all writes with a process-wide
mutex, meaning oncurrent writes (for all files, not just single files)
have a concurrency of 1. Obviously that's not great for performance.

Modern day macOS no longer has this bug, so remove the workaround.
2023-10-03 13:09:40 +02:00
Ben Noordhuis
fef619608b unix: remove pwrite/pwritev conditionals 2023-10-03 13:09:40 +02:00
Ben Noordhuis
663d88b677 unix: remove pread/preadv conditionals 2023-10-03 13:09:40 +02:00
Jameson Nash
c03569f0df
win,process: avoid assert after spawning Store app (#4152)
Make sure this handle is functional. The Windows kernel seems to have a
bug that if the first use of AssignProcessToJobObject is for a Windows
Store program, subsequent attempts to use the handle with fail with
INVALID_PARAMETER (87). This is possilby because all uses of the handle
must be for the same Terminal Services session. We can ensure it is
tied to our current session now by adding ourself to it. We could
remove ourself afterwards, but there doesn't seem to be a reason to.

Secondly, we start the process suspended so that we can make sure we
added it to the job control object before it does anything itself (such
as launch more jobs or exit).

Fixes: https://github.com/JuliaLang/julia/issues/51461
2023-10-02 15:15:18 +02:00
SmorkalovG
2a4cab70ef
unix: reset signal counters after fork (#3485)
If a signal was received but was not dispatched before fork then
caught_signals counter should be reset. Closing of signal pipe makes
impossible to receive the signal that was counted.
There is no need in this signal because it was sent to parent process

Fixes: https://github.com/libuv/libuv/issues/3483
2023-09-29 12:54:35 +02:00
Abdirahim Musse
d83fadaf09
ibmi: implement ifaddrs, getifaddrs, freeifaddrs (#4155)
Add PASE implementation of ifaddrs, getifaddrs, freeifaddrs.

Refs: https://github.com/libuv/libuv/issues/4117
2023-09-28 21:16:11 +02:00
Santiago Gimeno
d277f71333
test: skip tests when ipv6 is not available (#4151) 2023-09-26 21:55:32 +02:00
Santiago Gimeno
c811169f91
unix: disable io_uring close on selected kernels (#4141)
Specifically on non-longterm kernels between 5.16.0 (non-longterm) and
6.1.0 (longterm). Starting with longterm 6.1.0, the issue is solved.
2023-09-17 22:09:00 +02:00
Santiago Gimeno
4e416266f6
build: fix qemu install in CI-unix workflow (#4142)
The version of the deb package has changed to 7.2.
2023-09-17 21:18:50 +02:00
Ben Noordhuis
0d78f3c758 unix: get mainline kernel version in Debian (#4131)
In Debian, the mainline kernel version is reported via the `uname()`
`version` field.
2023-09-01 11:24:26 +02:00
Santiago Gimeno
e2c8fed7b3 unix: get mainline kernel version in Ubuntu (#4131)
In Ubuntu, the kernel version reported by `uname()` follows the
versioning format that Ubuntu uses for their kernels which does not have
a direct correspondence with the mainline kernel version they're based
on. Get that version from `/proc/version_signature` as documented in:

https://wiki.ubuntu.com/Kernel/FAQ#Kernel.2FFAQ.2FGeneralVersionRunning.How_can_we_determine_the_version_of_the_running_kernel.3F
2023-09-01 11:24:26 +02:00
Alois Klink
0a02887e62
doc: fix broken "Shared library" Wikipedia link (#4128)
`linkcheck` is printing the following error:

```
( guide/utilities: line  311) broken    https://en.wikipedia.org/wiki/Shared_library#Shared_libraries - Anchor 'Shared_libraries' not found
```
2023-08-28 12:41:40 -04:00
michalbiesek
65dc822d6c
linux: add missing riscv syscall numbers (#4127)
Signed-off-by: Michal Biesek <michalbiesek@gmail.com>
2023-08-25 21:41:56 +02:00
Brad King
b3759772d2
win,fs: avoid winapi macro redefinition (#4123)
Adjust include order to avoid redefining `CTL_CODE`, `FILE_READ_ACCESS`,
and `FILE_WRITE_ACCESS`.  Without this, compilation shows:

```
...\um\winioctl.h(273): warning C4005: 'CTL_CODE': macro redefinition
...\src\win\winapi.h(4497): note: see previous definition of 'CTL_CODE'

...\um\winioctl.h(320): warning C4005: 'FILE_READ_ACCESS': macro redefinition
...\src\win\winapi.h(4488): note: see previous definition of 'FILE_READ_ACCESS'

...\um\winioctl.h(321): warning C4005: 'FILE_WRITE_ACCESS': macro redefinition
...\src\win\winapi.h(4492): note: see previous definition of 'FILE_WRITE_ACCESS'
```
2023-08-19 12:17:16 +02:00
小明
65541f772f
darwin: make TCP_KEEPINTVL and TCP_KEEPCNT available (#3908)
In earlier versions, macOS only defined TCP_KEEPALIVE, but since macOS
10.8 (Mountain Lion), it has supported TCP_KEEPINTVL and TCP_KEEPCNT.

https://lists.apple.com/archives/macnetworkprog/2012/Jul/msg00005.html
2023-08-14 15:33:12 -04:00
Saúl Ibarra Corretgé
1b4bd9209e
doc: switch to Furo, a more modern Sphinx theme (#4094) 2023-08-14 15:27:18 -04:00
Kyle Edwards
c97017dd1d
win,spawn: allow %PATH% to be unset (#4116)
Fix: https://github.com/libuv/libuv/issues/4115
2023-08-14 15:25:11 -04:00
Trevor Norris
2f82750098
unix: match kqueue and epoll code (#4091)
Match the implementation for linux.c to kqueue.c in the code around the
calls to kevent and epoll.

In linux.c the code was made more DRY by moving the nfds check up
(including a comment of why it's possible) and combining two if checks
into one.

In kqueue.c the assert to check the timeout when nfds == 0 has been
moved to be called directly after the EINTR check. Since it should
always be true regardless.

Ref: https://github.com/libuv/libuv/pull/3893
Ref: https://github.com/nodejs/node/issues/48490
2023-08-04 14:10:53 -06:00
Ben Noordhuis
e893cd6826
unix: set ipv6 scope id for link-local addresses (#4107)
Link-local addresses (prefix fe80::/64) don't route unless you specify
the network interface to use so make libuv do that.

Fixes: https://github.com/nodejs/node/issues/48846
2023-08-03 22:18:50 +02:00
Keith Winstein
124d55c970
build: move cmake_minimum_required version to 3.9 (#4111)
CMake 3.27 warns that "Compatibility with CMake < 3.5 will be removed
from a future version of CMake."
(https://cmake.org/cmake/help/latest/release/3.27.html#deprecated-and-removed-features)
2023-08-01 17:30:20 -04:00
Ben Noordhuis
30c3ef9f6f
linux: handle UNAME26 personality (#4109) 2023-07-31 23:40:59 +02:00
Ben Noordhuis
55376b044b
test: enable disabled spawn_same_stdout_stderr (#4105)
This test was added in commit e403a2c486 from 2014 but its author forgot
to enable it.
2023-07-25 16:48:22 +02:00
Ben Noordhuis
9c1de6e93f
test: enable disabled fs_link (#4104)
This test was added in commit 060026ced from 2011 but its author forgot
to actually enable it.
2023-07-25 16:48:04 +02:00
Ben Noordhuis
49d83c0301
test: enable disabled tcp_connect6_error_fault (#4103)
The test was added in commit e3f2631127 from 2011 but it appears the
author forgot to add it to the test list.

The other test from that commit was enabled by yours truly in 2012 in
7447048981 but apparently I overlooked the second test as well.
2023-07-25 15:58:08 +02:00
Jameson Nash
d09441ca03
fs: fix WTF-8 decoding issue (#4092)
We forgot to mask off the high bits from the first byte, so we ended up
always failing the subsequent range check.

Refs: #2970
Fixes: https://github.com/nodejs/node/issues/48673
2023-07-13 12:22:07 -04:00
Ben Noordhuis
50b53cbd0d
linux: don't use io_uring on pre-5.10.186 kernels (#4093)
Those kernels have a known resource consumption bug where the sqpoll
thread busy-loops.

Fixes: https://github.com/libuv/libuv/issues/4089
2023-07-12 23:33:49 +02:00
小明
1230fad8f4
darwin: fix build warnings (#4073) 2023-07-12 23:03:36 +02:00
Shuduo Sang
a939d643dd
linux: fix harmless warn_unused_result warning (#4056) 2023-07-12 23:00:59 +02:00
Ben Noordhuis
2f87d5c114
test: fix license blurb (#4085)
Fixes: https://github.com/libuv/libuv/issues/4080
2023-07-10 10:37:38 +02:00
Santiago Gimeno
c5644368b5
Now working on version 1.46.1
Fixes: https://github.com/libuv/libuv/issues/4060
2023-06-30 22:58:52 +02:00
Santiago Gimeno
ad523c20c7 Add SHA to ChangeLog 2023-06-30 18:31:51 +00:00
Santiago Gimeno
f0bb7e40f0 2023.06.30, Version 1.46.0 (Stable)
Changes since version 1.45.0:

* Add SHA to ChangeLog (Santiago Gimeno)

* misc: update readthedocs config (Jameson Nash)

* test: remove erroneous RETURN_SKIP (Ben Noordhuis)

* android: disable io_uring support (Ben Noordhuis)

* linux: add some more iouring backed fs ops (Santiago Gimeno)

* build: add autoconf option for disable-maintainer-mode (Jameson Nash)

* fs: use WTF-8 on Windows (Stefan Karpinski)

* unix,win: replace QUEUE with struct uv__queue (Ben Noordhuis)

* linux: fs_read to use io_uring if iovcnt > IOV_MAX (Santiago Gimeno)

* ios: fix uv_getrusage() ru_maxrss calculation (Ben Noordhuis)

* include: update outdated code comment (Ben Noordhuis)

* linux: support abstract unix sockets (Ben Noordhuis)

* unix,win: add UV_PIPE_NO_TRUNCATE flag (Ben Noordhuis)

* unix: add loongarch support (liuxiang88)

* doc: add DPS8M to LINKS.md (Jeffrey H. Johnson)

* include: add EUNATCH errno mapping (Abdirahim Musse)

* src: don't run timers if loop is stopped/unref'd (Trevor Norris)

* win: fix -Wpointer-to-int-cast warning (Ben Noordhuis)

* test,win: fix -Wunused-variable warning (Ben Noordhuis)

* test,win: fix -Wformat warning (Ben Noordhuis)

* linux: work around io_uring IORING_OP_CLOSE bug (Ben Noordhuis)

* win: remove unused functions (Ben Noordhuis)

* bench: add bench to check uv_loop_alive (Trevor Norris)

* test: add uv_cancel test for threadpool (Trevor Norris)

* unix: skip prohibited syscalls on tvOS and watchOS (小明)

* unix,fs: make no_pwritev access thread-safe (Santiago Gimeno)

* unix: fix build for lower versions of Android (小明)
2023-06-30 18:31:51 +00:00
小明
7b43d70be4
unix: fix build for lower versions of Android (#4046)
Available since Android N (API level 24): getgrgid_r, preadv, pwritev

Refs: https://cs.android.com/android/platform/superproject/+/master:bionic/docs/status.md
2023-06-26 13:47:48 +02:00
Santiago Gimeno
c8fad2ac09
unix,fs: make no_pwritev access thread-safe (#4066) 2023-06-23 13:17:37 +02:00
小明
ca544ed6fc
unix: skip prohibited syscalls on tvOS and watchOS (#4043) 2023-06-23 11:09:53 +02:00
Trevor Norris
6df5a72151
test: add uv_cancel test for threadpool (#4065 2/2)
Check that uv_cancel() returns UV_EBUSY when called while the uv_work_cb
is being executed.
2023-06-21 11:31:44 -06:00
Trevor Norris
3e0b846bdb
bench: add bench to check uv_loop_alive (#4065 1/2) 2023-06-21 11:31:25 -06:00
Ben Noordhuis
4b0fe81758
win: remove unused functions (#4063) 2023-06-20 22:30:31 +02:00
Ben Noordhuis
1752791c9e
linux: work around io_uring IORING_OP_CLOSE bug (#4059)
Work around a poorly understood bug in older kernels where closing a
file descriptor pointing to /foo/bar results in ETXTBSY errors when
trying to execve("/foo/bar") later on.

The bug seems to have been fixed somewhere between 5.15.85 and 5.15.90.
I couldn't pinpoint the responsible commit but good candidates are the
several data race fixes.

Interestingly, it seems to manifest only when running under Docker so
the possibility of a Docker bug can't be completely ruled out either.

This commit moves uv__kernel_version() from fs.c to linux.c because the
latter now uses it more than the former.

Fixes: https://github.com/nodejs/node/issues/48444
2023-06-20 13:01:12 +02:00
Ben Noordhuis
2bf97f123f test,win: fix -Wformat warning 2023-06-19 21:41:06 +02:00
Ben Noordhuis
9179888c2b test,win: fix -Wunused-variable warning 2023-06-19 21:41:06 +02:00
Ben Noordhuis
dde50f0e22 win: fix -Wpointer-to-int-cast warning 2023-06-19 21:41:06 +02:00
Trevor Norris
24d1d0802d
src: don't run timers if loop is stopped/unref'd (#4048)
The initial run of timers shouldn't happen if uv_stop() has been run
before uv_run() was called, and for backwards compatibility they also
shouldn't run if they have been unref'd before calling uv_run().
2023-06-16 11:00:06 -06:00
Abdirahim Musse
6a9e4293d8
include: add EUNATCH errno mapping (#4047)
add EUNATCH errno mapping
2023-06-16 09:27:39 -04:00
Jeffrey H. Johnson
4002231bd9
doc: add DPS8M to LINKS.md (#4052) 2023-06-16 10:29:26 +02:00
liuxiang88
7ada448d18
unix: add loongarch support (#4054)
Signed-off-by: liuxiang <liuxiang@loongson.cn>
2023-06-16 10:25:25 +02:00
Ben Noordhuis
2f1614b128
unix,win: add UV_PIPE_NO_TRUNCATE flag (#4040)
Libuv's default behavior is to truncate long Unix socket paths. The flag
tells it to return an error instead.

Fixes: https://github.com/libuv/libuv/issues/4036
2023-06-06 17:08:36 +02:00
Ben Noordhuis
b9b6db052b
linux: support abstract unix sockets (#4030)
Add two new APIs for binding and connecting to abstract UNIX sockets.

Fixes: https://github.com/libuv/libuv/issues/4028
2023-06-04 22:43:14 +02:00