id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3238,"asio, kqueue_reactor, result of kevent() isn't checked for error",devel@…,chris_kohlhoff,"No kevent() result checking. {{{ asio/detail/kqueue_reactor.hpp:438 ... wait_in_progress_ = true; lock.unlock(); // Block on the kqueue descriptor. struct kevent events[128]; int num_events = (block || need_kqueue_wait_) ? kevent(kqueue_fd_, 0, 0, events, 128, timeout) : 0; lock.lock(); wait_in_progress_ = false; // Block signals while performing operations. boost::asio::detail::signal_blocker sb; // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { // processing events ... }}} Here is '''int num_events = kevent(kqueue_fd_, ...''', then '''for (int i = 0; i < num_events''' but '''num_events''' can be -1 here, and all this code makes no sense then. Suppose we have such code: {{{ smtp_queue q(""/var/spool/smtpq""); asio::io_service io_service; smtp_server s(io_service, 25, q); smtp_client c(io_service, ""target.host"", ""smtp"", q); if(fork()) exit(0); // daemonize io_service.run(); }}} Here we call '''fork()''' then '''io_service.run()'''. fork doesn't copy kqueue descriptor and subsequent kevent(fd,...) calls return -1 with errno = 9 (EBADFD, ""Bad file descriptor""). This case makes asio's kqueue reactor hangup. Probably, kevent() result should be checked for error and exception thrown if any. ",Bugs,closed,To Be Determined,asio,Boost Development Trunk,Problem,fixed,asio kqueue,