With the non-tap output, it's sometimes difficult to distinguish skipped
tests from test failures.
PR-URL: https://github.com/libuv/libuv/pull/898
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This fixes test-stdio-over-pipes and test-pipe-sendmsg test cases.
~~~~
Assertion failed in test/test-stdio-over-pipes.c on line 56: term_signal == 0
Assertion failed in test/test-pipe-sendmsg.c on line 86: pending == UV_NAMED_PIPE
~~~~
This fixes a longstanding issue with nodejs on DragonFly, which was
triggered whenever spawning a process and pipes were involed.
PR-URL: https://github.com/libuv/libuv/pull/884
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
The _SC_PHYS_PAGES and _SC_AVPHYS_PAGES are not POSIX sysconf values, so
the standart C libraries have no obligation to support it, even on
Linux. Use the Linux sysinfo() system call instead.
PR-URL: https://github.com/libuv/libuv/pull/901
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
It's just an indicator that the operation will happen later, so return
success.
PR-URL: https://github.com/libuv/libuv/pull/892
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
It is not guaranteed which stream will read the data first.
PR-URL: https://github.com/libuv/libuv/pull/807
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
When we send VK_RETURN to make ReadConsole return, a spurious new line
is echoed to the screen. This is pretty visible in Node.js, since it
calls uv_tty_read_start() and uv_tty_read_stop() in rapid succession
during startup.
With this change, we save the screen state just before sending
VK_RETURN, and restore the cursor position as soon as ReadConsole
returns.
PR-URL: https://github.com/libuv/libuv/pull/866
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Since we cancel ReadConsole by sending a newline, the duplicate
handle is no longer necessary.
PR-URL: https://github.com/libuv/libuv/pull/866
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Closing the handle does not make ReadConsoleW exit reliably on
Windows 7 and above. Thus, after switching from line to raw mode,
keypresses were held until enter was pressed. This makes ReadConsoleW
exit by writing a return keypress to its input buffer, similar to
what was already done for raw mode.
Fixes: https://github.com/libuv/libuv/issues/852
PR-URL: https://github.com/libuv/libuv/pull/866
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit adds a previously missing call to
uv__fs_scandir_cleanup() to uv_fs_req_cleanup(). This better
aligns the Windows and Unix implementations.
Fixes: https://github.com/libuv/libuv/issues/873
PR-URL: https://github.com/libuv/libuv/pull/874
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
uv__fs_scandir_cleanup() releases individual directory entries,
but not the container array. This commit frees the array as well.
Fixes: https://github.com/libuv/libuv/issues/873
PR-URL: https://github.com/libuv/libuv/pull/874
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
On unix, scandir() uses the system allocator to allocate memory.
This commit releases the memory with free() instead of uv__free().
uv__free() is still used on Windows, which uses uv__malloc() to
request the memory.
Fixes: https://github.com/libuv/libuv/issues/873
PR-URL: https://github.com/libuv/libuv/pull/874
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
On AIX, if a 'accept' call fails ECONNRESET is set on the socket which
causes uv__emfile_trick to not work as intended and this test to fail.
Fixes: https://github.com/libuv/libuv/issues/845
PR-URL: https://github.com/libuv/libuv/pull/870
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Visual Studio 2015 uses a new database engine, creating temporary
files that should be ignored.
PR-URL: https://github.com/libuv/libuv/pull/869
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This variable is used to select 32 or 64 bit builds when invoking
MSBuild. The Visual C++ Build Tools also use the `platform` variable
name, resulting in a conflict when vcvarsall.bat is called. Thus, it
is necessary to rename it.
Ref: https://github.com/libuv/libuv/issues/839
PR-URL: https://github.com/libuv/libuv/pull/868
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
pthread_attr_setstacksize() expects that the stack size is a multiple of
the page size so make sure that it is.
Fixes a regression introduced in commit 3db07cc ("osx: set the default
thread stack size to RLIMIT_STACK") that made the program abort under
certain configurations; GNU Emacs on OS X apparently sets RLIMIT_STACK
to odd values when executing child processes.
Fixes: https://github.com/nodejs/node/issues/6563
PR-URL: https://github.com/libuv/libuv/pull/864
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
- take a size parameter
- always null terminate the buffer
- nullify the output parameter in case of error
PR-URL: https://github.com/libuv/libuv/pull/859
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Instead of doing it instead Makefile.am, this fixes libuv.pc on MinGW.
Previous version generates libuv.pc with LIBS = "-lpthread" instead of
"-lpthread -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv" on MinGW.
Previous version generates the following Makefile.am:
am__append_4 = -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv
...
LIBS = -lpthread $(am__append_4)
and the following configure.ac:
AS_IF([test "x$PKG_CONFIG" != "x"], [
AC_CONFIG_FILES([libuv.pc])
])
AC_CONFIG_FILES([Makefile])
Therefore, Makefile is generated after libuv.pc. Variables from
Makefile don't affect config.status and libuv.pc.
PR-URL: https://github.com/libuv/libuv/pull/841
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
`POLLHDRUP` is not implemented on AIX. Therefore `UV_DISCONNECT` will
never be set on `events`. This causes the socket to never be closed and
the tests to be stuck inside `pollset_poll` indefinitely, resulting in a
timeout.
This fixes the following tests:
- poll_duplex
- poll_unidirectional
Updated docs to let end users know that `UV_DISCONNECT` can be set, but
is unsupported on AIX.
Fixes: https://github.com/libuv/libuv/issues/844
PR-URL: https://github.com/libuv/libuv/pull/857
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
The code for handling fs events is quite complex, this commits tries to
make it easier to follow.
First, there are 2 cases in which we use the name of the file straight
from the event (when watching a directory):
- if we cannot create the long path
- if the file got renamed or removed
So separate this logically, even if the code we need is the same.
Second, one way or anothwer we will always have some filename to report,
so remove an unnecessary if.
Third, nullify filenamew, to avoid having a dangling pointer, should the
code change.
PR-URL: https://github.com/libuv/libuv/pull/858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Cast the `ru_majflt` and `ru_maxrss` field to `unsigned long long` when
printing them with `"%llu"`.
Warnings introduced in commit 6f17a61 ("win: add maxrss, pagefaults to
uv_getrusage()".)
PR-URL: https://github.com/libuv/libuv/pull/855
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
The 'visibility%' gyp variable was designed as an override mechanism for
old (<=3.4) versions of gcc that don't know about -fvisibility=hidden.
It turns out it's fairly easy for embedders to muck up the define, as
witnessed by the fact that node.js is currently leaking internal libuv
symbols due to not properly setting 'visibility%'.
While that could be fixed by tweaking node.js, because we don't support
gcc 3.4 anymore and haven't for a long time, making -fvisibility=hidden
the default here seems all around easier.
PR-URL: https://github.com/libuv/libuv/pull/847
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
There was a memory corruption issue with the pthread barrier
implementation on android, where a barrier could still be in use by one
thread when being freed by another.
This fixes that issue and adds lots of missing error handling.
This implementation is now also used for the OSX fallback.
Fixes: https://github.com/libuv/libuv/issues/615
PR-URL: https://github.com/libuv/libuv/pull/790
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Currently when PATH_MAX is undefined realpath will default to using 4096.
There is a potential stack overflow attack that can be mitigated by having
PATH_MAX defined. This change conservatively errors if a system does not
have PATH_MAX defined.
This change also explicitly includes `limits.h` to ensure that all platforms
have PATH_MAX defined if it is available.
Ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html
Refs: https://github.com/nodejs/node/issues/2680#issuecomment-213521708
PR-URL: https://github.com/libuv/libuv/pull/843
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit populates the ru_majflt and ru_maxrss fields of
uv_getrusage() on Windows.
PR-URL: https://github.com/libuv/libuv/pull/805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The file descriptor that you receive from ahafs has to be part of the
pollset_poll set of interest in order to receive events. This does not
happen until we are in the event loop causing the test to hang and
therefore timeout.
PR-URL: https://github.com/libuv/libuv/pull/838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
uv__close() won't clobber errno so there is no need to guard calls with
a SAVE_ERRNO(...) wrapper.
PR-URL: https://github.com/libuv/libuv/pull/837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Libuv expects that free() does not clobber errno. The system allocator
honors that assumption but custom allocators may not be so careful.
PR-URL: https://github.com/libuv/libuv/pull/837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>