All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: Suspicious fetch-pack behaviour
Date: Thu, 3 Jan 2019 10:52:48 +0100	[thread overview]
Message-ID: <CA+BUw6jXTt6QGXvdFjRDNqJcij+1hNP5xybUUuGqo3bY0=ueuA@mail.gmail.com> (raw)

Hi,

One of my users reported a strange problem: a simple HTTPS clone did
not work with Git 1.8.3.1 on RedHat 7.
I did many tests and I was not able to understand why his clone don't
work while I'm able to do it on other similar host.

Nevertheless, we did more investigations. One of them: a raw strace.
I discovered two strange behaviours:
- fetch-pack closes its standard input and standard output and then
tries to print the references on standard input and finaly dies.
- git-remote-https does not react to fetch-pack death and continue
polling an empty set of FD.

Reading fetch-pack code, the behaviour is explicit:
When "--stateless-rpc" is provided, fd is filled with standard input
and standard ouput which are then closed.
https://git.kernel.org/pub/scm/git/git.git/tree/builtin/fetch-pack.c?h=v1.8.3.1#n156

Reading this, I did not understand why it could work.
Any help appreciated.

Here is the strace's extract:

2801  getdents(3, /* 2 entries */, 32768) = 48
2801  getdents(3, /* 0 entries */, 32768) = 0
2801  close(3)                          = 0
2801  close(0)                          = 0
2801  close(1)                          = 0
2801  fstat(1, 0x7ffe10ab4730)          = -1 EBADF (Bad file descriptor)
2801  mmap(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f220c9e3000
2801  fstat(1, 0x7ffe10ab5040)          = -1 EBADF (Bad file descriptor)
2801  write(1, "4df1dbf3224064cc5dd2e4c095da2dda"..., 159) = -1 EBADF
(Bad file descriptor)
2801  exit_group(0)                     = ?
2801  +++ exited with 0 +++
2769  <... poll resumed> )              = ? ERESTART_RESTARTBLOCK
(Interrupted by signal)
2769  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2801,
si_uid=7561, si_status=0, si_utime=0, si_stime=0} ---
2769  restart_syscall(<... resuming interrupted poll ...>) = 0
2769  poll(NULL, 0, 1000)               = 0 (Timeout)
2769  poll(NULL, 0, 1000)               = 0 (Timeout)
2769  poll(NULL, 0, 1000)               = 0 (Timeout)
2769  poll(NULL, 0, 1000)               = 0 (Timeout)
2769  poll(NULL, 0, 1000)               = 0 (Timeout)
2769  poll(NULL, 0, 1000)               = 0 (Timeout)

-- 
Guilhem BONNEFILLE
-=- JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/

             reply	other threads:[~2019-01-03  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  9:52 Guilhem Bonnefille [this message]
2019-01-07  3:37 ` Suspicious fetch-pack behaviour brian m. carlson
2019-01-08  6:34 ` Jeff King
2019-01-08  7:26   ` Guilhem Bonnefille

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='CA+BUw6jXTt6QGXvdFjRDNqJcij+1hNP5xybUUuGqo3bY0=ueuA@mail.gmail.com' \
    --to=guilhem.bonnefille@gmail.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 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.