From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Brad Hein <linuxbrad@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] http: fix segfault in handle_curl_result
Date: Fri, 12 Oct 2012 03:30:53 -0400 [thread overview]
Message-ID: <20121012073053.GC17026@sigill.intra.peff.net> (raw)
In-Reply-To: <20121012062249.GB17026@sigill.intra.peff.net>
On Fri, Oct 12, 2012 at 02:22:49AM -0400, Jeff King wrote:
> We should probably not be passing the slot to handle_curl_results at
> all, since it may have already been reused and is not safe to read. The
> only thing we do with it is to set up any new auth information in the
> curl handle. This doesn't suffer the same problem because a reused slot
> will always have a curl handle. However, it means we may be setting the
> auth information for a random handle. Which is OK, since all handles use
> the same auth information anyway. But it should also be pointless,
> because since dfa1725 (fix http auth with multiple curl handles) we
> always refresh the curl handle's auth information whenever we get an
> active slot.
>
> However, I'm leaving that out of this patch. Commit 8809703 was
> supposed to be a refactor with zero behavior changes, but it regressed.
> This fixes the regression by behaving exactly as we did beforehand. We
> can build the other thing on top.
I took a look at this, and indeed, it breaks existing code. But the
broken code is wrong and is easy to fix. So here is a series to do this,
on top of the one I am responding to.
These ones shouldn't have any functional impact, but do clean up the
code. I'd recommend the regression fix I already posted for maint and
1.8.0, and leave these to cook for post-1.8.0.
[1/2]: remote-curl: do not call run_slot repeatedly
[2/2]: http: do not set up curl auth after a 401
-Peff
next prev parent reply other threads:[~2012-10-12 7:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJa+X0OkzAX9E2SnDmU=on0yzzVZ9OMa2dJZgKMK=gQu2Rhf_Q@mail.gmail.com>
2012-10-12 4:58 ` git fails: segfault at 0 ip 00000000004076d5 sp 00007fff7806ebc0 Brad Hein
2012-10-12 6:22 ` [PATCH] http: fix segfault in handle_curl_result Jeff King
2012-10-12 7:30 ` Jeff King [this message]
2012-10-12 7:35 ` [PATCH 1/2] remote-curl: do not call run_slot repeatedly Jeff King
2012-10-12 7:35 ` [PATCH 2/2] http: do not set up curl auth after a 401 Jeff King
2012-10-12 13:39 ` Brad Hein
2012-10-12 16:46 ` [PATCH] http: fix segfault in handle_curl_result Junio C Hamano
2012-10-12 16:29 ` git fails: segfault at 0 ip 00000000004076d5 sp 00007fff7806ebc0 Erik Faye-Lund
2012-10-12 16:34 ` Erik Faye-Lund
2012-10-12 17:12 ` Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121012073053.GC17026@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=linuxbrad@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).