libuv.git
2 days agoNow working on version 1.27.1 v1.x
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 days agoAdd SHA to ChangeLog
cjihrig [Sat, 16 Mar 2019 18:31:48 +0000 (14:31 -0400)]
Add SHA to ChangeLog

2 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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 days 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>
7 days 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>
10 days 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 weeks 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 weeks 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>
3 weeks 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 weeks 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>
4 weeks 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>
4 weeks 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>
5 weeks 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>
5 weeks 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

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

5 weeks 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)

5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
8 weeks 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

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

8 weeks 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)

8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
2 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>
2 months agowin: fix msvc warning
sid [Sat, 24 Nov 2018 05:39:58 +0000 (13:39 +0800)]
win: fix msvc warning

PR-URL: https://github.com/libuv/libuv/pull/2091
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2 months agowin,test: de-flake fs_event_watch_dir_short_path
Refael Ackermann [Fri, 30 Nov 2018 14:43:08 +0000 (09:43 -0500)]
win,test: de-flake fs_event_watch_dir_short_path

New versions of Windows ship with 8.3 short-names disabled.
This commit adds 8.3 detection logic in the
fs_event_watch_dir_short_path test.

PR-URL: https://github.com/libuv/libuv/pull/2103
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: better handling of unsupported F_FULLFSYNC
Victor Costan [Wed, 9 Jan 2019 11:20:03 +0000 (03:20 -0800)]
unix:  better handling of unsupported F_FULLFSYNC

Apple's released source code at https://opensource.apple.com/ shows at
least three different error codes being returned when a filesystem does
not support F_FULLFSYNC.

fcntl() is implemented in xnu-4903.221.2 in bsd/kern/kern_descrip.c,
where it delegates to fcntl_nocancel(). The documentation for
fcntl_nocancel() mentions error codes for some operations, but does not
include F_FULLFSYNC.  The F_FULLSYNC branch in fcntl_nocancel() calls
VNOP_IOCTL(_, F_FULLSYNC, NULL, 0, _), whose return value sets the error
code.

VNOP_IOCTL() is implemented in bsd/vfs/kpi_vfs.c and calls the ioctl
function in the vnode's operation vector. The filesystem-level function
names follow the pattern _vnop_ioctl() for all the instances in
opensource code -- {hfs,msdosfs,nfs,ntfs,smbfs,webdav,zfs}_vnop_ioctl().

hfs-407.30.1, msdosfs-229.200.3, and nfs in xnu-4903.221.2 handle
F_FULLFSYNC. ntfs-94.200.1 and smb-759.40.1 do not handle F_FULLFSYNC,
and the default branch returns ENOSUP. webdav-380.200.1 also does not
handle F_FULLFSYNC, but the default branch returns EINVAL. zfs-59 also
does not handle F_FULLSYNC, and its default branch returns ENOTTY.

From a different angle, Apple's ntfs-94.200.1 includes utility code that
uses fcntl(F_FULLFSYNC) and falls back to fsync() just like this patch
does, supporting the hypothesis that there is no good way to detect lack
of F_FULLFSYNC support.

PR-URL: https://github.com/libuv/libuv/pull/2135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Joran Dirk Greef <joran@ronomon.com>
2 months agotest: fix test-ipc tests
Santiago Gimeno [Fri, 11 Jan 2019 13:09:23 +0000 (14:09 +0100)]
test: fix test-ipc tests

A couple of ipc tests failures where undercover by the previous commit.

- In `ipc-heavy-traffic-deadlock-bug`, `uv_shutdown` can fail with
  `UV_ENOTCONN`. Allow it.
- `ipc_closed_handle` was failing consistently on `Centos6` because the
  first large write was completed in just one syscall. Also, there were
  issues with the lifetime of the `uv_write_t` requests. Refactor the
  test so it passes consistently on `Centos6` while fixing the
  `uv_write_t` issues.

PR-URL: https://github.com/libuv/libuv/pull/2108
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agotest: fix test-ipc spawn_helper exit_cb
Santiago Gimeno [Fri, 7 Dec 2018 22:09:42 +0000 (23:09 +0100)]
test: fix test-ipc spawn_helper exit_cb

Make sure an ipc test fails if `term_signal` is not zero. This can
happen on failing assertions in the child process.

PR-URL: https://github.com/libuv/libuv/pull/2108
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix: enable IPv6 tests on OpenBSD
ptlomholt [Sun, 6 Jan 2019 20:36:02 +0000 (12:36 -0800)]
unix: enable IPv6 tests on OpenBSD

Refs: https://github.com/libuv/libuv/pull/1576
PR-URL: https://github.com/libuv/libuv/pull/2136
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agowin, tty: fix CreateFileW() return value check
Bartosz Sosnowski [Sat, 12 Jan 2019 09:25:30 +0000 (10:25 +0100)]
win, tty: fix CreateFileW() return value check

CreateFileW() returns INVALID_HANDLE_VALUE on failure, not NULL.

Fixes: https://github.com/libuv/libuv/issues/2141
PR-URL: https://github.com/libuv/libuv/pull/2142
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2 months agounix,win: add uv_os_uname() 2128/head
cjihrig [Fri, 4 Jan 2019 19:04:32 +0000 (14:04 -0500)]
unix,win: add uv_os_uname()

Fixes: https://github.com/libuv/libuv/issues/2126
PR-URL: https://github.com/libuv/libuv/pull/2128
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2 months agowin: fix sizeof-pointer-div warning 2139/head
cjihrig [Fri, 11 Jan 2019 02:54:58 +0000 (21:54 -0500)]
win: fix sizeof-pointer-div warning

short_path's type changed from WCHAR array to WCHAR*
in https://github.com/libuv/libuv/pull/1267, leading
to a sizeof-pointer-div warning.

Fixes: https://github.com/libuv/libuv/issues/2138
PR-URL: https://github.com/libuv/libuv/pull/2139
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2 months agothread,mingw64: need intrin.h header for SSE2 MemoryBarrier 2083/head
Jameson Nash [Thu, 15 Nov 2018 19:22:36 +0000 (19:22 +0000)]
thread,mingw64: need intrin.h header for SSE2 MemoryBarrier

Needed for compile with `-msse2` (such as implied by `-march=pentium4`)
for the i686-w64-mingw64 target triple. This seems like a header mistake, but
we can work-around it here by including the header explicitly.

Refs: https://sourceforge.net/p/mingw-w64/bugs/712
PR-URL: https://github.com/libuv/libuv/pull/2083
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2 months agofsevents: really watch files with fsevents on macos 10.7+ 2082/head
Jameson Nash [Mon, 19 Nov 2018 19:29:20 +0000 (14:29 -0500)]
fsevents: really watch files with fsevents on macos 10.7+

In the original PR, the ifdef conditional was reversed,
leading to the old code-path still being used.
This also reduces some of the redundancy in the conditional checks,
by factoring out the common test.
And fixes a divergence in functionality kFSEventsRenamed =>
kFSEventStreamEventFlagItemRenamed
And actually includes the part of the original PR to kqueue that enabled
watching files with fsevents!

Fixes: https://github.com/libuv/libuv/pull/387
PR-URL: https://github.com/libuv/libuv/pull/2082
Refs: https://github.com/libuv/libuv/pull/1572
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agobuild: support running tests in out-of-tree builds 2099/head
Jameson Nash [Thu, 29 Nov 2018 19:50:33 +0000 (14:50 -0500)]
build: support running tests in out-of-tree builds

PR-URL: https://github.com/libuv/libuv/pull/2099
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agotty,win: fix Alt+key under WSL
Bartosz Sosnowski [Wed, 12 Dec 2018 11:40:43 +0000 (12:40 +0100)]
tty,win: fix Alt+key under WSL

When releasing key with Alt pressed, the reported event has
LEFT_ALT_PRESSED state flag set. This confuses libuv, making it think
that Alt+numpad combination is used. This fixes this issue by removing
the check for state flag. Checking if VirtuakKeyCode is set to VK_MENU
is enough to detect the Alt+numpad case.

Fixes: https://github.com/libuv/libuv/issues/2111
PR-URL: https://github.com/libuv/libuv/pull/2114
Reviewed-By: Refael Ackermann <refack@gmail.com>
2 months agounix: don't send handle twice on partial write 2097/head
Ben Noordhuis [Sun, 30 Dec 2018 18:35:10 +0000 (19:35 +0100)]
unix: don't send handle twice on partial write

Guard against sending the handle over the UNIX domain socket twice
when the first sendmsg() didn't write all bytes.

The changes to src/win partially undo changes made earlier this year,
see the referenced pull request for details.

Libuv never made promises about the value of `req->send_handle` at
different points in time so this should be a safe, non-breaking change.

No tests because this particular condition is hard to hit reliably
across platforms. I spent a lot of time trying to write one but it
turned out hideously complex, and worse, flaky.

Fixes: https://github.com/libuv/libuv/issues/2086
PR-URL: https://github.com/libuv/libuv/pull/2097
Refs: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agounix: refactor uv__write()
Ben Noordhuis [Sun, 30 Dec 2018 18:35:10 +0000 (19:35 +0100)]
unix: refactor uv__write()

Refactor uv__write() to make an upcoming fix easier to implement.

PR-URL: https://github.com/libuv/libuv/pull/2097
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agodarwin: DRY platform-specific error check
Ben Noordhuis [Sun, 30 Dec 2018 18:35:10 +0000 (19:35 +0100)]
darwin: DRY platform-specific error check

PR-URL: https://github.com/libuv/libuv/pull/2097
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agounix: rename WRITE_RETRY_ON_ERROR macro
Ben Noordhuis [Sun, 30 Dec 2018 18:35:10 +0000 (19:35 +0100)]
unix: rename WRITE_RETRY_ON_ERROR macro

PR-URL: https://github.com/libuv/libuv/pull/2097
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2 months agoaix: manually trigger fs event monitoring
Gireesh Punathil [Tue, 25 Dec 2018 08:31:34 +0000 (03:31 -0500)]
aix: manually trigger fs event monitoring

In AIX, fs watch feature leverages AHAFS function.
According to AHAFS, monitoring of events does not
begin until the monitoring application issues a select()
or a blocking read() call. In edge cases where the watch
request as well as fs event both occurs in single event
loop cycle, we miss the event, as the event monitors are
created but not yet registered in the current cycle,
instead only enqueued into the poll structure, that will
be taken up with the OS on the loop edge only.

Trigger a select call in-line on the monitoring fd, that
tells AHAFS to kick-start the moitoring.

Fixes: https://github.com/libuv/libuv/issues/2118
PR-URL: https://github.com/libuv/libuv/pull/2123
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2 months agoRevert "win,fs: retry if uv_fs_rename fails" 2122/head
Ben Noordhuis [Mon, 24 Dec 2018 09:23:12 +0000 (10:23 +0100)]
Revert "win,fs: retry if uv_fs_rename fails"

This reverts commit e94c184c7c4a18f3de569c97caeb83f4ff98a4b2.

Concerns were raised about the suitability of this policy and I, for
one, agree with them.

Fixes: https://github.com/libuv/libuv/issues/2098
PR-URL: https://github.com/libuv/libuv/pull/2122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agoNow working on version 1.24.2
cjihrig [Sun, 16 Dec 2018 19:12:36 +0000 (14:12 -0500)]
Now working on version 1.24.2

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

3 months agoAdd SHA to ChangeLog
cjihrig [Sun, 16 Dec 2018 19:11:04 +0000 (14:11 -0500)]
Add SHA to ChangeLog

3 months ago2018.12.17, Version 1.24.1 (Stable) v1.24.1
cjihrig [Sun, 16 Dec 2018 19:11:04 +0000 (14:11 -0500)]
2018.12.17, Version 1.24.1 (Stable)

Changes since version 1.24.0:

* test: fix platform_output test on cygwin (damon-kwok)

* gitignore: ignore build/ directory (Damon Kwok)

* unix: zero epoll_event before use (Ashe Connor)

* darwin: use runtime check for file cloning (Ben Noordhuis)

* doc: replace deprecated build command on macOS (Rick)

* warnings: fix code that emits compiler warnings (Jameson Nash)

* doc: clarify expected memory management strategy (Ivan Krylov)

* test: add uv_inet_ntop(AF_INET) coverage (Ben Noordhuis)

* unix: harden string copying, introduce strscpy() (Ben Noordhuis)

* linux: get rid of strncpy() call (Ben Noordhuis)

* aix: get rid of strcat() calls (Ben Noordhuis)

* aix: fix data race in uv_fs_event_start() (Ben Noordhuis)

* win: fs: fix `FILE_FLAG_NO_BUFFERING` for writes (Joran Dirk Greef)

* build: don't link against -lpthread on Android (Michael Meier)

3 months agobuild: don't link against -lpthread on Android
Michael Meier [Tue, 11 Dec 2018 10:33:09 +0000 (11:33 +0100)]
build: don't link against -lpthread on Android

On Android, pthread is part of the C standard library. Hence, there is
no need to specify -lpthread when building for Android.

PR-URL: https://github.com/libuv/libuv/pull/2110
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agowin: fs: fix `FILE_FLAG_NO_BUFFERING` for writes
Joran Dirk Greef [Fri, 30 Nov 2018 14:35:31 +0000 (16:35 +0200)]
win: fs: fix `FILE_FLAG_NO_BUFFERING` for writes

On Windows, `fs__open()` maps `UV_FS_O_DIRECT` to
`FILE_FLAG_NO_BUFFERING`.

When `access` is only `FILE_GENERIC_READ` this succeeds, but when
`access` is `FILE_GENERIC_WRITE` this returns an error:

```
0x00000057, ERROR_INVALID_PARAMETER, The parameter is incorrect.
```

The reason is that `FILE_GENERIC_WRITE` includes `FILE_APPEND_DATA`,
but `FILE_APPEND_DATA` and `FILE_FLAG_NO_BUFFERING` are mutually
exclusive:

```
FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE |
                     FILE_WRITE_DATA |
                     FILE_WRITE_ATTRIBUTES |
                     FILE_WRITE_EA |
                     FILE_APPEND_DATA |
                     SYNCHRONIZE
```

This incompatibility between access and attribute flags does not appear
to be documented by Microsoft for `FILE_FLAG_NO_BUFFERING` but it is
indirectly documented under [NtCreateFile](https://bit.ly/2rm5wRT):

```
FILE_NO_INTERMEDIATE_BUFFERING
The file cannot be cached or buffered in a driver's internal buffers.
This flag is incompatible with the DesiredAccess FILE_APPEND_DATA flag.
```

The solution is to remove `FILE_APPEND_DATA` from the access flags when
`FILE_FLAG_NO_BUFFERING` is set. Note that this does not prevent
appends, since `FILE_GENERIC_WRITE` also includes `FILE_WRITE_DATA`,
which in turn allows appends.

PR-URL: https://github.com/libuv/libuv/pull/2102
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agoaix: fix data race in uv_fs_event_start() 2065/head
Ben Noordhuis [Mon, 3 Dec 2018 08:29:23 +0000 (09:29 +0100)]
aix: fix data race in uv_fs_event_start()

Don't use a buffer with static lifetime to store intermediate results,
use a stack-allocated one.

PR-URL: https://github.com/libuv/libuv/pull/2065
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agoaix: get rid of strcat() calls
Ben Noordhuis [Mon, 3 Dec 2018 08:29:23 +0000 (09:29 +0100)]
aix: get rid of strcat() calls

Insecure and unnecessary. Replace them with a call to snprintf().

PR-URL: https://github.com/libuv/libuv/pull/2065
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agolinux: get rid of strncpy() call
Ben Noordhuis [Mon, 3 Dec 2018 08:29:23 +0000 (09:29 +0100)]
linux: get rid of strncpy() call

While correctly used, it looks suspect and is slightly less efficient
because the string is scanned twice for its terminating nul byte.

PR-URL: https://github.com/libuv/libuv/pull/2065
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agounix: harden string copying, introduce strscpy()
Ben Noordhuis [Mon, 3 Dec 2018 08:29:23 +0000 (09:29 +0100)]
unix: harden string copying, introduce strscpy()

Replace calls to strcpy() and strncpy() with the newly introduced
uv__strscpy() function that is meticulous about zero-terminating
the destination buffer.

PR-URL: https://github.com/libuv/libuv/pull/2065
Refs: https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agotest: add uv_inet_ntop(AF_INET) coverage
Ben Noordhuis [Mon, 3 Dec 2018 08:29:23 +0000 (09:29 +0100)]
test: add uv_inet_ntop(AF_INET) coverage

Libuv had coverage for the AF_INET6 path but not the AF_INET path.
Now it does.

PR-URL: https://github.com/libuv/libuv/pull/2065
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
3 months agodoc: clarify expected memory management strategy
Ivan Krylov [Thu, 22 Nov 2018 15:49:33 +0000 (18:49 +0300)]
doc: clarify expected memory management strategy

Right now, docs don't make it clear when exactly does it become okay to
free memory belonging to `uv_handle_t`. It's only stated that
`uv_close` must be called before freeing the memory, which is a source
of confusion for new users: they call `uv_close(handle, NULL)`, then
free the memory (see e.g. #2078, https://stackoverflow.com/q/25615340).

PR-URL: https://github.com/libuv/libuv/pull/2087
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
3 months agowarnings: fix code that emits compiler warnings 2066/head
Jameson Nash [Mon, 5 Nov 2018 21:03:19 +0000 (16:03 -0500)]
warnings: fix code that emits compiler warnings

PR-URL: https://github.com/libuv/libuv/pull/2066
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
3 months agodoc: replace deprecated build command on macOS
Rick [Tue, 27 Nov 2018 03:03:16 +0000 (11:03 +0800)]
doc: replace deprecated build command on macOS

Origin README about build command is not suited for current code.

1. gyp_uv.py generated uv.xcodeproj file in directory 'out' instead of
   repository root directory

2. xcode build target params use '-alltargets' instead of '-target All'.

PR-URL: https://github.com/libuv/libuv/pull/2095
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
3 months agodarwin: use runtime check for file cloning 2092/head
Ben Noordhuis [Sat, 24 Nov 2018 21:01:21 +0000 (22:01 +0100)]
darwin: use runtime check for file cloning

Using #ifdef guards is not reliable because libuv may have been compiled
on a newer system than what it runs on, or vice versa.

Fixes: https://github.com/libuv/libuv/issues/2088
Fixes: https://github.com/nodejs/node/issues/24521
PR-URL: https://github.com/libuv/libuv/pull/2092
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agounix: zero epoll_event before use
Ashe Connor [Wed, 19 Sep 2018 06:36:47 +0000 (16:36 +1000)]
unix: zero epoll_event before use

Valgrind will emit the following error on a system where `int` is 32
bits:

==21616== Syscall param epoll_ctl(event) points to uninitialised byte(s)
==21616==    at 0x693E06A: epoll_ctl (syscall-template.S:84)
==21616==    by 0x529F35B: uv__io_poll (in .../libuv/libuv.so)
==21616==    by 0x528AE62: uv_run (in .../libuv/libuv.so)
[...]
==21616==  Address 0x1ffeffc8ec is on thread 1's stack
==21616==  in frame #1, created by uv__io_poll (???:)

We only initialise e.events and e.data.fd, meaning half of
e.data (the 32 bits not covered by the 4-byte `fd`) is
uninitialised.

PR-URL: https://github.com/libuv/libuv/pull/1996
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
3 months agogitignore: ignore build/ directory
Damon Kwok [Mon, 19 Nov 2018 10:00:48 +0000 (18:00 +0800)]
gitignore: ignore build/ directory

PR-URL: https://github.com/libuv/libuv/pull/2081
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
3 months agotest: fix platform_output test on cygwin
damon-kwok [Fri, 16 Nov 2018 06:50:02 +0000 (14:50 +0800)]
test: fix platform_output test on cygwin

Fixes: https://github.com/libuv/libuv/issues/2077
PR-URL: https://github.com/libuv/libuv/pull/2081
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agoNow working on version 1.24.1
cjihrig [Tue, 13 Nov 2018 04:57:04 +0000 (23:57 -0500)]
Now working on version 1.24.1

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

4 months agoAdd SHA to ChangeLog
cjihrig [Tue, 13 Nov 2018 04:55:23 +0000 (23:55 -0500)]
Add SHA to ChangeLog

4 months ago2018.11.14, Version 1.24.0 (Stable) v1.24.0
cjihrig [Tue, 13 Nov 2018 04:55:22 +0000 (23:55 -0500)]
2018.11.14, Version 1.24.0 (Stable)

Changes since version 1.23.2:

* unix: do not require PATH_MAX to be defined (Brad King)

* win,doc: path encoding in uv_fs_XX is UTF-8 (hitesh)

* unix: add missing link dependency on kFreeBSD (Svante Signell)

* unix: add support for GNU/Hurd (Samuel Thibault)

* test: avoid memory leak for test_output (Carlo Marcelo Arenas Belón)

* zos: avoid UB with NULL pointer arithmetic (Carlo Marcelo Arenas
  Belón)

* doc: add vtjnash to maintainers (Jameson Nash)

* unix: restore skipping of phys_addr copy (cjihrig)

* unix,win: make uv_interface_addresses() consistent (cjihrig)

* unix: remove unnecessary linebreaks (cjihrig)

* unix,win: handle zero-sized allocations uniformly (Ben Noordhuis)

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

* core,bsd: refactor process_title functions (Santiago Gimeno)

* win: Redefine NSIG to consider SIGWINCH (Jeremy Studer)

* test: make sure that reading a directory fails (Sakthipriyan
  Vairamani)

* win, tty: remove zero-size read callbacks (Bartosz Sosnowski)

* test: fix test runner getenv async-signal-safety (Ben Noordhuis)

* test: fix test runner execvp async-signal-safety (Ben Noordhuis)

* test,unix: fix race in test runner (Ben Noordhuis)

* unix,win: support IDNA 2008 in uv_getaddrinfo() (Ben Noordhuis)

* win, tcp: avoid starving the loop (Bartosz Sosnowski)

* win, dl: proper error messages on some systems (Bartosz Sosnowski)

* win,fs: retry if uv_fs_rename fails (Bartosz Sosnowski)

* darwin: speed up uv_set_process_title() (Ben Noordhuis)

* aix: fix race in uv_get_process_title() (Gireesh Punathil)

* win: support more fine-grained windows hiding (Bartosz Sosnowski)

4 months agowin: support more fine-grained windows hiding
Bartosz Sosnowski [Fri, 9 Nov 2018 20:49:18 +0000 (21:49 +0100)]
win: support more fine-grained windows hiding

Added UV_PROCESS_WINDOWS_HIDE_CONSOLE and
UV_PROCESS_WINDOWS_HIDE_GUI for specifying if console or GUI
subprocess windows are to be hidden.

Refs: https://github.com/nodejs/node/pull/24034
PR-URL: https://github.com/libuv/libuv/pull/2073
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agoaix: fix race in uv_get_process_title()
Gireesh Punathil [Tue, 6 Nov 2018 15:29:32 +0000 (10:29 -0500)]
aix: fix race in uv_get_process_title()

The length calculation of the title string was
performed outside of the mutex, causing data corruption
in heavily contended scenarios. Move the length
computation to within the mutex block

Fixes: https://github.com/libuv/libuv/issues/2063
PR-URL: https://github.com/libuv/libuv/pull/2069
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agodarwin: speed up uv_set_process_title() 2064/head
Ben Noordhuis [Fri, 2 Nov 2018 15:48:55 +0000 (16:48 +0100)]
darwin: speed up uv_set_process_title()

Libuv loaded and unloaded the Core Services and Application Services for
every call to uv_set_process_title().

Change that to load them on the first call to uv_set_process_title() and
delay unloading until libuv is unloaded.

Speeds up process_title_threadsafe by about 10x on my system.

PR-URL: https://github.com/libuv/libuv/pull/2064
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 months agowin,fs: retry if uv_fs_rename fails
Bartosz Sosnowski [Thu, 6 Sep 2018 12:21:24 +0000 (14:21 +0200)]
win,fs: retry if uv_fs_rename fails

On Windows rename operation can fail randomly in presence of antivirus
or indexing software. Make `uv_fs_rename` retry up to four times with
250ms delay between attempts before giving up.

PR-URL: https://github.com/libuv/libuv/pull/1981
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agowin, dl: proper error messages on some systems
Bartosz Sosnowski [Tue, 23 Oct 2018 13:44:37 +0000 (15:44 +0200)]
win, dl: proper error messages on some systems

On some localized Windows 10 machines FormatMessage can fail with
ERROR_RESOURCE_TYPE_NOT_FOUND when trying to generate dlopen error
message. This adds support for this corner case.

PR-URL: https://github.com/libuv/libuv/pull/2052
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agowin, tcp: avoid starving the loop
Bartosz Sosnowski [Thu, 1 Nov 2018 10:10:03 +0000 (11:10 +0100)]
win, tcp: avoid starving the loop

Limit the time a TCP read callback can be called on a single loop
iteration to 32.

Ref: https://github.com/libuv/libuv/commit/738b31eb3aff440ae75ff9f32ba61086a948c3f4
Fixes: https://github.com/libuv/libuv/issues/2027
PR-URL: https://github.com/libuv/libuv/pull/2049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
4 months agounix,win: support IDNA 2008 in uv_getaddrinfo() 2046/head
Ben Noordhuis [Fri, 19 Oct 2018 23:28:16 +0000 (01:28 +0200)]
unix,win: support IDNA 2008 in uv_getaddrinfo()

Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.

This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.

Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
4 months agotest,unix: fix race in test runner 2056/head
Ben Noordhuis [Mon, 29 Oct 2018 11:44:40 +0000 (12:44 +0100)]
test,unix: fix race in test runner

The test runner inserted a 250 ms delay to give helper processes time to
settle. That's intrinsically race-y and caused tests to intermittently
fail on platforms like AIX.

Instead of a fixed delay, pass a file descriptor to the helper process
and wait until it closes the descriptor. That way we know for sure the
process has started.

Incidentally, this change reduces the running time of the test suite
from 112 to 26 seconds on my machine.

Fixes: https://github.com/libuv/libuv/issues/2041
PR-URL: https://github.com/libuv/libuv/pull/2056
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>