libuv/src/unix
Alex Crichton f166d6d705 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 15:54:08 +04:00
..
aix.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
async.c unix: sanity-check fds before closing 2013-10-01 03:55:54 +02:00
atomic-ops.h unix: add atomic-ops.h 2013-10-20 13:58:34 +02:00
core.c unix, windows: add uv_loop_alive() function 2013-12-19 15:35:03 -08:00
darwin-proctitle.c Merge branch 'v0.10' 2013-10-28 20:59:10 +04:00
darwin.c unix: fix various memory leaks and undef behavior 2013-12-07 02:29:43 +04:00
dl.c openbsd: fix dlerror() const correctness warning 2013-08-05 02:45:59 +02:00
freebsd.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
fs.c Merge branch 'v0.10' 2013-12-20 17:48:28 -08:00
fsevents.c unix: fix various memory leaks and undef behavior 2013-12-07 02:29:43 +04:00
getaddrinfo.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
internal.h fsevents: remove kFSEventStreamCreateFlagNoDefer polyfill 2013-11-23 12:20:30 +04:00
kqueue.c osx: Fix a possible segfault in uv__io_poll 2013-12-22 15:54:08 +04:00
linux-core.c Merge branch 'v0.10' 2013-11-12 15:30:54 +04:00
linux-inotify.c unix, windows: add uv_fs_event_start/stop functions 2013-10-12 20:37:05 +02:00
linux-syscalls.c linux: move files out of src/unix/linux 2013-01-29 17:07:41 +01:00
linux-syscalls.h unix: support for android builds 2013-05-25 21:16:52 +02:00
loop-watcher.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
loop.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
netbsd.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
openbsd.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
pipe.c include: remove uv_strlcat() and uv_strlcpy() 2013-11-03 03:50:23 +01:00
poll.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
process.c unix: return exec errors from uv_spawn, not async 2013-11-07 22:10:38 +01:00
proctitle.c unix: clean up __attribute__((quux)) usage 2013-08-12 07:41:49 +02:00
pthread-fixes.c unix: support for android builds 2013-05-25 21:16:52 +02:00
signal.c unix: fix various memory leaks and undef behavior 2013-12-07 02:29:43 +04:00
spinlock.h unix: add spinlock.h 2013-10-20 13:58:34 +02:00
stream.c stream: allow multiple buffers for uv_try_write 2013-12-13 22:59:47 +04:00
sunos.c Merge branch 'v0.10' 2013-11-12 15:30:54 +04:00
tcp.c unix: sanity-check fds before closing 2013-10-01 03:55:54 +02:00
thread.c linux: use CLOCK_MONOTONIC_COARSE if available 2013-10-29 21:24:42 +01:00
threadpool.c unix: clean up __attribute__((quux)) usage 2013-08-12 07:41:49 +02:00
timer.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
tty.c unix: make uv_tty_reset_mode() async signal-safe 2013-10-20 13:58:34 +02:00
udp.c linux: fix up SO_REUSEPORT back-port 2013-11-25 16:18:01 +01:00
uv-dtrace.d unix: dtrace probes for tick-start and tick-stop 2013-04-10 14:10:05 +02:00