All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yannick Lamarre <ylamarre@efficios.com>
To: lttng-dev@lists.lttng.org
Cc: jgalar@efficios.com
Subject: [PATCH lttng-tools 5/8] Fix hang in thread_rotation when using compat-poll
Date: Tue, 19 Mar 2019 17:17:32 -0400	[thread overview]
Message-ID: <20190319211735.7187-6-ylamarre__49749.0754861914$1553030379$gmane$org@efficios.com> (raw)
In-Reply-To: <20190319211735.7187-1-ylamarre@efficios.com>

The poll flavor of the lttng_poll api requires the caller to verify
which of the fd has really waken the thread from wait. This
verification was missing and a blocking read was made on an empty fd.

Signed-off-by: Yannick Lamarre <ylamarre@efficios.com>
---
 src/bin/lttng-sessiond/rotation-thread.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c
index 6669372d..b86b1668 100644
--- a/src/bin/lttng-sessiond/rotation-thread.c
+++ b/src/bin/lttng-sessiond/rotation-thread.c
@@ -974,6 +974,10 @@ void *thread_rotation(void *data)
 			int fd = LTTNG_POLL_GETFD(&thread.events, i);
 			uint32_t revents = LTTNG_POLL_GETEV(&thread.events, i);
 
+			if (!revents) {
+				/* No activity for this FD (poll implementation). */
+				continue;
+			}
 			DBG("[rotation-thread] Handling fd (%i) activity (%u)",
 					fd, revents);
 
-- 
2.11.0

  parent reply	other threads:[~2019-03-19 21:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190319211735.7187-1-ylamarre@efficios.com>
2019-03-19 21:17 ` [PATCH lttng-tools 1/8] Fix: lttng_poll_mod calls compat_(e)poll_add Yannick Lamarre
2019-03-19 21:17 ` [PATCH lttng-tools 2/8] Add Unit test to poll compatibility layer Yannick Lamarre
2019-03-19 21:17 ` [PATCH lttng-tools 3/8] Change LTTNG_POLL_GETNB behaviour for poll flavor Yannick Lamarre
2019-03-19 21:17 ` [PATCH lttng-tools 4/8] Adapt poll layer behaviour to match the epoll layer Yannick Lamarre
2019-03-19 21:17 ` Yannick Lamarre [this message]
2019-03-19 21:17 ` [PATCH lttng-tools 6/8] Change lttng_poll_wait behaviour of compat-poll to match compat-epoll Yannick Lamarre
2019-03-19 21:17 ` [PATCH lttng-tools 7/8] Clean code base from redundant verification Yannick Lamarre
2019-03-19 21:17 ` [PATCH lttng-tools 8/8] Fix typo Yannick Lamarre
     [not found] ` <20190319211735.7187-3-ylamarre@efficios.com>
2019-03-20 19:19   ` [PATCH lttng-tools 2/8] Add Unit test to poll compatibility layer Mathieu Desnoyers
     [not found] ` <20190319211735.7187-4-ylamarre@efficios.com>
2019-03-20 19:22   ` [PATCH lttng-tools 3/8] Change LTTNG_POLL_GETNB behaviour for poll flavor Mathieu Desnoyers
     [not found] ` <20190319211735.7187-6-ylamarre@efficios.com>
2019-03-20 19:28   ` [PATCH lttng-tools 5/8] Fix hang in thread_rotation when using compat-poll Mathieu Desnoyers
     [not found] ` <20190319211735.7187-7-ylamarre@efficios.com>
2019-03-20 19:42   ` [PATCH lttng-tools 6/8] Change lttng_poll_wait behaviour of compat-poll to match compat-epoll Mathieu Desnoyers
     [not found]   ` <1287337982.4641.1553110957561.JavaMail.zimbra@efficios.com>
2019-03-20 21:20     ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20190319211735.7187-6-ylamarre__49749.0754861914$1553030379$gmane$org@efficios.com' \
    --to=ylamarre@efficios.com \
    --cc=jgalar@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.