Commit Graph

3815 Commits

Author SHA1 Message Date
Ben Noordhuis
ce56a85b19 unix: make uv_poll_stop() remove fd from pollset
Avoid repeated wake-ups in `uv__io_poll()` when the previously watched
file descriptor has been duplicated (with `dup(2)`) and then closed.

Because epoll reports events for _file descriptions_ rather than _file
descriptors_, events on the duplicated file descriptor cause the event
loop to wake up.

Libuv then tries to unregister the event listener for the original file
descriptor but that fails with EBADF because the file descriptor is
closed.

Since libuv uses epoll in level-triggered mode, it effectively results
in a busy loop because the event is re-reported as soon as libuv calls
epoll_wait() again.

I tried hard to write a test case for this but there is no directly
observable behavior, only increased CPU usuage.

Fixes: https://github.com/libuv/libuv/issues/1148
PR-URL: https://github.com/libuv/libuv/pull/1468
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-08-10 16:20:40 +02:00
cjihrig
3af5512950 doc: differentiate SmartOS and SunOS support
Refs: https://github.com/libuv/libuv/pull/991
Refs: https://github.com/libuv/libuv/issues/1458
PR-URL: https://github.com/libuv/libuv/pull/1469
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-08-09 16:24:14 -04:00
Maciej Szeptuch (Neverous)
6827fa3451 win: allow bound/connected socket in uv_tcp_open()
On Unix you can pass bound and even connected socket to uv_tcp_open
and it will work as expected: you can run uv_listen or other io
functions (uv_read, uv_write) on it without problems.
On windows on the other hand the function always assumes to have clean
socket and for example uv_listen will try to bind it again, and
uv_read/write will return with errors about unreadable streams
(basically invalid internal flags).

To check if socket is already bound uv_tcp_getsockname is called which
on windows returns error when socket is unbound. To further
differentiate connected one from just bound, uv_tcp_getpeername also
returns error but when target socket is not connected.

PR-URL: https://github.com/libuv/libuv/pull/1447
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-08 17:19:20 +02:00
John Barboza
371ca6d4b2 zos: read more accurate rss info from RSM
More accurate Resident Set Size (Central Storage size on Z)
is stored in the MVS Data Areas managed by the RSM (Real
Storage Manager).

PR-URL: https://github.com/libuv/libuv/pull/1244
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-08 15:19:24 +02:00
Jacob Segal
095e07cd79 android: fix blocking recvmsg due to netlink bug
Code was assuming that the nl_pid was always equal to the process id.
As the netlink documentation says, "nl_pid is usually the PID of the
process owning the destination socket. However, nl_pid identifies a
netlink socket, not a process".

There are two cases in which this assumption breaks down. The first is
that some other part of the application has already bound a netlink
socket with a nl_pid equal to the PID of the process. The second is
Android version 5.0 where it appears that nl_pid is not always defaulted
to the PID of the process.

The result of this bad assumption is that netlink message responses to
our request are ignored due to having a bad nl_pid. We eventually run
out of messages on the netlink socket and block forever awaiting our
response.

PR-URL: https://github.com/libuv/libuv/pull/1451
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-08 15:06:24 +02:00
John Barboza
04adefafdf zos: fix hr timer resolution
One tick on the high resolution clock (TOD clock) on z/OS
is equivalent to (1/4.096) nanoseconds.

PR-URL: https://github.com/libuv/libuv/pull/1453
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-08-08 15:03:57 +02:00
John Barboza
f9823e5c12 test,zos: use gid=-1 to test spawn_setgid_fails
This is because on some platforms like z/OS, setgid(0) is
allowed for non-superusers. So instead, use setgid(-1) to
get UV_EINVAL to test that spawn failure returns the right
return code.

PR-URL: https://github.com/libuv/libuv/pull/1456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-08-08 15:03:07 +02:00
John Barboza
5e2fbe5994 test,zos: skip chown root test
z/OS allows non root users to chown a file to root via the
CHOWN.UNRESTRICTED profile. So avoid that test on z/OS.

PR-URL: https://github.com/libuv/libuv/pull/1454
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-08-08 15:02:48 +02:00
Ben Noordhuis
4646428def doc: update supported windows version baseline
Update the baseline from Windows XP SP1 to Windows 8.1

PR-URL: https://github.com/libuv/libuv/pull/1436
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-08-08 14:57:56 +02:00
Bartosz Sosnowski
bded0fa4f0 win, test: fix double close in test runner
Fixes: https://github.com/libuv/libuv/issues/1426
Credit: Tom Seddon <github@tomseddon.plus.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-07 14:56:20 +02:00
John Barboza
3c6f9e54ef unix: add missing semicolon
PR-URL: https://github.com/libuv/libuv/pull/1444
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-29 15:41:29 +02:00
Saúl Ibarra Corretgé
3b1e836abd doc: add Android as a tier 3 supported platform
PR-URL: https://github.com/libuv/libuv/pull/1442
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-28 22:54:34 +02:00
Ben Noordhuis
19e51ae51f doc: document uv_async_(init|send) return values
Fixes: https://github.com/libuv/libuv/issues/576
PR-URL: https://github.com/libuv/libuv/pull/1435
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-27 17:54:45 +02:00
Bartosz Sosnowski
cbcf13af6a win, process: support semicolons in PATH variable
Fixes a bug that would cause libuv to crash when PATH environment
variable contained paths with semicolon in it

Refs: https://github.com/nodejs/help/issues/728
Fixes: https://github.com/libuv/libuv/issues/1422
PR-URL: https://github.com/libuv/libuv/pull/1438
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-27 12:34:31 +02:00
Saúl Ibarra Corretgé
cf6d047e84 doc: update instructions for building on Android
PR-URL: https://github.com/libuv/libuv/pull/1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-27 00:46:02 +02:00
Saúl Ibarra Corretgé
27dcbd6ff4 android: remove no longer needed check
The latest NDK (r15 at the time of this writing) no longer needs this.
`pthread_cond_timedwait` is available at any (reasonable) API level.

PR-URL: https://github.com/libuv/libuv/pull/1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-27 00:46:02 +02:00
Saúl Ibarra Corretgé
b6e6207c75 android: fix detection of pthread_condattr_setclock
It's only available on API level >= 21.

PR-URL: https://github.com/libuv/libuv/pull/1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-27 00:46:02 +02:00
Bartosz Sosnowski
e5024c54a1 win, fs: support unusual reparse points
Allow for running uv_fs_stat and uv_fs_lstat on all reparse points

Ref: https://github.com/nodejs/node/issues/12737
PR-URL: https://github.com/libuv/libuv/pull/1419
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-26 13:24:41 +02:00
Saúl Ibarra Corretgé
33e6f79088 misc: add android-toolchain to .gitignore
PR-URL: https://github.com/libuv/libuv/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-25 22:51:36 +02:00
Saúl Ibarra Corretgé
7dabd57af4 android: fix compilation with new NDK versions
Fixes compiling with Android NDK when using Unified Headers (default
since r15).

Fixes: https://github.com/libuv/libuv/issues/1417
PR-URL: https://github.com/libuv/libuv/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-25 22:50:39 +02:00
Anticrisis
cf38297b60 docs: fix guide source code example paths
Source code examples in the User guide were not appearing in the built
documentation because the relative paths were incorrect.

PR-URL: https://github.com/libuv/libuv/pull/1428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-25 00:28:17 +02:00
Saúl Ibarra Corretgé
9e6feb69ac misc: remove reference to pthread-fixes.h from LICENSE
PR-URL: https://github.com/libuv/libuv/pull/1432
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-25 00:04:57 +02:00
Saúl Ibarra Corretgé
e25b5a5b2c zos: remove nonexistent include from autotools build
PR-URL: https://github.com/libuv/libuv/pull/1432
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-25 00:03:56 +02:00
Ben Noordhuis
fabe3d2c33 github: fix link to help repo in issue template
PR-URL: https://github.com/libuv/libuv/pull/1431
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-24 10:37:01 +02:00
Saúl Ibarra Corretgé
01b23314cc win,build: fix building from Windows SDK or VS console
Introduced in
2f6d4b4b58 and accidentally undone in
19c896dd08.

PR-URL: https://github.com/libuv/libuv/pull/1415
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-22 18:22:40 +02:00
XadillaX
f1e0fc43d1 unix: fix wrong MAC of uv_interface_address
fix a wrong `if` in `uv_interface_address` about MAC.

Fixes: https://github.com/nodejs/node/issues/13581
PR-URL: https://github.com/libuv/libuv/pull/1375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-17 13:34:02 +02:00
Ben Noordhuis
8e76306ec2 unix, windows: map EREMOTEIO errno
PR-URL: https://github.com/libuv/libuv/pull/1424
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-17 13:31:58 +02:00
Gireesh Punathil
810377f489 aix: add netmask, mac address into net interfaces
uv_interface_addresses API extracts the network interface entries.
In AIX, this was not fully implemented. retrieve the network mask and
the mac addresses.

Fixes: https://github.com/nodejs/node/issues/14119
PR-URL: https://github.com/libuv/libuv/pull/1410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-13 23:10:29 +02:00
Ben Noordhuis
1e6f1159cf win: include filename in dlopen error message
Should make the dreaded "%1 is not a valid Win32 application" error
message a thing of the past.

PR-URL: https://github.com/libuv/libuv/pull/1116
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-13 23:06:11 +02:00
Refael Ackermann
8807fd371d win,build: fix appveyor properly
Refs: https://github.com/appveyor/ci/issues/1649
Refs: https://github.com/libuv/libuv/pull/1284
Refs: https://github.com/libuv/libuv/pull/1405
PR-URL: https://github.com/libuv/libuv/pull/1418
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-13 14:18:16 -04:00
CurlyMoo
d731fd1bd9 poll: add support for OOB TCP and GPIO interrupts
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.

Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.

PR-URL: https://github.com/libuv/libuv/pull/1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-12 23:04:34 +02:00
Matthew Taylor
78c17238f4 unix: always copy process title into local buffer
Ensures that the user's argv is copied into a local buffer when calling
uv_setup_args. Before, the argv was simply being pointed to, which
meant that libuv could end up accessing invalid memory if the user
decided to later edit the memory at that location. It also meant that a
subsequent call to uv_set_process_title would never write more
characters than the length of argv[0].

With the new changes, argv[0] is copied into a temporary buffer and any
subsequent calls to uv_set_process_title will thus be able to copy as
many characters as the call to uv__strdup permits. Note that on *BSD
and AIX this behaviour was already in effect .

Some error checking (specifically checking the result of uv__strdup)
has been added, and calls to uv__free rearranged so that in case of
ENOMEM uv__free can't be called erroneously.

Fixes: https://github.com/libuv/libuv/issues/1395
PR-URL: https://github.com/libuv/libuv/pull/1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-12 09:45:14 -04:00
Matthew Taylor
bdc87005a1 doc: add thread safety warning for process title
Add a small warning about uv_get_process_title()
and uv_set_process_title() not being thread safe on platforms
other than Windows. Also add a reminder for users to call
uv_setup_args() first.

Fixes: https://github.com/libuv/libuv/issues/1395
PR-URL: https://github.com/libuv/libuv/pull/1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-12 09:42:44 -04:00
André Klitzing
ad1c828827
unix: check for NULL in uv_os_unsetenv for parameter name
Fixes segfault of unit test on musl (AlpineLinux).
Add a check for parameter like uv_os_setenv do.

PR-URL: https://github.com/libuv/libuv/pull/1409
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-09 16:35:29 +02:00
cjihrig
d63030b0ba Now working on version 1.13.2 2017-07-06 18:49:48 -04:00
cjihrig
54ef335267 Add SHA to ChangeLog 2017-07-06 18:42:36 -04:00
cjihrig
2bb4b68758 2017.07.07, Version 1.13.1 (Stable)
Changes since version 1.13.0:

* Now working on version 1.13.1 (cjihrig)

* build: workaround AppVeyor quirk (Refael Ackermann)
2017-07-06 18:42:36 -04:00
Refael Ackermann
87ae1b490e build: workaround AppVeyor quirk
This commit fixes the AppVeyor issues seen while trying to
release v1.13.0 on Windows.

Refs: https://github.com/libuv/libuv/issues/1397
Refs: https://github.com/libuv/libuv/pull/1284
PR-URL: https://github.com/libuv/libuv/pull/1405
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-06 18:33:18 -04:00
cjihrig
a7aa057113 Now working on version 1.13.1 2017-07-05 16:47:53 -04:00
cjihrig
d3a958d444 Add SHA to ChangeLog 2017-07-05 11:55:40 -04:00
cjihrig
8342fcaab8 2017.07.06, Version 1.13.0 (Stable)
Changes since version 1.12.0:

* Now working on version 1.12.1 (cjihrig)

* unix: avoid segfault in uv_get_process_title (Michele Caini)

* build: add a comma to uv.gyp (Gemini Wen)

* win: restore file pos after positional read/write (Bartosz Sosnowski)

* unix,stream: return error on closed handle passing (Santiago Gimeno)

* unix,benchmark: use fd instead of FILE* after fork (jBarz)

* zos: avoid compiler warnings (jBarz)

* win,pipe: race condition canceling readfile thread (Jameson Nash)

* sunos: filter out non-IPv4/IPv6 interfaces (Sebastian Wiedenroth)

* sunos: fix cmpxchgi and cmpxchgl type error (Sai Ke WANG)

* unix: reset signal disposition before execve() (Ben Noordhuis)

* unix: reset signal mask before execve() (Ben Noordhuis)

* unix: fix POLLIN assertion on server read (jBarz)

* zos: use stckf builtin for high-res timer (jBarz)

* win,udp: implements uv_udp_try_send (Barnabas Gema)

* win,udp: return UV_EINVAL instead of aborting (Romain Caire)

* freebsd: replace kvm with sysctl (Robert Ayrapetyan)

* aix: fix un-initialized pointer field in fs handle (Gireesh Punathil)

* win,build: support building with VS2017 (Refael Ackermann)

* doc: add instructions for building on Windows (Refael Ackermann)

* doc: format README (Refael Ackermann)
2017-07-05 11:55:39 -04:00
Refael Ackermann
80d3b95f57 doc: format README
PR-URL: https://github.com/libuv/libuv/pull/1284
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-04 22:40:14 +02:00
Refael Ackermann
0953bf0dad doc: add instructions for building on Windows
PR-URL: https://github.com/libuv/libuv/pull/1284
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-04 22:38:27 +02:00
Refael Ackermann
19c896dd08 win,build: support building with VS2017
Detection is attempted with `vswhere`.

PR-URL: https://github.com/libuv/libuv/pull/1284
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-04 22:36:50 +02:00
Gireesh Punathil
09444560fe aix: fix un-initialized pointer field in fs handle
On AIX, uv_fs_event_start() didn't always initialize
handle->dir_filename. In this scenario, uv_fs_event_stop()
would free the uninitialized pointer. This commit
initialized handle->dir_filename to NULL in all cases.

Fixes: https://github.com/nodejs/node/issues/13577
PR-URL: https://github.com/libuv/libuv/pull/1400
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-04 12:46:23 -04:00
Robert Ayrapetyan
4987b6325b
freebsd: replace kvm with sysctl
PR-URL: https://github.com/libuv/libuv/pull/1377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-01 18:10:21 +02:00
Romain Caire
500a1f96eb
win,udp: return UV_EINVAL instead of aborting
PR-URL: https://github.com/libuv/libuv/pull/1385
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-01 17:21:26 +02:00
Barnabas Gema
c33fe9874a
win,udp: implements uv_udp_try_send
PR-URL: https://github.com/libuv/libuv/pull/1385
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-01 17:20:15 +02:00
John Barboza
4776195cdf zos: use stckf builtin for high-res timer
Instead of gettimeofday which is too heavy for a fast
monotonic clock implementation.

PR-URL: https://github.com/libuv/libuv/pull/1394
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-01 01:04:59 +02:00
John Barboza
391e818c4a unix: fix POLLIN assertion on server read
Certain systems like z/OS have more than one bit turned
on for POLLIN events. (e.g. #define POLLIN 0x03).
Asserting that all bits are turned on would be invalid.
Instead, assert that *any* of those bits are turned on.

PR-URL: https://github.com/libuv/libuv/pull/1390
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-01 00:53:17 +02:00