I have a problem with an abort() getting called by the following code in 
linux-core.c:


int uv__io_check_fd(uv_loop_t* loop, int fd) {
  struct uv__epoll_event e;
  int rc;

  e.events = POLLIN;
  e.data = -1;

  rc = 0;
  if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_ADD, fd, &e))
    if (errno != EEXIST)
      rc = -errno;

  if (rc == 0)
    if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &e))
      abort();

  return rc;
}

(gdb) frame 2
#2  0x000000000080d842 in uv__io_check_fd (loop=0x7ffff7dd8c40 <libLoop>, 
fd=33) at ../src/unix/linux-core.c:164
164 ../src/unix/linux-core.c: No such file or directory.
(gdb) p errno
$1 = 2



My understanding is this code is to check whether the FD can actually be 
added to the epoll set. What I don't get, is why the abort() would ever be 
reached. I.e. why does epol_ctl() allow you to add the FD if it can't 
remove it (meaning it really could not add it)?

I was wondering if someone could shed some light on how this code came 
about, and why an FD would be in such a state that it would reach the 
abort().  The amount knowledge on the epoll inner workings out there on the 
net is minimal.

In my case, the errno is 2 on second epoll_ctl fail, which is ENOENT

Thanks so much,
Ed



more backtrace

(gdb) bt
#0  0x00007ffff6c08c37 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6c0c028 in __GI_abort () at abort.c:89
#2  0x000000000080d842 in uv__io_check_fd (loop=0x7ffff7dd8c40 <libLoop>, 
fd=33) at ../src/unix/linux-core.c:164
#3  0x000000000080273c in uv_poll_init (loop=0x7ffff7dd8c40 <libLoop>, 
handle=0x1780858, fd=33) at ../src/unix/poll.c:58
#4  0x00007ffff7bc8715 in fdRedirectorTicket::fdRedirectorTicket(unsigned 
int, int, void (*)(GreaseLibError*, int, int)) ()
   from 
/home/ed/work/gostuff/src/github.com/WigWagCo/maestro/../greasego/deps/lib/libgrease.so.1



-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to