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

Re: git log - crash and core dump

From
Jeff King <peff@peff.net>
Date
Apr 16, 2013, 21:34 UTC
Message-ID
<20130416213414.GA11229@sigill.intra.peff.net>
In-Reply-To
<7v61zml0ow.fsf@alter.siamese.dyndns.org>
On Tue, Apr 16, 2013 at 12:45:03PM -0700, Junio C Hamano wrote:
Show 40 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 
> > Does this patch help?
> >
> >  pretty.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/pretty.c b/pretty.c
> > index d3a82d2..713eefc 100644
> > --- a/pretty.c
> > +++ b/pretty.c
> > @@ -405,8 +405,8 @@ void pp_user_info(const struct pretty_print_context *pp,
> >  	const char *mailbuf, *namebuf;
> >  	size_t namelen, maillen;
> >  	int max_length = 78; /* per rfc2822 */
> > -	unsigned long time;
> > -	int tz;
> > +	unsigned long time = 0;
> > +	int tz = 0;
> >  
> >  	if (pp->fmt == CMIT_FMT_ONELINE)
> >  		return;
> > @@ -438,8 +438,10 @@ void pp_user_info(const struct pretty_print_context *pp,
> >  	strbuf_add(&name, namebuf, namelen);
> >  
> >  	namelen = name.len + mail.len + 3; /* ' ' + '<' + '>' */
> > -	time = strtoul(ident.date_begin, &date, 10);
> > -	tz = strtol(date, NULL, 10);
> > +	if (ident.date_begin) {
> > +		time = strtoul(ident.date_begin, &date, 10);
> > +		tz = strtol(date, NULL, 10);
> > +	}
> >  
> >  	if (pp->fmt == CMIT_FMT_EMAIL) {
> >  		strbuf_addstr(sb, "From: ");
> 
> Looks like a sensible change.  split_ident_line() decided that the
> given input was mangled and decided there is no valid date (the
> input had <> where the timestamp string was required), so the
> updated code leaves the time/tz unspecified.
Hmm. This seemed oddly familiar to me, and indeed:
  http://thread.gmane.org/gmane.comp.version-control.git/216870/focus=217077

We need to fix blame, too, and there is a question of how "cat-file -p" behaves.

-Peff
Previous: Antoine PelisseNext: Ivan Lyapunov
Message 27 of 28 in “git log - crash and core dump”
  1. Ivan LyapunovApr 16, 2013
  2. Antoine PelisseApr 16, 2013
  3. René ScharfeApr 16, 2013
  4. Junio C HamanoApr 16, 2013
  5. René ScharfeApr 16, 2013
  6. Junio C HamanoApr 16, 2013
  7. Ivan LyapunovApr 17, 2013
  8. Ivan LyapunovApr 17, 2013
  9. John KeepingApr 17, 2013
  10. Ivan LyapunovApr 17, 2013
  11. Konstantin KhomoutovApr 17, 2013
  12. Junio C HamanoApr 17, 2013
  13. Jeff KingApr 17, 2013
  14. Junio C HamanoApr 17, 2013
  15. René ScharfeApr 17, 2013
  16. Jeff KingApr 17, 2013
  17. René ScharfeApr 17, 2013
  18. cat-file: print tags raw for "cat-file -p"Jeff King, Apr 17, 2013
  19. Eric SunshineApr 19, 2013
  20. pretty: handle broken commit headers gracefullyRené Scharfe, Apr 17, 2013
  21. blame: handle broken commit headers gracefullyRené Scharfe, Apr 17, 2013
  22. Jeff KingApr 17, 2013
  23. René ScharfeApr 17, 2013
  24. Junio C HamanoApr 17, 2013
  25. Jeff KingApr 18, 2013
  26. Antoine PelisseApr 16, 2013
  27. Jeff KingApr 16, 2013
  28. Ivan LyapunovApr 17, 2013

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.