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

Re: git log - crash and core dump

From
Ivan Lyapunov <dront78@gmail.com>
Date
Apr 17, 2013, 05:22 UTC
Message-ID
<CANKwXW0WkZXJMi+6T8ymvTi5-JpRfrn_xKmjGw-FsXpaCGuK5g@mail.gmail.com>
In-Reply-To
<CANKwXW2h1+CGw2M3CmeXzXAX+wdCPgs5Ff_bGvTgYVpkwpijUw@mail.gmail.com>

I checked René Scharfe's patch and it works - no more git log crash. Also I checked a broken commits by git show and the most of them created by me. I can confirm I never used anyting else except console git commit or netbeans gui to commit, which is just git gui wrapper tool. Several commits is a just branch merge commits with no changes at all. The modification time across broken commits is around from near end of Oct to end of Nov 2012 and there are good commits between broken maded on the same machine. I hope it helps to reproduce the problem. Also it would be good if there are some way to fix this errors in repo, since we found the same bugs in our Eclipse-based Android project repo Ivan

2013/4/17 Ivan Lyapunov <dront78@gmail.com>:
Show 116 quoted lines
> Looks like I missed a lot of fun I'm sleeping ;)
>
> The current repo is a product of our core crossplatform team, working
> on Linux/MacOSX/Win32 environment. The Linux environment also
> separates on Ubuntu/ArchLinux distros, and probably most of repo bugs
> coming from ArchLinux, since other environments are stable in time. I
> can't say exact git verison the bugs was introduced, but we have a
> commits, dated by 0 secs since the Epoch and invalid Author fields
> also. Also git fsck --full got the following stats on repo
>
> Checking object directories: 100% (256/256), done.
> error in commit 7eeb541987af8a589c6ebee53346c48a13142233: invalid
> author/committer line - missing space before date
> error in commit c23b0a487143e5d5d96cdc5354975e95114241ee: invalid
> author/committer line - missing space before date
> error in commit c7fa421863e073996b5d1ba6beb6001b9d146cba: invalid
> author/committer line - missing space before date
> error in commit 131155bd75c588bcd251b719c483d1d5bcb78504: invalid
> author/committer line - missing space before date
> error in commit 0888e7ffe6ae0aaf1b6d1ba67d05715487f88a52: invalid
> author/committer line - missing space before date
> error in commit 3cdeddd15c251a13fb3e79844ed3ea0e02cb611a: invalid
> author/committer line - missing space before date
> error in commit 21f9fe1565d89da845fc7080495c922103bacf24: invalid
> author/committer line - missing space before date
> error in commit f557d3427ba1bb33a1c1fd2c7936efa7e7c70281: invalid
> author/committer line - missing space before date
> error in commit c625943779c72b41b08b41730e56126b89cbb7b4: invalid
> author/committer line - missing space before date
> error in commit a83fc863991aae2bdad148a5897ed4315792dd82: invalid
> author/committer line - missing space before date
> error in commit 207321f773e695b2ae88884c34620bc663383f90: invalid
> author/committer line - missing space before date
> error in commit 67368e9eda9892acd6c6ebf03dd6f22b6de2db8a: invalid
> author/committer line - missing space before date
> error in commit 525a5d508a7f466a1339752e921517f4db8c4af6: invalid
> author/committer line - missing space before date
> error in commit 38215e27f74caa342e3353c4cd548fcf8c1df3dc: invalid
> author/committer line - missing space before date
> error in commit 1ee0167194eb34caca2c20ce5c74d062fc898718: invalid
> author/committer line - missing space before date
> error in commit 3274c469b981285f9a4d0b0a62afbb8f4d3e93ae: invalid
> author/committer line - missing space before date
> error in commit f37ab83f71ca93f42256e05efdd4244eb321efaf: invalid
> author/committer line - missing space before date
> error in commit 9bb6f7d63bb5a37b8afc3ae090bd6f34deb68633: invalid
> author/committer line - missing space before date
> Checking objects: 100% (9576/9576), done.
>
> And I haven't find a way to fix without loosing a commits history, so
> we left them as it is. I will check the approved patches and writeback
> a little bit later. Thanks a lot for looking this
>
> Ivan
>
> 2013/4/17 Junio C Hamano <gitster@pobox.com>:
>> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>>
>>> How about making split_ident_line() a bit friendlier be letting it
>>> provide the epoch as default time stamp instead of NULL?
>>
>> Two knee-jerk concerns I have without going back to the callers:
>>
>>  * Would that "0" ever be given to the approxidate parser, which
>>    rejects ancient dates in numbers-since-epoch format without @
>>    prefix?
>>
>>  * Does any existing caller use the NULL as a sign to see the input
>>    was without date and act on that information?
>>
>>
>>> -- >8 --
>>> Subject: ident: let split_ident_line() provide a default time stamp
>>>
>>> If a commit has a broken time stamp, split_ident_line() sets
>>> date_begin, date_end, tz_begin and tz_end to NULL.  Not all callers
>>> are prepared to handle that case and segfault.
>>>
>>> Instead of fixing them and having to be careful while implementing
>>> the next caller, provide a string consisting of the number zero as
>>> default value, representing the UNIX epoch.  That's the value that
>>> git log showed before it was converted to use split_ident_line().
>>>
>>> Reported-by: Ivan Lyapunov <dront78@gmail.com>
>>> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
>>> ---
>>>  ident.c | 10 ++++++----
>>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/ident.c b/ident.c
>>> index 1c123e6..ee840f4 100644
>>> --- a/ident.c
>>> +++ b/ident.c
>>> @@ -191,6 +191,8 @@ static void strbuf_addstr_without_crud(struct strbuf *sb, const char *src)
>>>       sb->buf[sb->len] = '\0';
>>>  }
>>>
>>> +static const char zero_string[] = "0";
>>> +
>>>  /*
>>>   * Reverse of fmt_ident(); given an ident line, split the fields
>>>   * to allow the caller to parse it.
>>> @@ -254,10 +256,10 @@ int split_ident_line(struct ident_split *split, const char *line, int len)
>>>       return 0;
>>>
>>>  person_only:
>>> -     split->date_begin = NULL;
>>> -     split->date_end = NULL;
>>> -     split->tz_begin = NULL;
>>> -     split->tz_end = NULL;
>>> +     split->date_begin = zero_string;
>>> +     split->date_end = zero_string + strlen(zero_string);
>>> +     split->tz_begin = zero_string;
>>> +     split->tz_end = zero_string + strlen(zero_string);
>>>       return 0;
>>>  }
Previous: Ivan LyapunovNext: John Keeping
Message 8 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.