aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* qnx: add qnx 8 support (#4801)Deep C6 days
| | | Fixes: https://github.com/libuv/libuv/issues/4710
* win: replace GetModuleHandleA with GetModuleHandleW (#4812)chemodax7 days
|
* tcp: support customizing TCP_KEEPINTVL and TCP_KEEPCNTAndy Pan2025-05-21
| | | | | 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.
* unix: fix uv_thread_{get,set}priority error codes (#4782)Ryan Liptak2025-05-15
| | | | | | | | | 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.
* test: remove unused include of <limits.h> in runner.h (#4780)Juan José2025-05-10
| | | Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* test: skip `udp_multicast_join` if not system-wide available (#4779)Juan José2025-05-08
| | | | | Fixes: https://github.com/libuv/libuv/issues/4778 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* test: skip multievent tests on macOS with TSAN enabled (#4763)Juan José2025-04-22
| | | | Fixes: https://github.com/libuv/libuv/issues/4659 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* test: merge uv_tcp_connect callbacks (#4761)Juan José2025-04-20
| | | | | | Distinguish a callback for v4 and v6 connections is not relevant for this test. Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* unix: improve uv_loop_init OOM handling (#4757)Ben Noordhuis2025-04-18
| | | | | | | | | | 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
* linux: allow nul bytes in abstract socket address (#4737)Itay Bookstein2025-03-27
| | | | | | | 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>
* test: support partial output lines in test runner (#4744)Colin Ihrig2025-03-24
| | | | This commit updates the test runner's print_lines() logic to better handle partial lines.
* test: skip thread_name_threadpool on AIX/IBMi (#4731)Abdirahim Musse2025-03-03
| | | | | uv_thread_getname is not available on aix and ibm i Same issue as thread_name test Refs: https://github.com/libuv/libuv/pull/4599#issuecomment-2498376606
* test: handle UV_ENOTSUP in platform_output (#4714)Colin Ihrig2025-02-25
| | | Fixes: https://github.com/libuv/libuv/issues/4713
* win: add ENABLE_VIRTUAL_TERMINAL_INPUT raw tty mode (#4688)Anna Henningsen2025-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* unix,win: accept NAN/INFINITY as file timestamps (#4702)Ben Noordhuis2025-02-21
| | | | | | | | | | | | 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
* win: fix the inconsistency in volume serial numberHüseyin Açacak2025-02-17
|
* misc: implement uv_getrusage_thread (#4666)Juan José2025-01-14
| | | | | | 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>
* src: set a default thread name for workers (#4664)Rafael Gonzaga2025-01-08
|
* test: fix udp-multicast-join for FreeBSD (#4655)Juan José2024-12-16
| | | | | Fixes: https://github.com/libuv/libuv/issues/4651 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* build: enable fdsan in AndroidJuan José Arboleda2024-12-16
| | | | | | | | This patch will update Android API in CI to 29 and will set up the fdsan in the test runner. Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com> Fixes: https://github.com/libuv/libuv/issues/4369
* test: fix flaky flaky udp_mmsg test (#4652)Juan José2024-12-15
| | | | | | | Replace comparison of `alloc_cb_called` with the total bytes read (`bytes_read`) to validate the test's correctness. Fixes: https://github.com/libuv/libuv/issues/4650 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* unix,win: add uv_udp_try_send2Ben Noordhuis2024-12-13
| | | | | | | | | Add a version of uv_udp_try_send that can send multiple datagrams. Uses sendmmsg(2) on platforms that support it (Linux, FreeBSD, macOS), falls back to a regular sendmsg(2) loop elsewhere. This work was sponsored by ISC, the Internet Systems Consortium.
* test: address FreeBSD kernel bug causing NULL path in fsevents (#4649)Juan José2024-12-13
| | | | | | | | | | | This commit documents a FreeBSD kernel issue where uv_fs_event can receive a NULL filename and updates test-fs-event.c to skip filename assertions on FreeBSD. * Bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197695 Refs: https://github.com/libuv/libuv/issues/4606 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* win,fs: get (most) fstat when no permission (#4566)Jameson Nash2024-12-12
| | | | | | | Replaces: https://github.com/libuv/libuv/pull/4504 Fixes: https://github.com/libuv/libuv/issues/1980 Fixes: https://github.com/libuv/libuv/issues/3267 Co-authored-by: Hüseyin Açacak <huseyin@janeasystems.com>
* win: drop support for the legacy MinGW (#4645)Saúl Ibarra Corretgé2024-12-12
| | | The OG MinGW has been dead for years, MinGW-w64 has taken its place.
* fixup!Saúl Ibarra Corretgé2024-12-12
|
* unix,win: handle nbufs=0 in uv_udp_try_send (#4641)Ben Noordhuis2024-12-09
|
* src: add uv_thread_set/getname() methods (#4599)Santiago Gimeno2024-11-27
| | | | | | | | | | | | | `uv_thread_setname()` sets the name of the current thread. Different platforms define different limits on the max number of characters a thread name can be: Linux, IBMi (16), macOS (64), Windows (32767), and NetBSD (32), etc. `uv_thread_setname()` will truncate it in case `name` is larger than the limit of the platform. `uv_thread_getname()` gets the name of the thread specified by `tid`. The thread name is copied into the buffer pointed to by `name`. The `size` parameter specifies the size of the buffer pointed to by `name`. The buffer should be large enough to hold the name of the thread plus the trailing NUL, or it will be truncated to fit.
* unix,win: add support for detached threads (#4621)Juan José2024-11-26
| | | | | | This commit introduces the `uv_thread_detach` for thread detaching, allowing threads to be detached state on both UNIX and Windows platforms. Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
* unix,win: harmonize buffer checkingSaúl Ibarra Corretgé2024-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For any API that takes a buffer and size pointer, check both pointers and the pointed-to size and return UV_EINVAL in case of error. Example: ``` int uv_foo(char* buffer, size_t* size) { if (buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; ... } ``` In order to "peek" the necessary size for dynamic allocation, the following pattern can be used: ``` char *buf; char scratch[1]; size_t len = sizeof(scratch); int r; r = uv_foo(scratch, &len); assert(r == UV_ENOBUFS); buf = malloc(len); r = uv_foo(buf, &len); ... ```
* unix,pipe: fix handling null buffer in uv_pipe_get{sock,peer}nameSaúl Ibarra Corretgé2024-11-22
| | | | Fixes: https://github.com/libuv/libuv/issues/4610
* build(deps): bump actions/checkout from 3 to 4 (#4490)dependabot[bot]2024-11-21
| | | | | | | | | | | Requires updating the android builder, since the arm emulator is deprecated and unavailable now. Switch to using a Github Action plugin instead of a container, so that hopefully future updates will be delivered via that channel instead. Changed the idna test since printf returns EILSEQ for some byte sequences in the format on Android in glibc. We don't fully understand the cause, but we can avoid that by not asking it to reencode the bytes in the current locale settings.
* unix,win: fix off-by-one in uv_wtf8_to_utf16() (#4609)Ben Noordhuis2024-11-19
| | | | | | | uv_wtf8_length_as_utf16() checks if codepoints are > 0xFFFF (to see if it should be encoded as a surrogate pair), therefore uv_wtf8_to_utf16() should too. Instead it checked > 0x1000. Harmonize the checks. Fixes: https://github.com/nodejs/node/issues/55914
* darwin,test: squelch EBUSY error on multicast joinSaúl Ibarra Corretgé2024-10-22
| | | | | The firewall was suspected to be the culprit, but the test intermittently fails in the CI, not locally.
* test: skip multicast join test on ENOEXECSaúl Ibarra Corretgé2024-10-22
| | | | | | | | | It happens due to the default firewall configuration on macOS >= 13. Note: GH action runners have their firewall disabled, and yet, the test fails all the same. Oh well... Closes: https://github.com/libuv/libuv/issues/4263
* win: remap ERROR_NOACCESS and ERROR_BUFFER_OVERFLOW (#4567)Jameson Nash2024-10-17
| | | | | | | 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.
* win,fs: remove trailing slash in junctionsHüseyin Açacak2024-10-15
| | | | Fixes: https://github.com/libuv/libuv/issues/3329
* win,fs: fix bug in fs__readdirHüseyin Açacak2024-10-04
|
* win,fs: uv_fs_rmdir() to return ENOENT on file (#4563)Santiago Gimeno2024-10-03
| | | | | After commit 18266a6969, it changed to return `ENOTDIR`, which makes it consistent with other platforms but it also can be considered a breaking change.
* test: run android tests on ci (#4517)Edigleysson Silva (Edy)2024-09-17
|
* test: delete test with invalid assumption (#4530)Ben Noordhuis2024-09-12
| | | | | | | | | | | | | | | 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
* kqueue: disallow ill-suited file descriptor kinds (#4513)Andy Pan2024-09-09
| | | | | Follows up on https://github.com/libuv/libuv/pull/659. Signed-off-by: Andy Pan <i@andypan.me>
* linux: support abstract unix socket autobinding (#4499)Ben Noordhuis2024-08-10
| | | | | | | | | | | | | 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
* test: check for `UV_CHANGE` or `UV_RENAME` eventRichard Lau2024-08-08
| | | | | All other checks for `UV_RENAME` in `test-fs-event` also allow `UV_CHANGE`.
* test: rmdir can return `EEXIST` or `ENOTEMPTY`Richard Lau2024-08-08
| | | | | POSIX allows `rmdir` to return `EEXIST` or `ENOTEMPTY` for a non-empty directory, so the test needs to allow both.
* build: ubsan fixes (#4254)Matheus Izvekov2024-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* test: pipe_overlong_path handle ENAMETOOLONGAbdirahim Musse2024-07-30
|
* fsevents: detect watched directory removal (#4376)Santiago Gimeno2024-07-30
| | | Which was broken both in `windows` and `macos`.
* win: fix env var in uv_os_homedir and uv_os_tmpdir (#4464)Hüseyin Açacak2024-07-29
| | | | | | | | | | | | If the corresponding environment variables are empty, the uv_us_homedir() and uv_os_tmpdir() return garbage values. The reason for this situation is the Windows API which doesn't return an error even if the path is empty. This PR fixes this problem by checking the return value of the API call. If it is not an error and the length of the value is less than 3, uv_us_homedir() and uv_os_tmpdir() will return UV_ENOENT. Fixes: https://github.com/libuv/libuv/issues/2328
* win,fs: use posix delete semantics, if supported (#4318)Ian Butterworth2024-07-29
| | | | | | Implements posix delete for files and dirs, with fallback to the old method if not supported (e.g. Fat32 or Win8). Fixes: #3839