0a00e80c | 05-Sep-2024 |
Jameson Nash |
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
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.
show more ...
|
5ff1fc72 | 02-Sep-2024 |
Ben Noordhuis |
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
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
show more ...
|
f00d4b67 | 28-Aug-2024 |
Jameson Nash |
win,pipe: fix missing assignment to success (#4515) |
5cbc82e3 | 26-Aug-2024 |
Zuohui Yang <274048862@qq.com> |
win: use NtQueryInformationProcess in uv_os_getppid (#4514) Get parent process ID using NtQueryInformationProcess, it's faster than using CreateToolhelp32Snapshot. |
58dfb6c8 | 26-Aug-2024 |
Ben Noordhuis |
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
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
show more ...
|
b5eb41d8 | 25-Aug-2024 |
Viacheslav Muravyev |
unix,win: remove unused rb-tree macro parameters (#4518) |
c869cd1d | 22-Aug-2024 |
Jameson Nash |
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
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.
show more ...
|
5cc71755 | 17-Aug-2024 |
Santiago Gimeno |
doc: document specific macOS fs_event behavior (#4503) |
3e1733a0 | 16-Aug-2024 |
握猫猫 <164346864@qq.com> |
doc: properly label enumerations and types (#4506) |
8809d1df | 16-Aug-2024 |
握猫猫 <164346864@qq.com> |
doc: fix the `uv_*_set_data` series of functions They have no return value. |
1790abb3 | 15-Aug-2024 |
握猫猫 <164346864@qq.com> |
doc: document uv_loop_option |
31d91659 | 14-Aug-2024 |
Shelley Vohr |
win: remove deprecated GetVersionExW call (#4486) |
27134547 | 18-Feb-2024 |
Andy Pan |
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. ---------
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>
show more ...
|
1eac3310 | 10-Aug-2024 |
Ben Noordhuis |
linux: support abstract unix socket autobinding (#4499) Autobinding is a feature that lets the kernel pick a name for the abstract socket, instead of userspace having to provide one.
linux: support abstract unix socket autobinding (#4499) Autobinding is a feature that lets the kernel pick a name for the abstract socket, instead of userspace having to provide one. Two bugs that this change exposed are also fixed: 1. strlen(sa.sun_path) can read past the end if the file path is exactly sizeof(sa.sun_path) long (use memchr instead), and 2. don't return UV_ENOBUFS for abstract sockets when the buffer is exactly large enough to hold the result; per commit e5f4b79809, abstract socket names are not zero-terminated
show more ...
|
a53e7877 | 10-Aug-2024 |
Santiago Gimeno |
unix,fs: silence -Wunused-result warning (#4496) |
c84a2dbe | 07-Aug-2024 |
Richard Lau |
test: check for `UV_CHANGE` or `UV_RENAME` event All other checks for `UV_RENAME` in `test-fs-event` also allow `UV_CHANGE`. |
88ab6e78 | 07-Aug-2024 |
Richard Lau |
test: rmdir can return `EEXIST` or `ENOTEMPTY` POSIX allows `rmdir` to return `EEXIST` or `ENOTEMPTY` for a non-empty directory, so the test needs to allow both. |
5537d6a6 | 07-Aug-2024 |
Matheus Izvekov |
win: fix fs.c ubsan failure (#4491) Refactor / cleanup arithmetic for unix -> win filetime conversion in order to avoid multiplication overflow. Fixes: ``` src/win/fs.c:
win: fix fs.c ubsan failure (#4491) Refactor / cleanup arithmetic for unix -> win filetime conversion in order to avoid multiplication overflow. Fixes: ``` src/win/fs.c:106:48: runtime error: signed integer overflow: 1702781567 * 10 cannot be represented in type 'long' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/fs.c:106:48 in ``` Co-authored-by: Jameson Nash <vtjnash@gmail.com>
show more ...
|
e78e29c2 | 06-Aug-2024 |
Santiago Gimeno |
linux: disable SQPOLL io_uring by default (#4492) The SQPOLL io_uring instance wasn't providing consistent behaviour to users depending on kernel versions, load shape, ... creating issue
linux: disable SQPOLL io_uring by default (#4492) The SQPOLL io_uring instance wasn't providing consistent behaviour to users depending on kernel versions, load shape, ... creating issues difficult to track and fix. Don't use this ring by default but allow enabling it by calling `uv_loop_configure()` with `UV_LOOP_ENABLE_IO_URING_SQPOLL`.
show more ...
|
9b3b61f6 | 05-Aug-2024 |
Matheus Izvekov |
build: ubsan fixes (#4254) MSVC does not actually support ubsan. There is a long-standing ticket requesting this: https://developercommunity.visualstudio.com/t/add-support-for-ubsan/
build: ubsan fixes (#4254) MSVC does not actually support ubsan. There is a long-standing ticket requesting this: https://developercommunity.visualstudio.com/t/add-support-for-ubsan/840750 There are no known compilers that currently accept the `/fsanitize=undefined` spelling. clang-cl accepts `-fsanitize...`, same as regular clang. Also passes no-sanitizer-recover so that tests actually fail. Fix various ubsan-detected errors, including: * win: fix req-inl.h ubsan failure Don't use CONTAINING_RECORD macro from WinSDK, as it doesn't use the right trick which avoids member access on null pointer. Fixes: ``` src/win/req-inl.h:86:10: runtime error: member access within null pointer of type 'uv_req_t' (aka 'struct uv_req_s') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior D:/a/libuv/libuv/src/win/req-inl.h:86:10 ``` * test: fix ubsan failure on udp_ref3 Don't call functions through different function type. Fixes: ``` src/win/udp.c:537:5: runtime error: call to function req_cb through pointer to incorrect function type 'void (*)(struct uv_udp_send_s *, int)' test\test-ref.c:66: note: req_cb defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/udp.c:537:5 in ``` * win: fix process-stdio.c ubsan failure When accessing HANDLEs within the stdio buffer, use memcpy / memset in order to respect alignment. Fixes: ``` src/win/process-stdio.c:197:5: runtime error: store to misaligned address 0x0230ee72d107 for type 'HANDLE' (aka 'void *'), which requires 8 byte alignment 0x0230ee72d107: note: pointer points here 00 00 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd fd fd fd fd ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/process-stdio.c:197:5 in ``` * win: fix getaddrinfo.c ubsan failure Reworks buffer alignment handling to respect requirements. Fixes: ``` src/win/getaddrinfo.c:157:23: runtime error: member access within misaligned address 0x0290e4c6a17c for type 'struct addrinfo', which requires 8 byte alignment 0x0290e4c6a17c: note: pointer points here 00 00 00 00 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/getaddrinfo.c:157:23 in ``` * win: fix pipe.c ubsan failure Changes "random" representation from pointer to number. Fixes: ``` src/win/pipe.c:234:11: runtime error: applying non-zero offset to non-null pointer 0xffffffffffffffff produced null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/pipe.c:234:11 in ``` * unix: fix stream.c ubsan failure Avoids performing pointer arithmetic on null pointer. Fixes: ``` src/unix/stream.c:701:15: runtime error: applying zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/libuv/libuv/src/unix/stream.c:701:15 in ```
show more ...
|
a6a987c0 | 05-Aug-2024 |
Jameson Nash |
win,signal: fix data race dispatching SIGWINCH (#4488) The Event should be reset before reading the value, or libuv might miss an update that occurred too rapidly after the previously on
win,signal: fix data race dispatching SIGWINCH (#4488) The Event should be reset before reading the value, or libuv might miss an update that occurred too rapidly after the previously one. Refs: https://github.com/libuv/libuv/pull/2381 Refs: https://github.com/libuv/libuv/discussions/4485
show more ...
|
727ee723 | 02-Aug-2024 |
Jameson Nash |
win,pipe: fix race with concurrent readers (#4470) This fixes a race condition if multiple threads are reading from the same NamedPipe, which could previously lead to a deadlock situatio
win,pipe: fix race with concurrent readers (#4470) This fixes a race condition if multiple threads are reading from the same NamedPipe, which could previously lead to a deadlock situation. We also substantially improve performance now also, since the PeekFile call is unnecessary overhead with this change. This API was added in Windows Vista. Related to #4467, though doesn't address any of the problems there. I believe that someone could now implement uv__pipe_try_write using this same code pattern however.
show more ...
|
4e310d0f | 30-Jul-2024 |
Hüseyin Açacak <110401522+huseyinacacak-janea@users.noreply.github.com> |
win,fs: use the new Windows fast stat API (#4327) Windows added a new API for file information, which doesn't have to open the file thus greatly improving performance: https://learn.
win,fs: use the new Windows fast stat API (#4327) Windows added a new API for file information, which doesn't have to open the file thus greatly improving performance: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyname The stat functions are already covered by tests, so no test was added here. I considered comparing the result of old and new code, but that would require exposing internal fs functions, and we would be testing Windows functionality, not libuv.
show more ...
|
f23037fe | 30-Jul-2024 |
Abdirahim Musse <33973272+abmusse@users.noreply.github.com> |
test: pipe_overlong_path handle ENAMETOOLONG |
e5cb1d3d | 29-Jul-2024 |
Andy Pan |
linux: eliminate a read on eventfd per wakeup (#4400) Register the eventfd with EPOLLET to enable edge-triggered notification where we're able to eliminate the overhead of reading the ev
linux: eliminate a read on eventfd per wakeup (#4400) Register the eventfd with EPOLLET to enable edge-triggered notification where we're able to eliminate the overhead of reading the eventfd via system call on each wakeup event. When the eventfd counter reaches the maximum value of the unsigned 64-bit, which may not happen for the entire lifetime of the process, we rewind the counter and retry. This optimization saves one system call on each event-loop wakeup, eliminating the overhead of read(2) as well as the extra latency for each epoll wakeup.
show more ...
|