libuv.git
5 days agoNow working on version 1.29.2 v1.x
cjihrig [Tue, 21 May 2019 13:47:22 +0000 (09:47 -0400)]
Now working on version 1.29.2

Fixes: https://github.com/libuv/libuv/issues/2306

5 days agoAdd SHA to ChangeLog
cjihrig [Tue, 21 May 2019 13:44:45 +0000 (09:44 -0400)]
Add SHA to ChangeLog

5 days ago2019.05.22, Version 1.29.1 (Stable) v1.29.1
cjihrig [Tue, 21 May 2019 13:44:45 +0000 (09:44 -0400)]
2019.05.22, Version 1.29.1 (Stable)

Changes since version 1.29.0:

* unix: simplify uv/posix.h include logic (cjihrig)

* test: increase test timeout (cjihrig)

* linux: fix sscanf() overflows reading from /proc (Ben Noordhuis)

5 days agolinux: fix sscanf() overflows reading from /proc
Ben Noordhuis [Tue, 21 May 2019 07:54:28 +0000 (09:54 +0200)]
linux: fix sscanf() overflows reading from /proc

Use `"%" PRIu64` and uint64_t for sscanf-ing large values, not `"%lu"`
and unsigned long. The latter can overflow when libuv is a 32 bits
application running on a 64 bits machine.

Fixes: https://github.com/libuv/libuv/issues/2297
PR-URL: https://github.com/libuv/libuv/pull/2305
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
5 days agotest: increase test timeout 2304/head
cjihrig [Mon, 20 May 2019 16:36:31 +0000 (12:36 -0400)]
test: increase test timeout

The test threadpool_multiple_event_loops has been timing
out consistently on FreeBSD in the CI. This commit attempts
to mitigate the problem by extending the test timeout.

PR-URL: https://github.com/libuv/libuv/pull/2304
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
6 days agounix: simplify uv/posix.h include logic 2302/head
cjihrig [Mon, 20 May 2019 15:06:09 +0000 (11:06 -0400)]
unix: simplify uv/posix.h include logic

This commit includes uv/posix.h in one #elif instead of four.

PR-URL: https://github.com/libuv/libuv/pull/2302
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
11 days agoNow working on 1.29.1
cjihrig [Wed, 15 May 2019 17:16:23 +0000 (13:16 -0400)]
Now working on 1.29.1

Fixes: https://github.com/libuv/libuv/issues/2293

11 days agoAdd SHA to ChangeLog
cjihrig [Wed, 15 May 2019 17:14:17 +0000 (13:14 -0400)]
Add SHA to ChangeLog

11 days ago2019.05.16, Version 1.29.0 (Stable) v1.29.0
cjihrig [Wed, 15 May 2019 17:14:17 +0000 (13:14 -0400)]
2019.05.16, Version 1.29.0 (Stable)

Changes since version 1.28.0:

* ibmi: read memory and CPU usage info (Xu Meng)

* doc: update the cmake testing instruction (zlargon)

* unix: fix race condition in uv_async_send() (Ben Noordhuis)

* linux: use O_CLOEXEC instead of EPOLL_CLOEXEC (Ben Noordhuis)

* doc: mark uv_async_send() as async-signal-safe (Ben Noordhuis)

* linux: init st_flags and st_gen when using statx (Oscar Waddell)

* linux: read free/total memory from /proc/meminfo (Ben Noordhuis)

* test: test zero-sized uv_fs_sendfile() writes (Ben Noordhuis)

* unix: don't assert on UV_PROCESS_WINDOWS_* flags (Ben Noordhuis)

* linux: set correct mac address for IP-aliases (Santiago Gimeno)

* win,util: fix null pointer dereferencing (Tobias Nießen)

* unix,win: fix `uv_fs_poll_stop()` when active (Anna Henningsen)

* doc: add missing uv_fs_type entries (Michele Caini)

* doc: fix build with sphinx 2.x (FX Coudert)

* unix: don't make statx system call on Android (George Zhao)

* unix: fix clang scan-build warning (Kyle Edwards)

* unix: fall back to kqueue on older macOS systems
  (ken-cunningham-webuse)

* unix,win: add uv_get_constrained_memory() (Kelvin Jin)

* darwin: fix thread cancellation fd leak (Ben Noordhuis)

* linux: fix thread cancellation fd leak (Ben Noordhuis)

11 days agolinux: fix thread cancellation fd leak
Ben Noordhuis [Sat, 4 May 2019 11:46:14 +0000 (13:46 +0200)]
linux: fix thread cancellation fd leak

Same as the previous commit but this time for Linux.

Specifically, the glibc close() wrapper is a cancellation point;
the thread is unwound when close() is called when the thread is
in the "cancel" state.

That's according to spec and therefore arguably less severe than
MacOS's "EINTR without actually closing" behavior but we can avoid
the file descriptor leak altogether by sidestepping glibc and
making the system call directly.

Musl libc is unaffected, its close() wrapper doesn't check
the cancel state.

PR-URL: https://github.com/libuv/libuv/pull/2291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
11 days agodarwin: fix thread cancellation fd leak
Ben Noordhuis [Sat, 4 May 2019 11:46:14 +0000 (13:46 +0200)]
darwin: fix thread cancellation fd leak

The close() system call tests for thread cancellation first. That has
the unfortunate side effect of aborting the sytem call with EINTR
without actually closing the file descriptor when the thread is in
the "cancel" state. Work around that by calling close$NOCANCEL().

This might well qualify as an academic bug because approximately no one
uses thread cancellation but let's aim for correctness anyway.

PR-URL: https://github.com/libuv/libuv/pull/2291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
11 days agounix,win: add uv_get_constrained_memory()
Kelvin Jin [Wed, 1 May 2019 20:54:56 +0000 (13:54 -0700)]
unix,win: add uv_get_constrained_memory()

Fixes: https://github.com/libuv/libuv/issues/2286
PR-URL: https://github.com/libuv/libuv/pull/2289
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
11 days agounix: fall back to kqueue on older macOS systems
ken-cunningham-webuse [Fri, 3 May 2019 22:02:33 +0000 (15:02 -0700)]
unix: fall back to kqueue on older macOS systems

Newer macOS systems (10.7+) use fsevents() for the fs_event backend,
but older macOS systems don't have full functionality for this in
the macOS fsevents() API. Fall back to kqueue for these systems.

PR-URL: https://github.com/libuv/libuv/pull/2290
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
13 days agounix: fix clang scan-build warning
Kyle Edwards [Fri, 11 Jan 2019 20:59:51 +0000 (15:59 -0500)]
unix: fix clang scan-build warning

When building libuv with clang scan-build, an "Assigned value is
garbage or undefined" warning is emitted unless the return value
of open() is verified to be >= 0. This commit fixes the warning.

PR-URL: https://github.com/libuv/libuv/pull/2140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
13 days agounix: don't make statx system call on Android
George Zhao [Fri, 26 Apr 2019 13:18:40 +0000 (21:18 +0800)]
unix: don't make statx system call on Android

Fixes: https://github.com/libuv/libuv/issues/2282
PR-URL: https://github.com/libuv/libuv/pull/2284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
13 days agodoc: fix build with sphinx 2.x
FX Coudert [Tue, 16 Apr 2019 19:48:07 +0000 (21:48 +0200)]
doc: fix build with sphinx 2.x

app.info() was deprecated on Jan 4, 2017 (sphinx-doc/sphinx#3267),
and removed as of Sphinx 2.0.0. This commit removes the usage of
app.info().

PR-URL: https://github.com/libuv/libuv/pull/2265
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
13 days agodoc: add missing uv_fs_type entries
Michele Caini [Wed, 24 Apr 2019 11:23:19 +0000 (13:23 +0200)]
doc: add missing uv_fs_type entries

PR-URL: https://github.com/libuv/libuv/pull/2280
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 weeks agounix,win: fix `uv_fs_poll_stop()` when active
Anna Henningsen [Fri, 3 May 2019 16:33:13 +0000 (18:33 +0200)]
unix,win: fix `uv_fs_poll_stop()` when active

Fix `uv_fs_poll_stop()` for active handles by not attempting to
mark the `uv_fs_poll_t` handle as closing when `uv_close()`
hasn’t been called on it.

Fixes: https://github.com/libuv/libuv/issues/2287
PR-URL: https://github.com/libuv/libuv/pull/2288
Refs: https://github.com/libuv/libuv/pull/1875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 weeks agowin,util: fix null pointer dereferencing
Tobias Nießen [Tue, 16 Apr 2019 17:01:45 +0000 (19:01 +0200)]
win,util: fix null pointer dereferencing

If uv__calloc returns NULL, the function jumps to the error label and
attempts to access array elements of cpu_infos (which is NULL).

PR-URL: https://github.com/libuv/libuv/pull/2264
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 weeks agolinux: set correct mac address for IP-aliases
Santiago Gimeno [Wed, 10 Apr 2019 04:56:03 +0000 (06:56 +0200)]
linux: set correct mac address for IP-aliases

IP-alias format is the interface name followed by a colon and a string
(usually a number). Set the physical address to the one in the 'base'
interface.

PR-URL: https://github.com/libuv/libuv/pull/2248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 weeks agounix: don't assert on UV_PROCESS_WINDOWS_* flags 2278/head
Ben Noordhuis [Tue, 23 Apr 2019 08:36:34 +0000 (10:36 +0200)]
unix: don't assert on UV_PROCESS_WINDOWS_* flags

UV_PROCESS_WINDOWS_HIDE_CONSOLE and UV_PROCESS_WINDOWS_HIDE_GUI were
whitelisted on Windows but not Unices. Now they are.

Bug introduced in commit 4c2dcca27 ("win: support more fine-grained
windows hiding") which I reviewed but where I failed to spot it. Mea
culpa.

Fixes: https://github.com/libuv/libuv/issues/2266
PR-URL: https://github.com/libuv/libuv/pull/2278
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Kyle Edwards <kyle.edwards@kitware.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
4 weeks agotest: test zero-sized uv_fs_sendfile() writes 2279/head
Ben Noordhuis [Tue, 23 Apr 2019 10:34:22 +0000 (12:34 +0200)]
test: test zero-sized uv_fs_sendfile() writes

This was reported as a bug in November 2018 but it appears to be working
now. Add a regression test to ensure it stays that way.

Fixes: https://github.com/libuv/libuv/issues/2076
PR-URL: https://github.com/libuv/libuv/pull/2279
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 weeks agolinux: read free/total memory from /proc/meminfo 2258/head
Ben Noordhuis [Tue, 23 Apr 2019 09:34:04 +0000 (11:34 +0200)]
linux: read free/total memory from /proc/meminfo

It was reported that uv_get_free_memory() and uv_get_total_memory()
report the wrong values inside an lxc container.

Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/meminfo
however is because /proc is a FUSE fs inside the container.

This commit makes libuv try /proc/meminfo first and fall back to
sysinfo(2) in case /proc isn't mounted.

Fixes: https://github.com/libuv/libuv/issues/2249
PR-URL: https://github.com/libuv/libuv/pull/2258
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 weeks agolinux: init st_flags and st_gen when using statx
Oscar Waddell [Tue, 23 Apr 2019 09:26:47 +0000 (11:26 +0200)]
linux: init st_flags and st_gen when using statx

Explicitly initialize uv_stat_t fields st_flags and st_gen when using
statx as uv__to_stat does when statx is not available. This makes
valgrind happier.

PR-URL: https://github.com/libuv/libuv/pull/2263
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
4 weeks agodoc: mark uv_async_send() as async-signal-safe 2273/head
Ben Noordhuis [Mon, 22 Apr 2019 14:05:50 +0000 (16:05 +0200)]
doc: mark uv_async_send() as async-signal-safe

Refs: https://github.com/libuv/libuv/issues/2173
PR-URL: https://github.com/libuv/libuv/pull/2273
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 weeks agolinux: use O_CLOEXEC instead of EPOLL_CLOEXEC 2272/head
Ben Noordhuis [Mon, 22 Apr 2019 13:50:34 +0000 (15:50 +0200)]
linux: use O_CLOEXEC instead of EPOLL_CLOEXEC

It was reported that EPOLL_CLOEXEC is not defined on Android API < 21,
a.k.a. Lollipop. Since EPOLL_CLOEXEC is an alias for O_CLOEXEC on all
architectures, we just use that instead.

Fixes: https://github.com/libuv/libuv/issues/2167
PR-URL: https://github.com/libuv/libuv/pull/2272
Refs: https://github.com/libuv/libuv/pull/2216
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 weeks agounix: fix race condition in uv_async_send() 2231/head
Ben Noordhuis [Tue, 26 Mar 2019 01:06:32 +0000 (02:06 +0100)]
unix: fix race condition in uv_async_send()

After inspection of the code, it seems like there is a race window
between the cmpxchgi() and uv__async_send() calls.

If the event loop thread is already busy looping over the async handles,
it can invoke the callback - which in turn can close the handle - before
the other thread reaches the uv__async_send() call. That's bad because
it accesses the handle that at that point might not be valid anymore.

Fix that by introducing an ad hoc spinlock that blocks the event loop
thread until the sending thread is done. It's not pretty or elegant
but it fixes the immediate bug and appears to have no measurable
impact on the async handle benchmarks.

Fixes: https://github.com/libuv/libuv/issues/2226
PR-URL: https://github.com/libuv/libuv/pull/2231
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
4 weeks agodoc: update the cmake testing instruction
Leon Huang [Wed, 10 Apr 2019 22:00:10 +0000 (18:00 -0400)]
doc: update the cmake testing instruction

PR-URL: https://github.com/libuv/libuv/pull/2253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 weeks agoibmi: read memory and CPU usage info
Xu Meng [Mon, 15 Apr 2019 15:35:34 +0000 (10:35 -0500)]
ibmi: read memory and CPU usage info

PR-URL: https://github.com/libuv/libuv/pull/2261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
5 weeks agoNow working on 1.28.1
cjihrig [Mon, 15 Apr 2019 15:21:31 +0000 (11:21 -0400)]
Now working on 1.28.1

Fixes: https://github.com/libuv/libuv/issues/2228

5 weeks agoAdd SHA to ChangeLog
cjihrig [Mon, 15 Apr 2019 15:19:27 +0000 (11:19 -0400)]
Add SHA to ChangeLog

5 weeks ago2019.04.16, Version 1.28.0 (Stable) v1.28.0
cjihrig [Mon, 15 Apr 2019 15:19:26 +0000 (11:19 -0400)]
2019.04.16, Version 1.28.0 (Stable)

Changes since version 1.27.0:

* unix,win: add uv_gettimeofday() (cjihrig)

* unix,win: add uv_fs_{open,read,close}dir() (cjihrig)

* unix: fix uv_interface_addresses() (Andreas Rohner)

* fs: remove macOS-specific copyfile(3) (Rich Trott)

* fs: add test for copyfile() respecting permissions (Rich Trott)

* build: partially revert 5234b1c43a (Ben Noordhuis)

* zos: fix setsockopt error when using AF_UNIX (Milad Farazmand)

* unix: suppress EINTR/EINPROGRESS in uv_fs_close() (Ben Noordhuis)

* build: use cmake APPLE variable to detect platform (zlargon)

* distcheck: remove duplicate test/ entry (Jameson Nash)

* unix: remove unused cmpxchgl() function (Ben Noordhuis)

* unix: support sockaddr_un in uv_udp_send() (Yury Selivanov)

* unix: guard use of PTHREAD_STACK_MIN (Kamil Rytarowski)

* unix,win: introduce uv_timeval64_t (cjihrig)

* doc: document uv_timeval_t and uv_timeval64_t (cjihrig)

6 weeks agodoc: document uv_timeval_t and uv_timeval64_t 2246/head
cjihrig [Thu, 11 Apr 2019 18:07:22 +0000 (14:07 -0400)]
doc: document uv_timeval_t and uv_timeval64_t

PR-URL: https://github.com/libuv/libuv/pull/2246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
6 weeks agounix,win: introduce uv_timeval64_t
cjihrig [Mon, 8 Apr 2019 00:09:03 +0000 (20:09 -0400)]
unix,win: introduce uv_timeval64_t

Fixes: https://github.com/libuv/libuv/issues/2243
PR-URL: https://github.com/libuv/libuv/pull/2246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
6 weeks agounix: guard use of PTHREAD_STACK_MIN
Kamil Rytarowski [Wed, 10 Apr 2019 22:19:22 +0000 (00:19 +0200)]
unix: guard use of PTHREAD_STACK_MIN

PTHREAD_STACK_MIN is an optional part of the POSIX spec and
NetBSD deliberately does not implement it as it's a variable
value in runtime.

PR-URL: https://github.com/libuv/libuv/pull/2252
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
6 weeks agounix: support sockaddr_un in uv_udp_send()
Yury Selivanov [Sun, 17 Mar 2019 19:23:23 +0000 (15:23 -0400)]
unix: support sockaddr_un in uv_udp_send()

PR-URL: https://github.com/libuv/libuv/pull/2220
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
6 weeks agounix: remove unused cmpxchgl() function
Ben Noordhuis [Tue, 26 Mar 2019 00:32:12 +0000 (01:32 +0100)]
unix: remove unused cmpxchgl() function

PR-URL: https://github.com/libuv/libuv/pull/2230
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
6 weeks agodistcheck: remove duplicate test/ entry
Jameson Nash [Tue, 26 Mar 2019 00:56:37 +0000 (20:56 -0400)]
distcheck: remove duplicate test/ entry

It can be confusing to distcheck that we list it explicitly,
since it already adds it automatically, and we have configure
and build products in there.

Fixes: https://github.com/libuv/libuv/issues/2199
Refs: https://github.com/libuv/libuv/issues/2198
PR-URL: https://github.com/libuv/libuv/pull/2229
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
6 weeks agobuild: use cmake APPLE variable to detect platform
zlargon [Sun, 7 Apr 2019 16:47:04 +0000 (12:47 -0400)]
build: use cmake APPLE variable to detect platform

- CMake 3.14: supports Cross Compiling for iOS, tvOS, or watchOS
  using simple toolchain files.
  https://cmake.org/cmake/help/v3.14/release/3.14.html#platforms

- CMake 3.10: APPLE variable set to TURE when the target system
  is an Apple platform (macOS, iOS, tvOS or watchOS).
  https://cmake.org/cmake/help/v3.10/variable/APPLE.html

- CMake 3.0: APPLE variable support since v3.0.
  https://cmake.org/cmake/help/v3.0/variable/APPLE.html

PR-URL: https://github.com/libuv/libuv/pull/2245
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
6 weeks agounix: suppress EINTR/EINPROGRESS in uv_fs_close()
Ben Noordhuis [Fri, 29 Mar 2019 14:29:49 +0000 (15:29 +0100)]
unix: suppress EINTR/EINPROGRESS in uv_fs_close()

close() is interruptible, meaning that a signal delivered when the
close() system call is executing, can result in a return value of
-1 with errno set to EINTR or EINPROGRESS. A survey of supported
Unices suggests the file descriptor is in fact closed and so there
is nothing to do except ignore the error.

Libuv already handled it correctly for internal file descriptors
throug uv__close() and uv__close_nocheckstdio() but uv_fs_close()
did not until now.

PR-URL: https://github.com/libuv/libuv/pull/2236
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
6 weeks agozos: fix setsockopt error when using AF_UNIX
Milad Farazmand [Fri, 22 Mar 2019 17:20:38 +0000 (13:20 -0400)]
zos: fix setsockopt error when using AF_UNIX

PR-URL: https://github.com/libuv/libuv/pull/2224
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Yury Selivanov <yury@magic.io>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
6 weeks agobuild: partially revert 5234b1c43a
Ben Noordhuis [Wed, 27 Mar 2019 09:35:55 +0000 (10:35 +0100)]
build: partially revert 5234b1c43a

This undoes the changes commit 5234b1c4 ("build,sunos: better handling
of non-GCC compiler") makes to configure.ac and Makefile.am because they
break the build on the centos6 buildbots with the following error:

    # <snip>
    checking for _FILE_OFFSET_BITS value needed for large files... no
    ./configure: line 12957: syntax error near unexpected token `;'
    ./configure: line 12957: `; then'
    Build step 'Execute shell' marked build as failure

Refs: https://github.com/libuv/libuv/pull/2200
PR-URL: https://github.com/libuv/libuv/pull/2234
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
6 weeks agofs: add test for copyfile() respecting permissions
Rich Trott [Wed, 27 Mar 2019 15:36:25 +0000 (08:36 -0700)]
fs: add test for copyfile() respecting permissions

Add test to test-fs-copyfile.c to check that uv_fs_copyfile() respects
destination file permissions. Previously, in macOS, it did not.

PR-URL: https://github.com/libuv/libuv/pull/2233
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
6 weeks agofs: remove macOS-specific copyfile(3)
Rich Trott [Wed, 27 Mar 2019 06:12:13 +0000 (23:12 -0700)]
fs: remove macOS-specific copyfile(3)

Using copyfile(3) on macOS apparently results in situations where file
permissions are ignored. Using the same code for other UNIX-like
operating systems seems to fix the issue.

Refs: https://github.com/nodejs/node/issues/26936#issuecomment-476992597
PR-URL: https://github.com/libuv/libuv/pull/2233
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
6 weeks agounix: fix uv_interface_addresses()
Andreas Rohner [Sun, 13 Jan 2019 22:09:22 +0000 (23:09 +0100)]
unix: fix uv_interface_addresses()

The memset() in the inner loop clears previously copied phys_addrs. As a
result, every interface is reported to have a phys_addr of
00:00:00:00:00:00, except the last one. This bug only manifests on
systems with multiple interfaces.

PR-URL: https://github.com/libuv/libuv/pull/2153
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agounix,win: add uv_fs_{open,read,close}dir() 2057/head
cjihrig [Fri, 30 Jan 2015 19:04:03 +0000 (11:04 -0800)]
unix,win: add uv_fs_{open,read,close}dir()

Co-authored-by: Julien Gilli <jgilli@nodejs.org>
Co-authored-by: Jeremy Whitlock <jwhitlock@apache.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/libuv/libuv/pull/2057
Refs: https://github.com/joyent/libuv/issues/1430
Refs: https://github.com/joyent/libuv/pull/1521
Refs: https://github.com/joyent/libuv/pull/1574
Refs: https://github.com/libuv/libuv/pull/175
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/416
Refs: https://github.com/libuv/libuv/issues/170

2 months agounix,win: add uv_gettimeofday() 2221/head
cjihrig [Mon, 18 Mar 2019 21:41:13 +0000 (17:41 -0400)]
unix,win: add uv_gettimeofday()

PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agoNow working on version 1.27.1
cjihrig [Sat, 16 Mar 2019 18:35:15 +0000 (14:35 -0400)]
Now working on version 1.27.1

Fixes: https://github.com/libuv/libuv/issues/2213

2 months agoAdd SHA to ChangeLog
cjihrig [Sat, 16 Mar 2019 18:31:48 +0000 (14:31 -0400)]
Add SHA to ChangeLog

2 months ago2019.03.17, Version 1.27.0 (Stable) v1.27.0
cjihrig [Sat, 16 Mar 2019 18:31:48 +0000 (14:31 -0400)]
2019.03.17, Version 1.27.0 (Stable)

Changes since version 1.26.0:

* doc: describe unix signal handling better (Vladimír Čunát)

* linux: use statx() to obtain file birth time (Ben Noordhuis)

* src: fill sockaddr_in6.sin6_len when it's defined (Santiago Gimeno)

* test: relax uv_hrtime() test assumptions (Ben Noordhuis)

* build: make cmake install LICENSE only once (Thomas Karl Pietrowski)

* bsd: plug uv_fs_event_start() error path fd leak (Ben Noordhuis)

* unix: fix __FreeBSD_kernel__ typo (cjihrig)

* doc: add note about uv_run() not being reentrant (Ben Noordhuis)

* unix, win: make fs-poll close wait for resource cleanup (Anna
  Henningsen)

* doc: fix typo in uv_thread_options_t definition (Ryan Liptak)

* win: skip winsock initialization in safe mode (evgley)

* unix: refactor getsockname/getpeername methods (Santiago Gimeno)

* win,udp: allow to use uv_udp_open on bound sockets (Santiago Gimeno)

* udp: add support for UDP connected sockets (Santiago Gimeno)

* build: fix uv_test shared uv Windows cmake build (ptlomholt)

* build: add android-configure scripts to EXTRA_DIST (Ben Noordhuis)

* build: add missing header (cjihrig)

* sunos: add perror() output prior to abort() (Andrew Paprocki)

* test,sunos: disable UV_DISCONNECT handling (Andrew Paprocki)

* sunos: disable __attribute__((unused)) (Andrew Paprocki)

* test,sunos: use unistd.h code branch (Andrew Paprocki)

* build,sunos: better handling of non-GCC compiler (Andrew Paprocki)

* test,sunos: fix statement not reached warnings (Andrew Paprocki)

* sunos: fix argument/prototype mismatch in atomics (Andrew Paprocki)

* test,sunos: test-ipc.c lacks newline at EOF (Andrew Paprocki)

* test: change spawn_stdin_stdout return to void (Andrew Paprocki)

* test: remove call to floor() in test driver (Andrew Paprocki)

2 months agotest: remove call to floor() in test driver
Andrew Paprocki [Sun, 3 Mar 2019 19:53:43 +0000 (14:53 -0500)]
test: remove call to floor() in test driver

Using `floor()` instead of integer division causes the test driver
to require linking against `libm` on Solaris.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotest: change spawn_stdin_stdout return to void
Andrew Paprocki [Sun, 3 Mar 2019 19:45:56 +0000 (14:45 -0500)]
test: change spawn_stdin_stdout return to void

The return type is changed to avoid having to craft an artificial
`return` just for the Studio compiler.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotest,sunos: test-ipc.c lacks newline at EOF
Andrew Paprocki [Thu, 21 Feb 2019 15:43:30 +0000 (10:43 -0500)]
test,sunos: test-ipc.c lacks newline at EOF

The Studio compiler issues a warning because the source file lacks a
newline at the end of the file.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agosunos: fix argument/prototype mismatch in atomics
Andrew Paprocki [Thu, 21 Feb 2019 15:38:49 +0000 (10:38 -0500)]
sunos: fix argument/prototype mismatch in atomics

The `atomic_cas_uint` and `atomic_cas_ulong` functions expect `uint_t`
and `ulong_t` parameters, respectively, so cast the `int`/`long` inputs
to avoid loud compiler warnings.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotest,sunos: fix statement not reached warnings
Andrew Paprocki [Thu, 21 Feb 2019 15:34:01 +0000 (10:34 -0500)]
test,sunos: fix statement not reached warnings

The Studio C compiler issues a warning if there is a `return` after an
`abort()` call or an unreachable `return` after a prior `return`.

The Studio C compiler issues a warning if there is a `return` after a
prior `return`, or an endless loop (e.g., `for (;;)`) with a `return` at
the end of the function.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agobuild,sunos: better handling of non-GCC compiler
Andrew Paprocki [Thu, 21 Feb 2019 15:24:01 +0000 (10:24 -0500)]
build,sunos: better handling of non-GCC compiler

`AC_PROG_CC` sets the `GCC` shell variable, which is supposed to be
used to enable GCC-specific options.  A `GCC` check is added to only
pass the pre-existing GCC-specific options when using GCC.

The `GCC` variable is passed as an `AM_CONDITIONAL` and is used in
`Makefile.am` is used to address the following:

- Only pass `-pthreads` on `SUNOS` when using GCC
- Only use `-Wno-long-long` when using GCC

With the above changes, the Solaris build is now fixed when using the
native Studio compiler along with the minor adjustments:

- Always pass `-D_REENTRANT` to get thread-safe `errno`

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotest,sunos: use unistd.h code branch
Andrew Paprocki [Thu, 21 Feb 2019 15:20:45 +0000 (10:20 -0500)]
test,sunos: use unistd.h code branch

Tests do not compile when selecting the non-`unistd.h` branch.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agosunos: disable __attribute__((unused))
Andrew Paprocki [Thu, 21 Feb 2019 15:18:06 +0000 (10:18 -0500)]
sunos: disable __attribute__((unused))

The Studio compiler prints out a warning when this attribute is used
because it does not support it (at least as of the latest 12.6 version):
https://docs.oracle.com/cd/E77782_01/html/E77788/gjzke.html#scrolltoc

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotest,sunos: disable UV_DISCONNECT handling
Andrew Paprocki [Thu, 21 Feb 2019 15:16:08 +0000 (10:16 -0500)]
test,sunos: disable UV_DISCONNECT handling

Solaris does not support the non-standard Linux `POLLRDHUP` event, so
disable the code awaiting the disconnects to exit the loop.  Without
this, the `poll_duplex` and `poll_unidirectional` tests will hang and
timeout.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agosunos: add perror() output prior to abort()
Andrew Paprocki [Thu, 21 Feb 2019 13:34:15 +0000 (08:34 -0500)]
sunos: add perror() output prior to abort()

There are three `abort()` calls within the I/O subsystem related to
Solaris ports (`port_associate()`, `port_dissociate()`, and
`port_getn()`).  To simplify debugging issues where the kernel is
setting `errno` and returning failure, call `perror()` to see the
`errno` value cause of the failure.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agobuild: add missing header 2219/head
cjihrig [Sat, 16 Mar 2019 16:39:45 +0000 (12:39 -0400)]
build: add missing header

Refs: https://github.com/libuv/libuv/pull/2198#issuecomment-466118047
PR-URL: https://github.com/libuv/libuv/pull/2219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2 months agobuild: add android-configure scripts to EXTRA_DIST
Ben Noordhuis [Thu, 21 Feb 2019 11:44:30 +0000 (12:44 +0100)]
build: add android-configure scripts to EXTRA_DIST

Commit baa81465a ("build: add compile for android arm64/x86/x86-64")
introduced a number of new android-configure scripts but didn't add
them to EXTRA_DIST in Makefile.am, causing `make dist` to fail.

This commit also removes checkspare.sh from EXTRA_DIST. I broke that
in commit a7a16219d ("unix: remove checksparse.sh") from last June.
Mea culpa!

Fixes: https://github.com/libuv/libuv/issues/2190
PR-URL: https://github.com/libuv/libuv/pull/2198
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agobuild: fix uv_test shared uv Windows cmake build
Poul Thomas Lomholt [Tue, 12 Feb 2019 22:54:05 +0000 (14:54 -0800)]
build: fix uv_test shared uv Windows cmake build

This commit fixes a linker error when building tests
via cmake on Windows by adding the proper
USING_UV_SHARED=1 define when linking to the shared
libuv.

Fixes: https://github.com/libuv/libuv/issues/2188
PR-URL: https://github.com/libuv/libuv/pull/2187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agoudp: add support for UDP connected sockets
Santiago Gimeno [Mon, 20 Mar 2017 10:32:25 +0000 (11:32 +0100)]
udp: add support for UDP connected sockets

Add two new methods:

`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.

Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".

Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agowin,udp: allow to use uv_udp_open on bound sockets
Santiago Gimeno [Wed, 6 Jun 2018 21:15:03 +0000 (23:15 +0200)]
win,udp: allow to use uv_udp_open on bound sockets

PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: refactor getsockname/getpeername methods
Santiago Gimeno [Thu, 31 May 2018 20:44:07 +0000 (22:44 +0200)]
unix: refactor getsockname/getpeername methods

PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agowin: skip winsock initialization in safe mode
evgley [Sun, 24 Feb 2019 06:32:28 +0000 (09:32 +0300)]
win: skip winsock initialization in safe mode

uv_winsock_init calls abort() if socket operation failed, which means
all libuv-based applications are not able to start in safe mode
without network.

PR-URL: https://github.com/libuv/libuv/pull/2205
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agodoc: fix typo in uv_thread_options_t definition
Ryan Liptak [Wed, 20 Feb 2019 02:06:39 +0000 (18:06 -0800)]
doc: fix typo in uv_thread_options_t definition

PR-URL: https://github.com/libuv/libuv/pull/2195
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agounix, win: make fs-poll close wait for resource cleanup
Anna Henningsen [Thu, 7 Jun 2018 17:16:32 +0000 (19:16 +0200)]
unix, win: make fs-poll close wait for resource cleanup

Wait until all fs requests spawned by an `uv_fs_poll_t`
have finished and all timers created by it have fully been
closed before calling the close callback.

Fixes: https://github.com/libuv/libuv/issues/1869
PR-URL: https://github.com/libuv/libuv/pull/1875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agodoc: add note about uv_run() not being reentrant 2208/head
Ben Noordhuis [Mon, 25 Feb 2019 11:26:58 +0000 (12:26 +0100)]
doc: add note about uv_run() not being reentrant

PR-URL: https://github.com/libuv/libuv/pull/2208
Refs: https://github.com/libuv/help/issues/81
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agounix: fix __FreeBSD_kernel__ typo 2214/head
cjihrig [Fri, 1 Mar 2019 14:33:17 +0000 (09:33 -0500)]
unix: fix __FreeBSD_kernel__ typo

Fixes: https://github.com/libuv/libuv/issues/2212
PR-URL: https://github.com/libuv/libuv/pull/2214
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agobsd: plug uv_fs_event_start() error path fd leak 2197/head
Ben Noordhuis [Thu, 21 Feb 2019 11:32:44 +0000 (12:32 +0100)]
bsd: plug uv_fs_event_start() error path fd leak

Close the watched file's file descriptor when initialization fails due
to out-of-memory conditions.

PR-URL: https://github.com/libuv/libuv/pull/2197
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2 months agobuild: make cmake install LICENSE only once
Thomas Karl Pietrowski [Sat, 23 Feb 2019 09:26:07 +0000 (10:26 +0100)]
build: make cmake install LICENSE only once

The license file is installed twice. Once where it should be installed
and the second time into the pkg-config directory. Among other files
from other projects it might be confusing why there is a license file
among with other files. Additionally, that is normally not the right
location for license files. Guess, that is only a copy/pasting mistake.

PR-URL: https://github.com/libuv/libuv/pull/2204
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agotest: relax uv_hrtime() test assumptions 2186/head
Ben Noordhuis [Tue, 12 Feb 2019 15:01:00 +0000 (16:01 +0100)]
test: relax uv_hrtime() test assumptions

Expecting `uv_sleep(45)` to wake up within 80 ms is not a reasonable
assumption: the operating system may not reschedule the process within
that time frame when the system is overloaded.

The test fails intermittently on our own CI and packagers have reported
similar failures.

Fixes: https://github.com/libuv/libuv/issues/2117
PR-URL: https://github.com/libuv/libuv/pull/2186
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agosrc: fill sockaddr_in6.sin6_len when it's defined
Santiago Gimeno [Thu, 14 Feb 2019 10:51:33 +0000 (11:51 +0100)]
src: fill sockaddr_in6.sin6_len when it's defined

As some calls in some platforms require.

PR-URL: https://github.com/libuv/libuv/pull/2189
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agolinux: use statx() to obtain file birth time 2184/head
Ben Noordhuis [Sat, 9 Feb 2019 22:17:05 +0000 (23:17 +0100)]
linux: use statx() to obtain file birth time

Kernels > 4.11 support the statx() system call that lets one retrieve
the birth time of a file. Teach libuv about it.

Fixes: https://github.com/libuv/libuv/issues/2152
PR-URL: https://github.com/libuv/libuv/pull/2184
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
3 months agodoc: describe unix signal handling better
Vladimír Čunát [Thu, 13 Sep 2018 15:30:59 +0000 (17:30 +0200)]
doc: describe unix signal handling better

- SIGTERM seems OK to handle - I tested that on Linux, read POSIX, etc.
  I can't see why it should be different from SIGUSR1, for example,
  except that the default handler is different.
- Also raise(15) is caught by the handler for me, and I can't see
  why it wouldn't.

The main source of knowledge for this is POSIX.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03_03

PR-URL: https://github.com/libuv/libuv/pull/1987
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agoNow working on version 1.26.1
cjihrig [Sun, 10 Feb 2019 16:46:28 +0000 (11:46 -0500)]
Now working on version 1.26.1

Fixes: https://github.com/libuv/libuv/issues/2180

3 months agoAdd SHA to ChangeLog
cjihrig [Sun, 10 Feb 2019 16:44:48 +0000 (11:44 -0500)]
Add SHA to ChangeLog

3 months ago2019.02.11, Version 1.26.0 (Stable) v1.26.0
cjihrig [Sun, 10 Feb 2019 16:44:47 +0000 (11:44 -0500)]
2019.02.11, Version 1.26.0 (Stable)

Changes since version 1.25.0:

* doc: fix uv_get_free_memory doc (Stephen Belanger)

* unix: fix epoll cpu 100% issue (yeyuanfeng)

* openbsd,tcp: special handling of EINVAL on connect (ptlomholt)

* win: simplify registry closing in uv_cpu_info() (cjihrig)

* src,include: define UV_MAXHOSTNAMESIZE (cjihrig)

* win: return product name in uv_os_uname() version (cjihrig)

* thread: allow specifying stack size for new thread (Anna Henningsen)

* win: fix duplicate tty vt100 fn key (erw7)

* unix: don't attempt to invalidate invalid fd (Ben Noordhuis)

3 months agounix: don't attempt to invalidate invalid fd
Ben Noordhuis [Sun, 10 Feb 2019 10:41:31 +0000 (11:41 +0100)]
unix: don't attempt to invalidate invalid fd

Add a missing check in uv__io_close() where it called
uv__platform_invalidate_fd() without checking that the
watcher actually has a valid file descriptor assigned.

Fixes: https://github.com/libuv/libuv/issues/2181
PR-URL: https://github.com/libuv/libuv/pull/2182
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agowin: fix duplicate tty vt100 fn key
erw7 [Tue, 22 Jan 2019 10:28:09 +0000 (19:28 +0900)]
win: fix duplicate tty vt100 fn key

Refs: https://github.com/libuv/libuv/pull/2114
Refs: https://github.com/nodejs/node/issues/25875
Refs: https://github.com/nodejs/node/issues/26013
Fixes: https://github.com/libuv/libuv/issues/2168
PR-URL: https://github.com/libuv/libuv/pull/2160
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agothread: allow specifying stack size for new thread
Anna Henningsen [Wed, 6 Feb 2019 13:48:33 +0000 (14:48 +0100)]
thread: allow specifying stack size for new thread

PR-URL: https://github.com/libuv/libuv/pull/2179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
3 months agowin: return product name in uv_os_uname() version 2170/head
cjihrig [Sat, 2 Feb 2019 15:25:08 +0000 (10:25 -0500)]
win: return product name in uv_os_uname() version

Currently, on Windows the uv_utsname_t's version field can
be an empty string if no service packs are installed. This isn't
very helpful, and a lot more information is available in the
Windows registry. This commit prepends the full product name
to the existing service pack information.

Refs: https://github.com/nodejs/node/issues/25843
Refs: https://github.com/libuv/libuv/pull/2128#issuecomment-452109129
PR-URL: https://github.com/libuv/libuv/pull/2170
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
3 months agosrc,include: define UV_MAXHOSTNAMESIZE 2175/head
cjihrig [Mon, 4 Feb 2019 15:00:07 +0000 (10:00 -0500)]
src,include: define UV_MAXHOSTNAMESIZE

This commit adds UV_MAXHOSTNAMESIZE for working with
uv_os_gethostname(). Prior to this commit, this logic was
duplicated in several places across libuv and Node.js alone.

PR-URL: https://github.com/libuv/libuv/pull/2175
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agowin: simplify registry closing in uv_cpu_info() 2171/head
cjihrig [Sat, 2 Feb 2019 18:50:39 +0000 (13:50 -0500)]
win: simplify registry closing in uv_cpu_info()

RegCloseKey() is the first thing executed in both the success
and error case, so combine the calls.

PR-URL: https://github.com/libuv/libuv/pull/2171
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agoopenbsd,tcp: special handling of EINVAL on connect
ptlomholt [Thu, 17 Jan 2019 19:05:35 +0000 (11:05 -0800)]
openbsd,tcp: special handling of EINVAL on connect

Map `EINVAL` to `ECONNREFUSED` and return error on the next tick.

Fixes: https://github.com/libuv/libuv/issues/2155
PR-URL: https://github.com/libuv/libuv/pull/2154
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agounix: fix epoll cpu 100% issue
yeyuanfeng [Thu, 31 Jan 2019 09:07:33 +0000 (17:07 +0800)]
unix: fix epoll cpu 100% issue

Fixes: https://github.com/libuv/libuv/issues/2162
PR-URL: https://github.com/libuv/libuv/pull/2166
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Li YuBei <leeight@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agodoc: fix uv_get_free_memory doc
Stephen Belanger [Sun, 27 Jan 2019 06:50:17 +0000 (22:50 -0800)]
doc: fix uv_get_free_memory doc

There was a formatting error that prevented the uv_get_free_memory
function from appearing on the page.

PR-URL: https://github.com/libuv/libuv/pull/2163
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
4 months agoNow working on version 1.25.1
cjihrig [Fri, 18 Jan 2019 18:32:48 +0000 (13:32 -0500)]
Now working on version 1.25.1

Fixes: https://github.com/libuv/libuv/issues/2134

4 months agoAdd SHA to ChangeLog
cjihrig [Fri, 18 Jan 2019 18:27:41 +0000 (13:27 -0500)]
Add SHA to ChangeLog

4 months ago2019.01.19, Version 1.25.0 (Stable) v1.25.0
cjihrig [Fri, 18 Jan 2019 18:27:40 +0000 (13:27 -0500)]
2019.01.19, Version 1.25.0 (Stable)

Changes since version 1.24.1:

* Revert "win,fs: retry if uv_fs_rename fails" (Ben Noordhuis)

* aix: manually trigger fs event monitoring (Gireesh Punathil)

* unix: rename WRITE_RETRY_ON_ERROR macro (Ben Noordhuis)

* darwin: DRY platform-specific error check (Ben Noordhuis)

* unix: refactor uv__write() (Ben Noordhuis)

* unix: don't send handle twice on partial write (Ben Noordhuis)

* tty,win: fix Alt+key under WSL (Bartosz Sosnowski)

* build: support running tests in out-of-tree builds (Jameson Nash)

* fsevents: really watch files with fsevents on macos 10.7+ (Jameson
  Nash)

* thread,mingw64: need intrin.h header for SSE2 MemoryBarrier (Jameson
  Nash)

* win: fix sizeof-pointer-div warning (cjihrig)

* unix,win: add uv_os_uname() (cjihrig)

* win, tty: fix CreateFileW() return value check (Bartosz Sosnowski)

* unix: enable IPv6 tests on OpenBSD (ptlomholt)

* test: fix test-ipc spawn_helper exit_cb (Santiago Gimeno)

* test: fix test-ipc tests (Santiago Gimeno)

* unix: better handling of unsupported F_FULLFSYNC (Victor Costan)

* win,test: de-flake fs_event_watch_dir_short_path (Refael Ackermann)

* win: fix msvc warning (sid)

* openbsd: switch to libuv's barrier implementation (ptlomholt)

* unix,stream: fix zero byte writes (Santiago Gimeno)

* ibmi: return EISDIR on read from directory fd (Kevin Adler)

* build: wrap long lines in Makefile.am (cjihrig)

4 months agoRevert "ibmi: add support for IBM i to cmake build" 2156/head
cjihrig [Thu, 17 Jan 2019 22:22:25 +0000 (17:22 -0500)]
Revert "ibmi: add support for IBM i to cmake build"

This reverts commit 8d62d933ef31fd47ae269395364a280a12eb9636.
The corresponding autotools update broke the CI. This commit
is reverted for consistency.

Refs: https://github.com/libuv/libuv/pull/2148
PR-URL: https://github.com/libuv/libuv/pull/2156
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 months agoRevert "ibmi: add support for IBM i to autotools build"
cjihrig [Thu, 17 Jan 2019 22:21:50 +0000 (17:21 -0500)]
Revert "ibmi: add support for IBM i to autotools build"

This reverts commit ca02c36c6ddcf1f74215a63b3fbff04c1a79a1c0.
This broke SmartOS compilation in the CI.

Refs: https://github.com/libuv/libuv/pull/2148
PR-URL: https://github.com/libuv/libuv/pull/2156
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 months agobuild: wrap long lines in Makefile.am 2151/head
cjihrig [Thu, 17 Jan 2019 16:16:39 +0000 (11:16 -0500)]
build: wrap long lines in Makefile.am

PR-URL: https://github.com/libuv/libuv/pull/2151
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agoibmi: add support for IBM i to autotools build
Kevin Adler [Tue, 15 Jan 2019 18:27:31 +0000 (12:27 -0600)]
ibmi: add support for IBM i to autotools build

PR-URL: https://github.com/libuv/libuv/pull/2148
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agoibmi: add support for IBM i to cmake build
Kevin Adler [Tue, 15 Jan 2019 18:27:20 +0000 (12:27 -0600)]
ibmi: add support for IBM i to cmake build

PR-URL: https://github.com/libuv/libuv/pull/2148
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agoibmi: return EISDIR on read from directory fd
Kevin Adler [Tue, 15 Jan 2019 18:07:51 +0000 (12:07 -0600)]
ibmi: return EISDIR on read from directory fd

On IBM i PASE, EOPNOTSUPP is returned when reading a directory instead
of EISDIR, like (seemingly) every other platform which doesn't support
reading directories. To ensure compatibility with software expecting
EISDIR, we map the EOPNOTSUPP to EISDIR when the fd passed in was a
directory.

This is a partial revert of 25a3894, but scoped to PASE and the fstat
call is moved to the end so it's out of the fast path.

Refs: https://github.com/nodejs/node/issues/25433
Fixes: https://github.com/libuv/libuv/issues/2147
PR-URL: https://github.com/libuv/libuv/pull/2148
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agounix,stream: fix zero byte writes
Santiago Gimeno [Wed, 16 Jan 2019 15:14:30 +0000 (16:14 +0100)]
unix,stream: fix zero byte writes

Fixes a regression where a write request to write a zero byte buffer
would never complete.

Refs: https://github.com/libuv/libuv/pull/2097
Refs: https://github.com/libuv/libuv/issues/2134
PR-URL: https://github.com/libuv/libuv/pull/2149
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
4 months agoopenbsd: switch to libuv's barrier implementation
Poul T Lomholt [Tue, 15 Jan 2019 00:23:25 +0000 (16:23 -0800)]
openbsd: switch to libuv's barrier implementation

On OpenBSD 6.4 x86_64 the barrier_serial_thread test fails due to
OpenBSD's pthread_barrier_wait() implementation returning
PTHREAD_BARRIER_SERIAL_THREAD from the first thread that releases the
wait. Switch to libuv's internal implementation to address the issue.

Fixes: https://github.com/libuv/libuv/issues/2145
PR-URL: https://github.com/libuv/libuv/pull/2144
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>