public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Jonathan Nieder <jrnieder@gmail•com>,
	Stefan Beller <sbeller@google•com>,
	Michael Haggerty <mhagger@alum•mit.edu>,
	"git\@vger.kernel.org" <git@vger•kernel.org>
Subject: Re: [PATCHv3] refs.c: enable large transactions
Date: Fri, 24 Apr 2015 21:23:16 -0700	[thread overview]
Message-ID: <xmqqzj5w25vv.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150424201734.GA4747@peff.net> (Jeff King's message of "Fri, 24 Apr 2015 16:17:34 -0400")

Jeff King <peff@peff•net> writes:

> So if anything, I think my inclination would be to make it easier to
> help people (and ourselves) get a backtrace from gdb.
>
> One can get a core for a running process with gcore, or trigger a
> coredump by killing with SIGABRT. But catching it at the exact moment of
> a die() is a bit hard without support from the program. What about
> something like this:
>
> diff --git a/usage.c b/usage.c
> index ed14645..fa92190 100644
> --- a/usage.c
> +++ b/usage.c
> @@ -34,6 +34,8 @@ static NORETURN void usage_builtin(const char *err, va_list params)
>  static NORETURN void die_builtin(const char *err, va_list params)
>  {
>  	vreportf("fatal: ", err, params);
> +	if (git_env_bool("GIT_DIE_ABORT", 0))
> +		abort();
>  	exit(128);
>  }

Two comments.

There probably are more than a few places that calls exit(128)
without using die(), upon seeing that some helper function returned
an error code, because the helper already gave an error message.

The proposals so far, including this one, assume that the bug
reporter will first fail the operation with "normal" invocation
of Git (e.g. without GIT_DIE_ABORT exported) and then retry the
same operation in a different way (e.g. with GIT_DIE_ABORT) to
give us something that would help diagnosis.  Such a user could
just rerun Git under gdb with breakpoint set to die_builtin, no?

  reply	other threads:[~2015-04-25  4:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 21:30 [PATCHv3] refs.c: enable large transactions Stefan Beller
2015-04-23 17:56 ` Junio C Hamano
2015-04-24  0:21   ` Stefan Beller
2015-04-24  1:37     ` Junio C Hamano
2015-04-24 16:16       ` Stefan Beller
2015-04-24 17:19         ` Jeff King
2015-04-24 18:12         ` Jonathan Nieder
2015-04-24 18:31           ` Stefan Beller
2015-04-24 20:17           ` Jeff King
2015-04-25  4:23             ` Junio C Hamano [this message]
2015-04-25  5:00               ` Jeff King
2015-04-25  5:24                 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzj5w25vv.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=mhagger@alum$(echo .)mit.edu \
    --cc=peff@peff$(echo .)net \
    --cc=sbeller@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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