| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting a new read after uv_read_cb returns causes memory corruption on
the OVERLAPPED read_req if uv_read_stop+uv_read_start was called during
the callback after the latest refactoring. This apparently also forces
the kernel to deadlock us, since it apparently cannot cancel the second
read while the first one is pending (reads apparently are not permitted
to finish out of order). Avoid that simply by not issuing another read
(set more=0) if there is already a read pending (from uv_read_start).
There are probably better things we could do here (such as bring back
`uv_active_tcp_streams_threshold`), but the current `alloc_cb` design
may not currently permit that without making breaking changes. We could
also detect in `uv_read_start` that we are inside of of the `read_cb`
for that stream, and defer the actual zero-read until the read_cb
returns, but that would likely be a larger change.
Fix #4738
|
|
|
|
| |
Switch to __sync_fetch_and_or on x86. Libuv already uses it on other
architectures.
|
|
|
|
|
|
|
|
| |
Large-ish functions with many call sites in different translation units
should not be `static inline`, that just results in lots of code
duplication which the linker may or may not deduplicate. When it does,
the linker has to do extra work; when it doesn't, binaries get bigger.
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 7fb43d3c from August 2012 moved uv__atomic_exchange_set from
async.c into a header file but in all those years, nothing except
async.c has ever used it. Move the function back again and remove
the header file.
I removed the superfluous uses of inline/INLINE but this is otherwise
a non-functional change.
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4819
|
|
|
| |
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4755
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
| |
Refs: https://github.com/libuv/libuv/security/advisories/GHSA-qf6p-jg38-9f4x#advisory-comment-131127
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/4710
|
| |
|
|
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/4755
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
| |
Resolves a potential race condition when a child process has been
created between WSASocketW() and SendHandleInformationW().
|
|
|
|
|
|
|
|
|
|
| |
Distinguish between errors and "the console title is the empty string"
when calling GetConsoleTitle. Both are signified by a return value of
zero.
No test because I couldn't think of a succinct way to programmatically
create a new console window with an empty title.
Fixes: https://github.com/nodejs/node/issues/58695
|
| |
|
| |
|
|
|
|
|
| |
Implement `uv_tcp_keepalive_ex` function that extends
`uv_tcp_keepalive` to support `TCP_KEEPINTVL` and `TCP_KEEPCN`
socket options in addition to TCP_KEEPIDLE.
|
|
|
|
|
|
|
|
|
| |
pthread_getschedparam and pthread_setschedparam do not use errno but
instead return the error code directly.
https://pubs.opengroup.org/onlinepubs/9799919799/functions/pthread_getschedparam.html
Also include a fix to return UV_ESRCH instead of UV_EBADF on Windows,
like Unix systems do.
|
|
|
| |
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
| |
Propagate errors from uv__io_init_start() back to the caller.
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
| |
Propagate errors from uv__io_init_start() back to the caller.
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
|
| |
Align CPU quota calculation with Rust's cgroup heuristics.
Fixes: https://github.com/libuv/libuv/issues/4740
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Handle out-of-memory conditions in uv_loop_init better, albeit still
not perfect: bubble up the error instead of aborting.
Also fixes a file descriptor leak on Linux (and likely other platforms)
that the new test caught; the backend epoll fd was being leaked in the
error path.
Fixes: https://github.com/libuv/libuv/issues/4755
|
|
|
|
|
|
|
|
|
|
|
|
| |
Haiku has parallel types to stdint.h, and their APIs use these
types. In the Haiku-specific haiku.h file, it is passing an
address of a uint32_t to get_cpu_topology_info(), that expects
the other uint32:
https://github.com/haiku/haiku/blob/648fa5897c28d5a4c8a5b4992dbf9b9d410434c8/src/system/libroot/os/system_info.cpp#L187
You get an "incompatible-pointer-types" warning in gcc if the
warnings are turned up. But if you pass the pointer to Haiku's
notion of uint32, then the warning goes away.
|
|
|
|
|
|
| |
On some platforms (like GNU/Hurd), `getsockname` returns an empty
string for sockets in the UNIX domain. However, we do have stored the
path info in `pipe_fname` of `uv_pipe_t`, so we can try with it
if `getsockname` returns an empty string.
|
|
|
|
|
|
|
|
|
| |
Use fchmod() on platforms that support it on UNIX sockets. Only fall
back to chmod() on platforms that don't (macOS and the BSDs.)
Remove the stat + chmod dance from the fallback and just call chmod
directly, because that's another source of TOCTOU issues.
Fixes: https://github.com/libuv/libuv/issues/2040
|
|
|
|
|
|
|
|
| |
Solaris implemented pipe2 in 11.4 and illumos have had it since 2013.
Ref:
https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html
https://illumos.org/man/2/pipe2
https://www.illumos.org/issues/3714
|
|
|
|
|
|
|
| |
Documentation on Linux explains that nul bytes have no
special significance in abstract namespace socket names.
Avoid precluding such addresses.
Signed-off-by: Itay Bookstein <ibookstein@gmail.com>
|
|
|
|
|
| |
Rename the `handle` parameter of `timer_close_cb`'s declaration
to `timer` to match the definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Solaris 11.4 has Load Balancing for SO_REUSEPORT, but setting
SO_REUSEADDR disables load balancing. As per comments in
test/test-udp-reuseport.c prefer SO_REUSEPORT when available.
With these changes in place udp-reuseport testing passes. BIND (named),
which uses routing sockets which cause ENOPROTOOPT to be returned when
SO_REUSEPORT is requested, also continues to work with the change.
Notes:
- The use of getsockopt() to query if SO_REUSEPORT was available was
erroneous.
- Selectively limiting SO_REUSEPORT setting to specific types of socket
was considered but not entertained.
- Oracle will investigate if the setting of SO_REUSEADDR was
intentionally meant to prevent load balancing.
- Adding a test for routing sockets is left for future work.
|
|
|
| |
Refs: https://github.com/libuv/libuv/pull/4724
|
|
|
|
|
|
| |
On OpenBSD we do not know the cpuspeed in same cases (mostly arm64)
and the HW_CPUSPEED sysctl will return EOPNOTSUPP in that case,
which can be ignored because we still need the rest of the CPU
information.
|
|
|
|
|
|
| |
Allocate storage upfront, that way we can never run out of memory
halfway through processing the interface list.
Fixes: https://github.com/libuv/libuv/issues/4723
|
|
|
|
|
|
|
|
| |
Solaris provides sendmmsg() as of 11.3.32.
It was added at the same time as MSG_WAITFORONE.
The same is seen in Illumos guarded by __BSD_VISIBLE
Fixes: https://github.com/libuv/libuv/issues/4715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows provides the `ENABLE_VIRTUAL_TERMINAL_INPUT` flag for TTY input
streams as a companion flag to `ENABLE_VIRTUAL_TERMINAL_PROCESSING`,
which libuv is already setting for TTY output streams.
Setting this flag lets the terminal emulator perform some of the
processing that libuv already currently does for input events,
but most notably enables receiving control sequences that are
otherwise entirely unavailable, e.g. for bracketed paste
(which the Node.js readline implementation added basic support for
in https://github.com/nodejs/node/commit/87af913b66eab78088acfd).
libuv currently already provides translations for key events to
control sequences, i.e. what this mode is intended to provide,
but libuv does not and cannot translate all such events.
Since the control sequences differ from the ones that Windows
has chosen to standardize on, and applications may not be expecting
this change, this is opt-in for now (but ideally will be the default
behavior starting in libuv v2.x, should that ever happen).
Another downside of this change is that not all shells reset
this mode when an application exits. For example, when running a
Node.js program with this flag enabled inside of PowerShell in
Windows terminal, if the application exits while in raw TTY input mode,
neither the shell nor the terminal emulator reset this flag, rendering
the input stream unusable.
While there's general awareness of the problem that console state is
global state rather than per-process (same as on UNIX platforms),
it seems that applications like PowerShell aren't expecting to need to
unset this flag on the input stream, only its output counterpart
(e.g. https://github.com/PowerShell/PowerShell/blob/4e7942135f998ab40fd3ae298b020e161a76d4ef/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs#L1156).
Hence, `uv_tty_reset_mode()` is extended to reset the terminal
to its original state if the new mode is being used.
Refs: https://github.com/nodejs/node/commit/87af913b66eab78088acfd7f3b57d35e22c5f1ba
Refs: https://github.com/microsoft/terminal/issues/4954
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend uv_fs_utime, uv_fs_futime and uv_fs_lutime to accept NAN and
INFINITY, with NAN meaning "don't touch the timestamp" and INFINITY
meaning "set to the current timestamp."
Ugly, but it avoids having to add uv_fs_utime2, etc.
UV_FS_UTIME_NOW and UV_FS_UTIME_OMIT constants have been added to make
it more palatable.
Fixes: https://github.com/libuv/libuv/issues/4665
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/4706
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
On macOS, when calling `spawn`, the child process's stdio buffer
size is 8192 bytes. This is due to the AF_UNIX socket buffer size
being 8192 bytes in the XNU kernel.
When large amounts of data are transferred through the child
process's stdio, this buffer size can cause performance issues.
To mitigate this, the buffer size has been increased to 65536
bytes, aligning it with the behavior on Linux.
|
| |
|
|
|
| |
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
|
|
|
|
|
|
|
|
| |
The CreateProcess API on Windows is still not longPathAware,
even if the process itself is. So, if the cwd used for CreateProcess
is too long, then the call fails with a 'INVALID_DIRECTORY' error.
To deal with this, check the length of the cwd and shorten it if it
is longer than MAX_PATH.
|
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/4678
Refs: https://github.com/libuv/libuv/issues/4532
|
|
|
|
|
|
|
| |
Said symbols are not by default available on Windows Server 2016 but
libuv can still use them when
api-ms-win-core-processthreads-l1-1-3.dll is present.
Fixes: https://github.com/libuv/libuv/issues/4677
|
|
|
|
| |
Fixes: https://github.com/libuv/libuv/issues/4680
|
|
|
|
|
|
| |
Refs: https://github.com/libuv/libuv/issues/3119
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
|