OS:Linux Fedora 20 x86_64

I'm getting the following segfault/abort:

"close failed" from libmicrohttpd v0.9.46.

I traced the issue to the following code in daemon.c:

---
      /* epoll documentation suggests that closing a FD
         automatically removes it from the epoll set; however,
         this is not true as if we fail to do manually remove it,
         we are still seeing an event for this fd in epoll,
         causing grief (use-after-free...) --- at least on my
         system. */
      if (0 != epoll_ctl (daemon->epoll_fd,
                  EPOLL_CTL_DEL,
                  pos->socket_fd,
                  NULL))
        MHD_PANIC ("Failed to remove FD from epoll set\n");
      pos->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET;
    }
#endif
      if (NULL != pos->response)
    {
      MHD_destroy_response (pos->response);
      pos->response = NULL;
    }
      if (MHD_INVALID_SOCKET != pos->socket_fd)
    {
#ifdef WINDOWS
      shutdown (pos->socket_fd, SHUT_WR);
#endif
      if (0 != MHD_socket_close_ (pos->socket_fd))
*        MHD_PANIC ("close failed\n");*
    }
---

Any remedies? This suggests that there is an issue with epoll?
<[email protected]>

Thanks, Mark
<[email protected]>

Reply via email to