Skip to content

Instantly share code, notes, and snippets.

@goffrie
Last active December 19, 2015 01:49
Show Gist options
  • Save goffrie/5878871 to your computer and use it in GitHub Desktop.
Save goffrie/5878871 to your computer and use it in GitHub Desktop.
node.js testcase for a bug in libuv.
var child = require('child_process');
var net = require('net');
var dgram = require('dgram');
// Create a new fd.
var sock = dgram.createSocket('udp4');
sock.bind(4321, function() {
// Send that fd to another process.
// This keeps the file description open,
// even after we close our local fd.
child.spawn('/bin/sleep', ['1000000'], {
stdio: [0, 1, 2, sock._handle.fd]
});
// Send a packet.
// This puts the socket in writing mode.
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1', function() {
// Somehow removing this log makes the program not crash.
console.log("sent");
// Close the socket.
sock.close();
// At this point, the fd is not deregistered from the epoll fd.
// It is still in EPOLLIN|EPOLLOUT mode.
// It also cannot be removed, since we no longer have an fd for it.
// Now create a new listening socket.
var server = net.createServer(function(){ console.log("connection get!"); });
// Listen on the socket. Now the socket is watched by `uv__server_io`.
// It will receive an EPOLLOUT event from the UDP socket that is still
// registered, which causes an assertion failure.
server.listen(4321);
});
// Send some more packets, so that the socket stays writable.
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1');
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1');
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1');
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1');
sock.send(new Buffer(1000), 0, 1000, '3000', '127.0.0.1');
});
From 9c49c9ee2269946effcded0d1339eff8de2e0456 Mon Sep 17 00:00:00 2001
From: Geoffry Song <[email protected]>
Date: Thu, 27 Jun 2013 11:45:09 -0400
Subject: [PATCH 1/2] Unregister fds from epoll before closing them.
This avoids a race condition where, apparently:
- An fd that is being watched is closed, but (as described in epoll(7))
is not removed from the epoll because a duplicate fd exists.
- A new fd is created, gets the same fd number, and is registered with
epoll.
- An event occurs on the old file, which is reported to the callback for
the new fd (which then triggers an assertion failure).
This isn't a complete fix: it defines a function but only implements it
for epoll (i.e. only Linux). I don't know if any similar functionality
is needed on any other systems, or if the function should just be a stub
(or maybe the whole thing should be in an #ifdef).
---
src/unix/core.c | 1 +
src/unix/internal.h | 1 +
src/unix/linux-core.c | 9 +++++++++
3 files changed, 11 insertions(+)
diff --git a/src/unix/core.c b/src/unix/core.c
index 3eb45da..8474be4 100644
--- a/src/unix/core.c
+++ b/src/unix/core.c
@@ -700,6 +700,7 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
if (loop->watchers[w->fd] != NULL) {
assert(loop->watchers[w->fd] == w);
assert(loop->nfds > 0);
+ uv__platform_loop_unwatch(loop, w->fd);
loop->watchers[w->fd] = NULL;
loop->nfds--;
w->events = 0;
diff --git a/src/unix/internal.h b/src/unix/internal.h
index 9b593d9..d0c2a58 100644
--- a/src/unix/internal.h
+++ b/src/unix/internal.h
@@ -185,6 +185,7 @@ uint64_t uv__hrtime(void);
int uv__kqueue_init(uv_loop_t* loop);
int uv__platform_loop_init(uv_loop_t* loop, int default_loop);
void uv__platform_loop_delete(uv_loop_t* loop);
+void uv__platform_loop_unwatch(uv_loop_t* loop, int fd);
/* various */
void uv__async_close(uv_async_t* handle);
diff --git a/src/unix/linux-core.c b/src/unix/linux-core.c
index f18da7a..169104a 100644
--- a/src/unix/linux-core.c
+++ b/src/unix/linux-core.c
@@ -100,6 +100,15 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}
+void uv__platform_loop_unwatch(uv_loop_t* loop, int fd) {
+ /* Pass in a dummy epoll_event,
+ * to work around a bug in old kernels. */
+ struct uv__epoll_event e;
+ if (loop->backend_fd == -1) return;
+ uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &e);
+}
+
+
void uv__io_poll(uv_loop_t* loop, int timeout) {
struct uv__epoll_event events[1024];
struct uv__epoll_event* pe;
--
1.8.3.1
From 869d6aeda9b155ff59bdea5d61b22dc22758cd40 Mon Sep 17 00:00:00 2001
From: Geoffry Song <[email protected]>
Date: Thu, 27 Jun 2013 11:49:55 -0400
Subject: [PATCH 2/2] Relax uv__server_io's requirement that `events` be
`UV__POLLIN`.
---
src/unix/stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/unix/stream.c b/src/unix/stream.c
index 9688fbe..0313afa 100644
--- a/src/unix/stream.c
+++ b/src/unix/stream.c
@@ -490,8 +490,8 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
int err;
int fd;
+ if (!(events & UV__POLLIN)) return;
stream = container_of(w, uv_stream_t, io_watcher);
- assert(events == UV__POLLIN);
assert(stream->accepted_fd == -1);
assert(!(stream->flags & UV_CLOSING));
--
1.8.3.1
execve("/usr/local/bin/node", ["node", "bug.js"], [/* 58 vars */]) = 0
brk(0) = 0x2bc4000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=144067, ...}) = 0
mmap(NULL, 144067, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f510231c000
close(3) = 0
open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14672, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510231b000
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5101f1b000
mprotect(0x7f5101f1e000, 2093056, PROT_NONE) = 0
mmap(0x7f510211d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f510211d000
close(3) = 0
open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20#\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=31760, ...}) = 0
mmap(NULL, 2128880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5101d13000
mprotect(0x7f5101d1a000, 2093056, PROT_NONE) = 0
mmap(0x7f5101f19000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f5101f19000
close(3) = 0
open("/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\272\5\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=979080, ...}) = 0
mmap(NULL, 3159072, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5101a0f000
mprotect(0x7f5101af5000, 2093056, PROT_NONE) = 0
mmap(0x7f5101cf4000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe5000) = 0x7f5101cf4000
mmap(0x7f5101cfe000, 82976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5101cfe000
close(3) = 0
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240V\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1038768, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510231a000
mmap(NULL, 3133768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5101711000
mprotect(0x7f510180e000, 2093056, PROT_NONE) = 0
mmap(0x7f5101a0d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xfc000) = 0x7f5101a0d000
close(3) = 0
open("/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=88992, ...}) = 0
mmap(NULL, 2184800, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f51014fb000
mprotect(0x7f5101510000, 2097152, PROT_NONE) = 0
mmap(0x7f5101710000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f5101710000
close(3) = 0
open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0Pl\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=138237, ...}) = 0
mmap(NULL, 2208688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f51012df000
mprotect(0x7f51012f6000, 2093056, PROT_NONE) = 0
mmap(0x7f51014f5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f51014f5000
mmap(0x7f51014f7000, 13232, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f51014f7000
close(3) = 0
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \33\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2035252, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5102319000
mmap(NULL, 3852848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5100f32000
mprotect(0x7f51010d5000, 2097152, PROT_NONE) = 0
mmap(0x7f51012d5000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3000) = 0x7f51012d5000
mmap(0x7f51012db000, 14896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f51012db000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5102318000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5102316000
arch_prctl(ARCH_SET_FS, 0x7f5102316740) = 0
mprotect(0x7f51012d5000, 16384, PROT_READ) = 0
mprotect(0x7f51014f5000, 4096, PROT_READ) = 0
mprotect(0x7f5101a0d000, 4096, PROT_READ) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5102315000
mprotect(0x7f5101cf4000, 32768, PROT_READ) = 0
mprotect(0x7f5101f19000, 4096, PROT_READ) = 0
mprotect(0x7f510211d000, 4096, PROT_READ) = 0
mprotect(0xe22000, 4096, PROT_READ) = 0
mprotect(0x7f5102340000, 4096, PROT_READ) = 0
munmap(0x7f510231c000, 144067) = 0
set_tid_address(0x7f5102316a10) = 19162
set_robust_list(0x7f5102316a20, 24) = 0
rt_sigaction(SIGRTMIN, {0x7f51012e57a0, [], SA_RESTORER|SA_SIGINFO, 0x7f51012ee0e0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f51012e5830, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f51012ee0e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(0) = 0x2bc4000
brk(0x2be5000) = 0x2be5000
getrlimit(RLIMIT_DATA, {rlim_cur=RLIM64_INFINITY, rlim_max=RLIM64_INFINITY}) = 0
clock_gettime(0x7 /* CLOCK_??? */, {315863, 457442278}) = 0
ioctl(0, FIOCLEX) = 0
ioctl(1, FIOCLEX) = 0
ioctl(2, FIOCLEX) = 0
ioctl(3, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(4, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(5, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(6, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(7, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(8, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(9, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(10, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(11, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(12, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(13, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(14, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(15, FIOCLEX) = -1 EBADF (Bad file descriptor)
ioctl(16, FIOCLEX) = -1 EBADF (Bad file descriptor)
rt_sigaction(SIGPIPE, {SIG_IGN, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
rt_sigaction(SIGINT, {0x5ae540, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
rt_sigaction(SIGTERM, {0x5ae540, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
pipe2([3, 4], O_CLOEXEC) = 0
write(4, "*", 1) = 1
futex(0xe3bdb8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
epoll_create1(EPOLL_CLOEXEC) = 5
pipe2([6, 7], O_NONBLOCK|O_CLOEXEC) = 0
eventfd2(0, O_NONBLOCK|O_CLOEXEC) = 8
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
read(3, "*", 1) = 1
rt_sigaction(SIGUSR1, {0x6fa180, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
write(4, "*", 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
mmap(0x3807475d4000, 4096, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x3807475d4000
mmap(0x3807475d4000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3807475d4000
munmap(0x3807475d4000, 4096) = 0
mmap(0x27abe3c6b000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x27abe3c6b000
mprotect(0x27abe3c6b000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x972716cd000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x972716cd000
mprotect(0x972716cd000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0xe5d4137b000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xe5d4137b000
mprotect(0xe5d4137b000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x2e33023ea000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2e33023ea000
mprotect(0x2e33023ea000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x2648b964c000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2648b964c000
mprotect(0x2648b964c000, 4096, PROT_READ|PROT_EXEC) = 0
brk(0x2c0c000) = 0x2c0c000
gettid() = 19162
mmap(0x23f6ac957000, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x23f6ac957000
munmap(0x23f6ac957000, 23760896) = 0
munmap(0x23f6b0000000, 9793536) = 0
mmap(0x23f6aef00000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x23f6aef00000
mmap(0x33daf9288000, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x33daf9288000
mmap(0x273229f7d000, 1200128, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x273229f7d000
munmap(0x273229f7d000, 536576) = 0
munmap(0x27322a025000, 512000) = 0
mmap(0x27322a000000, 147712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x27322a000000
mmap(0x2e0111988000, 1265664, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2e0111988000
munmap(0x2e0111988000, 491520) = 0
munmap(0x2e0111a35000, 557056) = 0
mmap(0x2e0111a00000, 213248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2e0111a00000
mmap(0x1b6d9af55000, 1593344, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x1b6d9af55000
munmap(0x1b6d9af55000, 700416) = 0
munmap(0x1b6d9b085000, 348160) = 0
mmap(0x1b6d9b000000, 540928, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1b6d9b000000
mmap(0x33daf9300000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x33daf9300000
mprotect(0x33daf9305000, 4096, PROT_NONE) = 0
mmap(0x33daf9306000, 1019904, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x33daf9306000
mprotect(0x33daf93ff000, 4096, PROT_NONE) = 0
mmap(0x3a528577d000, 393216, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x3a528577d000
mmap(0x2bb040215000, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2bb040215000
mmap(0x2bb040215000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040215000
mmap(0x3a5285780000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3a5285780000
mmap(NULL, 69632, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f510232f000
mprotect(0x7f510232f000, 4096, PROT_NONE) = 0
clone(child_stack=0x7f510233efb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f510233f9d0, tls=0x7f510233f700, child_tidptr=0x7f510233f9d0) = 19163
mmap(0x36129643d000, 1200128, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x36129643d000
munmap(0x36129643d000, 798720) = 0
munmap(0x361296525000, 249856) = 0
mmap(0x361296500000, 147712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x361296500000
brk(0x2c2d000) = 0x2c2d000
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f51022f4000
munmap(0x7f51022f4000, 135168) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
brk(0x2c6b000) = 0x2c6b000
mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f51022d4000
mmap(NULL, 532480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5102252000
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 9
fstat(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510232e000
read(9, "MemTotal: 8145756 kB\nMemF"..., 1024) = 1024
close(9) = 0
munmap(0x7f510232e000, 4096) = 0
munmap(0x7f5102252000, 532480) = 0
munmap(0x7f51022d4000, 266240) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
brk(0x2c8f000) = 0x2c8f000
brk(0x2ccf000) = 0x2ccf000
brk(0x2d51000) = 0x2d51000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
brk(0x2c4b000) = 0x2c4b000
brk(0x2c7c000) = 0x2c7c000
brk(0x2cbe000) = 0x2cbe000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
readlink("/proc/self/exe", "/usr/local/bin/node", 8191) = 19
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
brk(0x2d39000) = 0x2d39000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
getcwd("/home/goffrie", 4096) = 14
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
getcwd("/home/goffrie", 4096) = 14
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
brk(0x2d7a000) = 0x2d7a000
brk(0x2dfc000) = 0x2dfc000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
stat("/home/goffrie/bug.js", {st_mode=S_IFREG|0644, st_size=1662, ...}) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/goffrie", {st_mode=S_IFDIR|0710, st_size=4096, ...}) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
lstat("/home/goffrie/bug.js", {st_mode=S_IFREG|0644, st_size=1662, ...}) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
open("/home/goffrie/bug.js", O_RDONLY) = 9
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
fstat(9, {st_mode=S_IFREG|0644, st_size=1662, ...}) = 0
read(9, "var child = require('child_proce"..., 1662) = 1662
close(9) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
open("/etc/resolv.conf", O_RDONLY) = 9
fstat(9, {st_mode=S_IFREG|0644, st_size=98, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510232e000
read(9, "# Generated by resolvconf\ndomain"..., 4096) = 98
read(9, "", 4096) = 0
close(9) = 0
munmap(0x7f510232e000, 4096) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 9
fstat(9, {st_mode=S_IFREG|0644, st_size=272, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510232e000
read(9, "# Begin /etc/nsswitch.conf\n\npass"..., 4096) = 272
read(9, "", 4096) = 0
close(9) = 0
munmap(0x7f510232e000, 4096) = 0
open("/dev/urandom", O_RDONLY) = 9
fstat(9, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
ioctl(9, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fff342ca1c0) = -1 EINVAL (Invalid argument)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510232e000
read(9, "^\331\310e\"U\27,\250\204\227\250\23L\273H\6\223\331kY\t}\377\230~\273.\345\32\316L"..., 4096) = 4096
close(9) = 0
munmap(0x7f510232e000, 4096) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
mmap(0x3fc1a1b84000, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x3fc1a1b84000
munmap(0x3fc1a1b84000, 507904) = 0
munmap(0x3fc1a1d00000, 540672) = 0
mmap(0x3fc1a1c00000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3fc1a1c00000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
socket(PF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 9
setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(9, {sa_family=AF_INET, sin_port=htons(4321), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
mmap(0x23f6aff00000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x23f6aff00000
mmap(0x2bb040216000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040216000
mmap(0x2bb040217000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040217000
mmap(0x2bb040219000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040219000
mmap(0x2bb04021d000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb04021d000
mmap(0x2bb040225000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040225000
mmap(0x2bb040235000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040235000
mmap(0x2bb040255000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040255000
mmap(0x2bb040295000, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040295000
mmap(0x2bb040315000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2bb040315000
mmap(0x39b17e890000, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x39b17e890000
munmap(0x39b17e890000, 458752) = 0
munmap(0x39b17ea00000, 589824) = 0
mmap(0x39b17e900000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x39b17e900000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
mmap(0x2de65d39000, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2de65d39000
munmap(0x2de65d39000, 815104) = 0
munmap(0x2de65f00000, 233472) = 0
mmap(0x2de65e00000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2de65e00000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
pipe2([10, 11], O_CLOEXEC) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
read(3, "*", 1) = 1
rt_sigaction(SIGCHLD, {0x6fa180, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
write(4, "*", 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5102316a10) = 19164
close(11) = 0
read(10, "", 4) = 0
close(10) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_ctl(5, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}}) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT, {u32=9, u64=9}}) = 0
epoll_wait(5, {{EPOLLOUT, {u32=9, u64=9}}}, 1024, -1) = 1
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\7\0\0\0\1.\0\0\0\0\0\0\0\0\0\0\360s\301\2\0\0\0\0p@\274\2\0\0\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\0`\301\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\0\336\343\0\0\0\0\0000_\301\2\0\0\0\0\0\0\0\0\17\0\0\0p_\301\2\0\0\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"`f\301\2\0\0\0\0\260f\301\2\0\0\0\0\260g\301\2\0\0\0\0v\10\0\0x\10\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\360d\263\0\0\0\0\0R\0\0\0S\0\0\0\260_\277\2\0\0\0\0Hi\301\2\0\0\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
sendmsg(9, {msg_name(16)={sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\360D\274\2\0\0\0\0\220`\301\2\0\0\0\0\1\0\0\0\377\377\377\377\0\336\343\0\0\0\0\0"..., 1000}], msg_controllen=0, msg_flags=0}, 0) = 1000
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
open("/", O_RDONLY|O_CLOEXEC) = 10
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
ioctl(1, TIOCGWINSZ, {ws_row=33, ws_col=243, ws_xpixel=0, ws_ypixel=0}) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
read(3, "*", 1) = 1
rt_sigaction(SIGWINCH, {0x6fa180, ~[RTMIN RT_1], SA_RESTORER, 0x7f51012ee0e0}, NULL, 8) = 0
write(4, "*", 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
ioctl(2, TIOCGWINSZ, {ws_row=33, ws_col=243, ws_xpixel=0, ws_ypixel=0}) = 0
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f50fc0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
write(1, "sent\n", 5) = 5
close(9) = 0
socket(PF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 9
setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(9, {sa_family=AF_INET, sin_port=htons(4321), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(9, 511) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN, {u32=9, u64=9}}) = 0
epoll_wait(5, {{EPOLLOUT, {u32=9, u64=9}}}, 1024, -1) = 1
write(2, "node: ../deps/uv/src/unix/stream"..., 87) = 87
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f510232e000
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(19162, 19162, SIGABRT) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=19162, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment