Commit Graph

2323 Commits

Author SHA1 Message Date
Timothy J Fontaine
714bec14f6 Now working on v0.10.26 2014-02-18 13:01:54 -08:00
Timothy J Fontaine
d778dc5885 2014.02.19, Version 0.10.25 (Stable)
Changes since version 0.10.24:

* stream: start thread after assignments (Oguz Bastemur)

* unix: correct error when calling uv_shutdown twice (Saúl Ibarra
  Corretgé)

* windows: freeze in uv_tcp_endgame (Alexis Campailla)

* sunos: handle rearm errors (Fedor Indutny)
2014-02-18 13:01:51 -08:00
Fedor Indutny
703a9e601e sunos: handle rearm errors
fix #1078
2014-02-19 00:14:13 +04:00
Alexis Campailla
4f913b669a windows: freeze in uv_tcp_endgame
The event_handle field of unused accept requests was not being
initialized properly. As a result, uv_tcp_endgame would try to close
an invalid handle and this could lead to unexpected behavior.

This fixes node.js test test-cluster-disconnect.js on Windows.
2014-02-18 19:16:47 +01:00
Saúl Ibarra Corretgé
6e2021ca11 unix: correct error when calling uv_shutdown twice
This is a backport of a284b90 for v0.10 branch
2014-02-15 16:55:06 +01:00
Oguz Bastemur
a6ff04d2c4 stream: start thread after assignments
Changed the order of the member assignments since the thread
may start before the parameters are assigned. This especially
happens when the osx scheduler is very busy.
2014-01-31 20:53:06 +04:00
Timothy J Fontaine
79ffe2fb95 Now working on v0.10.25 2014-01-29 09:41:41 -08:00
Timothy J Fontaine
aecd296b6b 2014.01.30, Version 0.10.24 (Stable)
Changes since version 0.10.23:

* linux: move sscanf() out of the assert() (Trevor Norris)

* linux: fix C99/C++ comment (Fedor Indutny)
2014-01-29 09:41:36 -08:00
Fedor Indutny
3e2446d18d linux: fix C99/C++ comment 2014-01-29 17:01:35 +04:00
Trevor Norris
7c8ff3bc25 linux: move sscanf() out of the assert()
If asserts are turned off then the sscanf() wouldn't have run, being
placed directly in the assert() itself.
2014-01-29 17:01:26 +04:00
Bert Belder
b8b6588dbe Now working on v0.10.24 2014-01-22 20:30:26 +01:00
Bert Belder
dbd218e699 2014.01.23, Version 0.10.23 (Stable)
Changes since version 0.10.22:

* linux: relax assumption on /proc/stat parsing (Luca Bruno)

* openbsd: fix obvious bug in uv_cpu_info (Fedor Indutny)

* process: close stdio after dup2'ing it (Fedor Indutny)
2014-01-22 20:30:14 +01:00
Fedor Indutny
e403a2c486 process: close stdio after dup2'ing it
Thus allow passing the same file descriptor as the source of multiple
stdios.

Committed with the help and code parts from:

  * Sam Roberts <sam@strongloop.com>

fix #1074
2014-01-22 22:39:08 +04:00
Fedor Indutny
8bc29b6f5f openbsd: fix obvious bug in uv_cpu_info
`int which[]` should not be static here, as the function itself is
changing it

fix joyent/node#6878
2014-01-21 15:06:30 +04:00
Luca Bruno
993151bc40 linux: relax assumption on /proc/stat parsing
CPU entries in /proc/stat are not guaranteed to be monotonically
increasing, asserting on this assumption can break in cases such
as the UltraSparc II machine shown in #1080.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-01-20 08:45:34 -08:00
Timothy J Fontaine
97eda7fd62 Now working on v0.10.23 2014-01-07 14:03:18 -08:00
Timothy J Fontaine
f526c90eef 2014.01.08, Version 0.10.22 (Stable)
Changes since version 0.10.21:

* windows: avoid assertion failure when pipe server is closed (Bert
  Belder)
2014-01-07 14:03:15 -08:00
Alex Crichton
f6422af80a osx: Fix a possible segfault in uv__io_poll
In our build infrastructure, I've seen a lot of segfaults recently that
were all only happening on OSX. Upon inspecting the coredumps, it
appearded that all segfaults happened at the same instruction, and upon
translating the assembly back to the source, I found that an array could
be indexed with a -1 index before the index was checked to be not -1.

As concrete evidence, here is the situation that I found caused the
segfault.  The instruction in question along with the relevant register
values was:

    mov    (%r8,%r15,8),%r12

    r8  = 0x7fb0ba800000
    r15 = 0xffffffffffffffff

    r8 + r15 * 8 == 0x7fb0ba7ffff8

It appears that the base of loop->watchers was page aligned, and by
going back one word I guess that the page wasn't mapped, causing our
segfaults.
2013-12-22 03:53:49 -08:00
Bert Belder
16c4b21e4d test: make test-pipe-server-close pass on linux
When a server and a client are both part of the same event loop, and
the client connects to the server, the order in which the connect
callback and the connection callback are called is unspecified.
Apparently on linux the connection callback sometimes happens first,
which is not a bug, and should not make this test fail.
2013-12-21 02:34:44 -08:00
Bert Belder
c66340d59b test: add pipe-server-close test
Add a regression test for the pipe server close issue on Windows, which
was reported in joyent/node#6749 and fixed in 7b16a3f.
2013-12-20 19:40:02 -08:00
Bert Belder
562d7a49ac code style: strip trailing whitespace 2013-12-20 19:38:37 -08:00
Bert Belder
7b16a3f508 windows: avoid assertion failure when pipe server is closed
When a pipe server is closed, all pending accept requests and their
associated HANDLEs are closed to force windows to cancel the
ConnectNamedPipe IRP. The returned request has the `pipeHandle` field
set to INVALID_HANDLE_VALUE, which trips an assert in
uv_pipe_process_accept_req. This patch fixes that.
2013-12-20 17:45:49 -08:00
Timothy J Fontaine
9d60214b3a Now working on v0.10.22 2013-12-18 15:37:33 -08:00
Timothy J Fontaine
375ebce068 2013.12.19, Version 0.10.21 (Stable)
Changes since version 0.10.20:

* unix: fix a possible memory leak in uv_fs_readdir (Alex Crichton)
2013-12-18 15:37:25 -08:00
Alex Crichton
7c6bddbe2a unix: fix a possible memory leak in uv_fs_readdir
Some scandir implementations allocate the dirent struct even if the
directory is empty, so if `scandir` returns 0 there may still be memory
that needs to get deallocated. I have altered uv__fs_readdir to go to
the "deallocation exit area" when 0 files are found in the directory
and continue to return early on a return value of -1.

I went to add a test for this functionality, but it appears that one
already exists (reading an empty directory), so I imagine that the
valgrind builds must only be happening on linux instead of OSX as well?
I have confirmed manually that a program without this fix will
infinitely leak memory, and with this fix the memory usage stays
constant.
2013-12-18 12:05:47 +04:00
Timothy J Fontaine
f3d311edc4 Now working on v0.10.21 2013-12-11 20:22:00 -08:00
Timothy J Fontaine
04141464dd 2013.12.13, Version 0.10.20 (Stable)
Changes since version 0.10.19:

* linux: fix up SO_REUSEPORT back-port (Ben Noordhuis)

* fs-event: fix invalid memory access (huxingyi)
2013-12-11 20:21:57 -08:00
huxingyi
da32344730 fs-event: fix invalid memory access
file_info->FileName is not null terminated.
2013-11-29 20:57:35 -08:00
Alex Gaynor
47d98b64c4 doc: Removed use of gendered pronouns 2013-11-29 16:25:01 -08:00
Ben Noordhuis
7bb7371fc5 build: make ./gyp_uv.py -f eclipse work
The eclipse backend (like the ninja backend) does not support the
--generator_output switch.
2013-11-27 17:28:03 +01:00
Ben Noordhuis
74457d08ba linux: fix up SO_REUSEPORT back-port
Commit 3d2c820 back-ports a patch from the master branch that disables
the use of SO_REUSEPORT on Linux for reasons mentioned in the commit
log.

Unfortunately, the back-port was incomplete; another setsockopt() call
site in src/unix/udp.c was overlooked.  This commit rectifies that.

Hat tip to Luca Bruno for helping troubleshoot the issue.
2013-11-25 16:18:01 +01:00
Marc Schlaich
c3e05bafa5 gitignore: ignore *.pyc files
The gyp build on Windows produces a *.pyc file as of commit 991409e.
2013-11-25 16:27:28 +01:00
Ben Noordhuis
a43537eead test: back-port EMFILE test from master branch
Back-port the test from commit 27795cf from the master branch ("unix:
fix accept() EMFILE error handling").
2013-11-25 12:58:39 +01:00
Ben Noordhuis
026241ca67 unix: unbreak bsd build after bbccafb
Unbreak the build on the BSDs after commit bbccafb.  Move the new
uv__platform_invalidate_fd() function from src/unix/darwin.c to
src/unix/kqueue.c.
2013-11-13 12:20:09 +01:00
Timothy J Fontaine
1578a5a371 Now working on v0.10.20 2013-11-12 10:54:29 -08:00
Timothy J Fontaine
33959f7524 2013.11.13, Version 0.10.19 (Stable)
Changes since version 0.10.18:

* darwin: avoid calling GetCurrentProcess (Fedor Indutny)

* unix: update events from pevents between polls (Fedor Indutny)

* fsevents: support japaneese characters in path (Chris Bank)

* linux: don't turn on SO_REUSEPORT socket option (Ben Noordhuis)

* build: fix windows smp build with gyp (Geert Jansen)

* linux: handle EPOLLHUP without EPOLLIN/EPOLLOUT (Ben Noordhuis)

* unix: fix reopened fd bug (Fedor Indutny)

* core: fix fake watcher list and count preservation (Fedor Indutny)
2013-11-12 10:54:25 -08:00
Fedor Indutny
f50ccd5238 core: fix fake watcher list and count preservation
Fake watcher list and count should be preserved only if
`loop->watchers` was already allocated.
2013-11-12 15:24:33 +04:00
Fedor Indutny
bbccafbe70 unix: fix reopened fd bug
When fd is closed and new one (with the same number) is opened inside
kqueue/epoll/port loop's callback - stale events might invoke callbacks
on wrong watchers.

Check if watcher was changed after invocation and invalidate all events
with the same fd.

fix #826
2013-11-12 15:02:59 +04:00
Ben Noordhuis
0c76cdb98f linux: handle EPOLLHUP without EPOLLIN/EPOLLOUT
Work around an epoll quirk where it sometimes reports just the EPOLLERR
or EPOLLHUP event.  In order to force the event loop to move forward,
we merge in the read/write events that the watcher is interested in;
uv__read() and uv__write() will then deal with the error or hangup in
the usual fashion.

Fixes #982.

This is a back-port of commit 24bfef2 from the master branch.
2013-11-08 05:38:55 +01:00
Geert Jansen
991409e461 build: fix windows smp build with gyp
Gyp will try a parallel build if it detect the system has >1 processor.
This functionality depends on the Python "multiprocessing" package. The
multiprocessing package on Windows requires that the top-level module is
importable as a module, see:

  http://docs.python.org/2/library/multiprocessing.html#windows

This fixes issue #984.

This is a back-port of commit 2445467 from the master branch.
2013-11-05 14:32:45 +01:00
Ben Noordhuis
3d2c820a4e linux: don't turn on SO_REUSEPORT socket option
On the BSDs, SO_REUSEPORT is pretty much SO_REUSEADDR with some special
casing for IP multicast.  When two processes (that don't do multicast)
bind to the same address, only the last one receives traffic.  It allows
one to "steal" the bound address from another process.  (Both processes
have to enable SO_REUSEPORT though, so it only works in a cooperative
setting.)

On Linux however, it enables port sharing, not stealing - both processes
receive a share of the traffic.  This is a desirable trait but pre-3.9
kernels don't support the socket option and a libuv program therefore
behaves differently with older kernels or on another platform.

This is a back-port of commit 9d60f1e from the master branch.

Fixes joyent/node#6454.
2013-10-30 09:41:52 +01:00
Chris Bank
3780e12823 fsevents: support japaneese characters in path 2013-11-02 05:00:50 +04:00
Fedor Indutny
f9960184fd test: add regression test for 29fdb3471 2013-10-31 01:16:02 +04:00
Fedor Indutny
29fdb3471b unix: update events from pevents between polls
Watchers could be stopped between two `kevent()`/`epoll_wait()` calls
(which may happen in the same loop in `uv__io_poll()`), in such cases
`watcher->events` could be stale and won't be updated to
`watcher->pevents`.

Try to use and rely on `watcher->pevents` instead of blindly expecting
`watcher->events` to be always correct.
2013-10-30 12:40:25 +04:00
Fedor Indutny
08e0e63f3a darwin: avoid calling GetCurrentProcess
Use some black-magic from Apple to change process name without getting
a "Not responding" tag from Activity Manager.

fix #966
2013-10-28 20:51:50 +04:00
Timothy J Fontaine
939560b6db Now working on v0.10.19 2013-10-18 13:17:52 -07:00
Timothy J Fontaine
9ec52963b5 2013.10.19, Version 0.10.18 (Stable)
Changes since version 0.10.17:

* unix: fix uv_spawn() NULL pointer deref on ENOMEM (Ben Noordhuis)

* unix: don't close inherited fds on uv_spawn() fail (Ben Noordhuis)

* unix: revert recent FSEvent changes (Ben Noordhuis)

* unix: fix non-synchronized access in signal.c (Ben Noordhuis)
2013-10-18 13:17:48 -07:00
Ben Noordhuis
1800efc138 unix: fix non-synchronized access in signal.c
Check the return value of uv__signal_lock(); don't mutate the signal
watcher tree in the signal handler if we failed to acquire the lock.
2013-10-18 17:10:04 +02:00
Ben Noordhuis
38df93cfed unix: revert recent FSEvent changes
This commit reverts the following commits:

    983fa68 darwin: fix 10.6 build error in fsevents.c
    684e212 fsevents: use shared FSEventStream
    ea4cb77 fsevents: FSEvents is most likely not thread-safe
    9bae606 darwin: create fsevents thread on demand

Several people have reported stability issues on OS X 10.8 and bus
errors on the 10.9 developer preview.

See also joyent/node#6296 and joyent/node#6251.
2013-10-05 18:24:33 +02:00
Ben Noordhuis
11d8011793 unix: don't close inherited fds on uv_spawn() fail
The cleanup-after-error code path in uv_spawn() was closing file
descriptors indiscriminately.  Only close file descriptors that we
created ourselves, not the ones that are passed in by the user.

Fixes joyent/node#6297.
2013-10-02 11:17:20 +02:00