From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 03C581F4B4 for ; Fri, 11 Sep 2020 15:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbgIKPBY (ORCPT ); Fri, 11 Sep 2020 11:01:24 -0400 Received: from cloud.peff.net ([104.130.231.41]:54488 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgIKO76 (ORCPT ); Fri, 11 Sep 2020 10:59:58 -0400 Received: (qmail 887 invoked by uid 109); 11 Sep 2020 13:59:29 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 11 Sep 2020 13:59:29 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 2650 invoked by uid 111); 11 Sep 2020 13:59:28 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 11 Sep 2020 09:59:28 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 11 Sep 2020 09:59:28 -0400 From: Jeff King To: Ondrej Pohorelsky Cc: git@vger.kernel.org Subject: Re: Git doesn't honor NO_PROXY environment variable while cloning Message-ID: <20200911135928.GA1986935@coredump.intra.peff.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org [tl;dr This looks to me like a problem in libcurl. I've included my whole line of reasoning below. Folks interested in libcurl might want to jump straight to the backtrace]. On Fri, Sep 11, 2020 at 02:15:59PM +0200, Ondrej Pohorelsky wrote: > we've got a bug[0] reported in Red Hat Bugzilla. It seems like Git > doesn't honor NO_PROXY environment variable while cloning repositories It's not so much "doesn't honor NO_PROXY" as "NO_PROXY seems to trigger another bug". Here's a slightly simplified recipe: [set up our bogus proxy] $ export HTTPS_PROXY=https://user:pass@bad.proxy [so far so good; we expect this to complain about the proxy] $ git clone https://github.com/git/git Cloning into 'git'... fatal: unable to access 'https://github.com/git/git/': Could not resolve proxy: bad.proxy [now let's set NO_PROXY] $ export NO_PROXY=github.com $ git clone https://github.com/git/git Cloning into 'git'... $ echo $? 128 So we are looking at the variable, but then we exit with failure (and with nothing to stderr!). That was with v2.28 above. But let's try it with the current tip of master: $ git clone https://github.com/git/git Cloning into 'git'... error: git-remote-https died of signal 11 Ah, that's interesting. The switch in behavior is due to 675df192c5 (transport-helper: do not run git-remote-ext etc. in dashed form, 2020-08-26). Before that patch the transport code ran git-remote-https directly. If it returned a non-zero exit code, we just assumed it had printed its own error to stdout and exited. But after that patch we run "git remote-https", and the git.c wrapper has code to complain about segfaults. So that's a little digression from our real bug. But it points us in the right direction: remote-https is segfaulting. So here's a more direct reproduction: export HTTPS_PROXY=https://user:pass@bad.proxy export NO_PROXY=github.com echo list | ./git-remote-https https://github.com/git/git which results in a segfault. And we can run that process under gdb to get a backtrace: echo list >input gdb -ex 'set args https://github.com/git/git