Skip to content
Snippets Groups Projects
  1. Aug 30, 2012
  2. Aug 25, 2012
    • Ben Noordhuis's avatar
      unix: fix memory leak in udp.c · ad7b48ae
      Ben Noordhuis authored
      Some memory was leaked when the uv_udp_t handle was closed when there were
      in-flight send requests with a heap allocated buffer list.
      
      That doesn't happen much in practice. In the common case (writing < 5 buffers),
      the buffer list is stored inside the uv_udp_send_t structure, not allocated on
      the heap.
      ad7b48ae
  3. Aug 22, 2012
  4. Aug 20, 2012
  5. Aug 18, 2012
  6. Aug 16, 2012
  7. Aug 15, 2012
  8. Aug 13, 2012
  9. Aug 08, 2012
  10. Aug 03, 2012
  11. Jul 31, 2012
  12. Jul 30, 2012
  13. Jul 28, 2012
    • Ben Noordhuis's avatar
      linux: fix 'two watchers, one path' segfault · 4fe19169
      Ben Noordhuis authored
      Problem: registering two uv_fs_event_t watchers for the same path, then closing
      them, caused a segmentation fault. While active, the watchers didn't work right
      either, only one would receive events.
      
      Cause: each watcher has a wd (watch descriptor) that's used as its key in a
      binary tree. When you call inotify_watch_add() twice with the same path, the
      second call doesn't return a new wd - it returns the existing one. That in turn
      resulted in the first handle getting ousted from the binary tree, leaving
      dangling pointers.
      
      This commit addresses that by storing the watchers in a queue and storing the
      queue in the binary tree instead of storing the watchers directly in the tree.
      
      Fixes joyent/node#3789.
      4fe19169
    • Ben Noordhuis's avatar
      test: add uv_loop_t to benchmark-sizes.c · ec76a425
      Ben Noordhuis authored
      ec76a425
    • Ben Noordhuis's avatar
      4fe369b1
    • Ben Noordhuis's avatar
      test: add failing fs_event test · b5b8ead8
      Ben Noordhuis authored
      Watches the same file twice. Fails on Linux with a segmentation fault.
      b5b8ead8
  14. Jul 25, 2012
  15. Jul 19, 2012
    • Ben Noordhuis's avatar
      unix: fix format string vulnerability in freebsd.c · 94355e47
      Ben Noordhuis authored
      uv_set_process_title() was susceptible to a format string vulnerability:
      
        $ node -e 'process.title = Array(42).join("%s")'
        Segmentation fault: 11 (core dumped)
      
      The fix is trivial - call setproctitle("%s", s) instead of setproctitle(s) -
      but valgrind complains loudly about reads from and writes to uninitialized
      memory in libc. It's not a libuv bug because the test case below triggers the
      same warnings:
      
        #include <sys/types.h>
        #include <unistd.h>
      
        int main(void)
        {
          setproctitle("%s", "test");
          return 0;
        }
      
      That's why this commit replaces setproctitle() with sysctl(KERN_PROC_ARGS).
      
      This commit reapplies commit a9f6f06f, which got reverted in 69a6afea. The revert
      turned out to be unnecessary.
      2 tags
      94355e47
    • Ben Noordhuis's avatar
      unix: fix uv_pipe_connect() with existing fd · ff59525c
      Ben Noordhuis authored
      Don't create a new socket descriptor if one has been previously assigned with
      uv_pipe_open().
      ff59525c
    • Ben Noordhuis's avatar
      unix: fix errno reporting in uv_pipe_connect() · e3a28508
      Ben Noordhuis authored
      Remember the errno when the socket() syscall fails.
      e3a28508
  16. Jul 18, 2012
    • Ben Noordhuis's avatar
      unix: undo changes to uv_set_process_title() · 69a6afea
      Ben Noordhuis authored
      It's making node.js crash when run as root. Backtrace:
      
        (gdb) bt
        #0  0x00007fff856e3ff9 in __findenv ()
        #1  0x00007fff856e404c in getenv ()
        #2  0x000000010004c850 in loop_init (loop=0x10045a792, flags=8) at ev.c:1707
        #3  0x000000010004cb3b in ev_backend [inlined] () at /Users/tjfontaine/Development/node/deps/uv/src/unix/ev/ev.c:2090
        #4  0x000000010004cb3b in ev_default_loop (flags=1606417108) at ev.c:2092
        #5  0x000000010004e5c6 in uv__loop_init (loop=0x10066e330, default_loop=1) at loop.c:52
        #6  0x0000000100044367 in uv_default_loop () at core.c:196
        #7  0x0000000100004625 in node::Init (argc=1606417456, argv=0x100b0f490) at node.cc:2761
        #8  0x000000010000797d in node::Start (argc=1606417600, argv=0x0) at node.cc:2888
        #9  0x0000000100000ca4 in start ()
      
      This reverts commits:
      
        b49d6f7c unix: fix uv_set_process_title()
        a9f6f06f unix: fix format string vulnerability in freebsd.c
        a87abc70 unix: avoid buffer overflow in proctitle.c
        dc97d44c unix: move uv_set_process_title() to proctitle.c
      69a6afea
  17. Jul 17, 2012
    • Ben Noordhuis's avatar
      unix: fix uv_set_process_title() · b49d6f7c
      Ben Noordhuis authored
      Use strncpy() to set the process title, it pads the remainder with nul bytes.
      Avoids garbage output on systems where `ps aux` prints the entire proctitle
      buffer, not just the characters up to the first '\0'.
      
      Fixes joyent/node#3726.
      b49d6f7c
  18. Jul 13, 2012
    • Ben Noordhuis's avatar
      unix: fix format string vulnerability in freebsd.c · a9f6f06f
      Ben Noordhuis authored
      uv_set_process_title() was susceptible to a format string vulnerability:
      
        $ node -e 'process.title = Array(42).join("%s")'
        Segmentation fault: 11 (core dumped)
      
      The fix is trivial - call setproctitle("%s", s) instead of setproctitle(s) -
      but valgrind complains loudly about reads from and writes to uninitialized
      memory in libc. It's not a libuv bug because the test case below triggers the
      same warnings:
      
        #include <stdio.h>
        #include <stdlib.h>
        #include <sys/types.h>
        #include <unistd.h>
      
        int main(void)
        {
          setproctitle("%s", "test");
          return 0;
        }
      
      That's why this commit replaces setproctitle() with sysctl(KERN_PROC_ARGS).
      a9f6f06f
    • Ben Noordhuis's avatar
      unix: avoid buffer overflow in proctitle.c · a87abc70
      Ben Noordhuis authored
      Get/set process title with uv_strlcpy(), not strncpy(). The latter won't
      zero-terminate the result if the destination buffer is too small.
      a87abc70
    • Fedor Indutny's avatar
      unix: move uv_set_process_title() to proctitle.c · dc97d44c
      Fedor Indutny authored
      Use hijacking argv array to change process' title. It seems to be working fine
      on almost every platform (at least it should not break anything as it's used in
      nginx in a similar way).
      dc97d44c
  19. Jul 10, 2012
  20. Jul 04, 2012
Loading