Re: Closing fds twice when using remote helpers

2019-05-16 Thread Mike Hommey
On Thu, May 16, 2019 at 05:47:52PM -0400, Jeff King wrote: > On Thu, May 16, 2019 at 05:35:19PM +0900, Mike Hommey wrote: > > > On Wed, May 15, 2019 at 11:28:02PM -0400, Jeff King wrote: > > > Totally orthogonal, but I think we might also want to introduce a helper > > > capability so that import

Re: Closing fds twice when using remote helpers

2019-05-16 Thread Jeff King
On Thu, May 16, 2019 at 05:35:19PM +0900, Mike Hommey wrote: > On Wed, May 15, 2019 at 11:28:02PM -0400, Jeff King wrote: > > Totally orthogonal, but I think we might also want to introduce a helper > > capability so that import helpers can say "I always send 'done' to > > fast-import". And then w

Re: Closing fds twice when using remote helpers

2019-05-16 Thread Mike Hommey
On Wed, May 15, 2019 at 11:28:02PM -0400, Jeff King wrote: > Totally orthogonal, but I think we might also want to introduce a helper > capability so that import helpers can say "I always send 'done' to > fast-import". And then we can pass "--done" to fast-import, which means > it would detect a tr

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Jeff King
On Thu, May 16, 2019 at 09:48:02AM +0900, Mike Hommey wrote: > > diff --git a/transport-helper.c b/transport-helper.c > > index fcd2a58d0e..45cdf891ec 100644 > > --- a/transport-helper.c > > +++ b/transport-helper.c > > @@ -433,7 +433,7 @@ static int get_importer(struct transport *transport, > >

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Jeff King
On Thu, May 16, 2019 at 07:08:34AM +0900, Mike Hommey wrote: > > >> - Except, well, fds being what they are, we in fact just closed a fd > > >> from a packed_git->pack_fd. So, when use_pack is later called, and > > >> tries to mmap data from that pack, it fails because the file > > >> descri

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Mike Hommey
On Wed, May 15, 2019 at 07:56:09PM +0900, Mike Hommey wrote: > Hi, > > I started getting a weird error message during some test case involving > git-cinnabar, which is a remote-helper to access mercurial > repositories. > > The error says: > fatal: mmap failed: Bad file descriptor > > ... which

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Mike Hommey
On Wed, May 15, 2019 at 07:53:40PM -0400, Jeff King wrote: > On Thu, May 16, 2019 at 07:08:34AM +0900, Mike Hommey wrote: > > > > >> - Except, well, fds being what they are, we in fact just closed a fd > > > >> from a packed_git->pack_fd. So, when use_pack is later called, and > > > >> tries t

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Mike Hommey
On Wed, May 15, 2019 at 07:59:49PM +0200, Johannes Sixt wrote: > Am 15.05.19 um 13:43 schrieb Ævar Arnfjörð Bjarmason: > > > > On Wed, May 15 2019, Mike Hommey wrote: > > > >> Hi, > >> > >> I started getting a weird error message during some test case involving > >> git-cinnabar, which is a remot

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Johannes Sixt
Am 15.05.19 um 13:43 schrieb Ævar Arnfjörð Bjarmason: > > On Wed, May 15 2019, Mike Hommey wrote: > >> Hi, >> >> I started getting a weird error message during some test case involving >> git-cinnabar, which is a remote-helper to access mercurial >> repositories. >> >> The error says: >> fatal: m

Re: Closing fds twice when using remote helpers

2019-05-15 Thread Ævar Arnfjörð Bjarmason
On Wed, May 15 2019, Mike Hommey wrote: > Hi, > > I started getting a weird error message during some test case involving > git-cinnabar, which is a remote-helper to access mercurial > repositories. > > The error says: > fatal: mmap failed: Bad file descriptor > > ... which was not making much s

Closing fds twice when using remote helpers

2019-05-15 Thread Mike Hommey
Hi, I started getting a weird error message during some test case involving git-cinnabar, which is a remote-helper to access mercurial repositories. The error says: fatal: mmap failed: Bad file descriptor ... which was not making much sense. Some debugging later, and it turns out this is what ha