git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: <git@vger.kernel.org>
Subject: [Proposed Fix] daemon.c: not initializing revents
Date: Sat, 9 Feb 2019 14:56:55 -0500	[thread overview]
Message-ID: <000a01d4c0b1$9ef9ea70$dcedbf50$@nexbridge.com> (raw)
In-Reply-To: <000901d4c0b1$1ea15160$5be3f420$@nexbridge.com>

Hi All,

I found this while trying to track down a hang in t5562 - this isn't the
fix, but here it is something that could be considered a code-inspection. If
there have been random unexplained hangs when git runs as a daemon, this
might be the cause.

According to many systems (other than Linux), the revents field is supposed
to be 0 on return to poll(). This was the cause of some heart-ache a while
back in compat/poll/poll.c. I am not certain whether that copy of poll() is
used in daemon, but I wanted to point out that the value is being returned
to poll, outside of compat/poll/poll.c and may present a potential for poll
returning an error on that FD due to random values that might be in revents.

Please see 61b2a1acaae for a related change/justification.

diff --git a/daemon.c b/daemon.c
index 9d2e0d20ef..1e275fc8b3 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1194,6 +1194,7 @@ static int service_loop(struct socketlist *socklist)
                                }
                                handle(incoming, &ss.sa, sslen);
                        }
+                       pfd[i].revents = 0;
                }
        }
 }

Regards,
Randall


       reply	other threads:[~2019-02-09 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <000901d4c0b1$1ea15160$5be3f420$@nexbridge.com>
2019-02-09 19:56 ` Randall S. Becker [this message]
2019-02-11 20:56   ` [Proposed Fix] daemon.c: not initializing revents Junio C Hamano
2019-02-11 21:44     ` Randall S. Becker
2019-02-12  2:59       ` Junio C Hamano
2019-02-12 13:58         ` Randall S. Becker

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='000a01d4c0b1$9ef9ea70$dcedbf50$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).