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

Re: git log - crash and core dump

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 16, 2013, 18:09 UTC
Message-ID
<516D93C4.1000100@lsrfire.ath.cx>
In-Reply-To
<CANKwXW1EXLiWgdVM4+k_11wu1Nyixp05PUXmQYP_gUXQKek_OA@mail.gmail.com>
Am 16.04.2013 18:55, schrieb Ivan Lyapunov:
Show 15 quoted lines
> git version 1.8.2.1 crashes on my ArchLinux x86_64 on git log command
> gdb bt is attached
> 
> git log | less
> does not crash in same repo
> 
> I cannot share a repo for a debug purposes since it's private repo of
> my employer
> but I can perform any suitable tests on repo to help this bug to be fixed
> 
> #0  0x00007ffff722b3e6 in ____strtoull_l_internal () from /usr/lib/libc.so.6
> #1  0x00000000004b31d4 in pp_user_info (pp=pp@entry=0x7fffffffd310,
> what=what@entry=0x521379 "Author", sb=sb@entry=0x7fffffffd290,
>      line=line@entry=0x7b3a45 "Ivan Lyapunov <ilyapunov@trueconf.ru>-
> <> 1354083115 +0400\ncommitter Ivan Lyapunov <ilyapunov@trueconf.ru>
So this is the author information, correct?
	Ivan Lyapunov <ilyapunov@trueconf.ru>-<> 1354083115 +0400
        |author name|  |---author email----| ^^^ |--time--| |tz-|
How did you manage to add the "-<>" after the email address?
What does git log in version 1.8.1 or earlier show for this commit?
Show 23 quoted lines
> 1354083115 +0400\n\n- small merge fixes",
> encoding=encoding@entry=0x505400 "UTF-8") at pretty.c:441
> #2  0x00000000004b533a in pp_header (sb=0x7fffffffd290,
> msg_p=0x7fffffffd228, commit=0x7c1e10, encoding=0x505400 "UTF-8",
> pp=0x7fffffffd310) at pretty.c:1415
> #3  pretty_print_commit (pp=pp@entry=0x7fffffffd310,
> commit=commit@entry=0x7c1e10, sb=sb@entry=0x7fffffffd290) at
> pretty.c:1545
> #4  0x00000000004a0b45 in show_log (opt=opt@entry=0x7fffffffd4d0) at
> log-tree.c:683
> #5  0x00000000004a1616 in log_tree_commit
> (opt=opt@entry=0x7fffffffd4d0, commit=commit@entry=0x7c1e10) at
> log-tree.c:859
> #6  0x0000000000438b03 in cmd_log_walk (rev=rev@entry=0x7fffffffd4d0)
> at builtin/log.c:310
> #7  0x00000000004395dd in cmd_log (argc=1, argv=0x7fffffffdd30,
> prefix=0x0) at builtin/log.c:582
> #8  0x000000000040562d in run_builtin (argv=0x7fffffffdd30, argc=1,
> p=0x754d18 <commands.21404+1080>) at git.c:282
> #9  handle_internal_command (argc=1, argv=0x7fffffffdd30) at git.c:444
> #10 0x0000000000404a6f in run_argv (argv=0x7fffffffdbd0,
> argcp=0x7fffffffdbdc) at git.c:490
> #11 main (argc=1, argv=0x7fffffffdd30) at git.c:565
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: ");
Previous: Antoine PelisseNext: Junio C Hamano
Message 3 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.