Uploaded image for project: 'libzmq'
  1. libzmq
  2. LIBZMQ-408

All file descriptors should be opened with the CLOEXEC flag

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      Linux

      Description

      TCP and Unix sockets are opened with the CLOEXEC flag through zmq::open_socket in ip.cpp.
      However some other file descriptors are not opened with the close-on-exec flag and so they will not be closed in case of a fork+exec. This may be a problem for processes which fork themselves, for instance a frontend process which forks worker processes to handle requests.
      Examples of such file descriptors are fds created by eventfd in signaler.cpp, fds created by epoll_create in epoll.cpp, and fds created for /dev/poll in devpoll.cpp.

      A patch is attached.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            hurtonm Martin Hurton added a comment -

            Rene, could you please create a pull-request so that we can merge your patch? Thanks!

            Show
            hurtonm Martin Hurton added a comment - Rene, could you please create a pull-request so that we can merge your patch? Thanks!

              People

              • Assignee:
                Unassigned
                Reporter:
                rplehmann Rene-Pierre Lehmann
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: