git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv3] refs.c: enable large transactions

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 25, 2015, 04:23 UTC
Message-ID
<xmqqzj5w25vv.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150424201734.GA4747@peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> 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?

Previous: Jeff KingNext: Jeff King
Message 10 of 12 in “[PATCHv3] refs.c: enable large transactions”
  1. Stefan BellerApr 22, 2015
  2. Junio C HamanoApr 23, 2015
  3. Stefan BellerApr 24, 2015
  4. Junio C HamanoApr 24, 2015
  5. Stefan BellerApr 24, 2015
  6. Jeff KingApr 24, 2015
  7. Jonathan NiederApr 24, 2015
  8. Stefan BellerApr 24, 2015
  9. Jeff KingApr 24, 2015
  10. Junio C HamanoApr 25, 2015
  11. Jeff KingApr 25, 2015
  12. Jeff KingApr 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.