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

Re: Segmentation fault with latest git (070c57df)

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 4, 2013, 09:16 UTC
Message-ID
<7vsj5c4exz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130204083701.GA30835@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> Do we want to do anything with the other dependency hole I found here:
>
>   http://article.gmane.org/gmane.comp.version-control.git/215211
>
> It's definitely a potential problem, but I don't think we have any
> reports of it happening in practice, so it might not be worth worrying
> about. Doing a clean version of the fix here:
>
>   http://article.gmane.org/gmane.comp.version-control.git/215212
>
> would probably involve reorganizing our .depend directory structure,
> unless somebody can cook up some clever use of make's patsubst.
As I understand how the current set-up works:
 * Initially, we do not have foo.o but foo.c.  We automatically
   build foo.o because it depends on foo.c via the "%.o : %.c" rule,
   and as a side effect, we also build .depend/foo.o.d file;
 * Then, if any real dependency used to build the existing foo.o
   that is recorded in .depend/foo.o.d file changes, foo.o gets
   rebuilt, which would update .depend/foo.o.d again for the next
   invocation.

The case where you lose .depend/foo.o.d is a special case of getting a wrong information in .depend/foo.o.d, which may happen by using a broken compiler during the initial build, or going over quota and getting .depend/foo.o.d truncated, or by other breakages. The user may have done "rm -rf .depend" to lose it, or the user may have done something like this to munge it:

	find -name '.git' -type d -prune -o -print0 |
        xargs -0 sed -i -e 's/foo/bar/g'

forgetting that just like .git, .depend is precious and should not be touched.

I think this really boils down to where we draw the "this is good enough" line. I am not sure if losing the file as in $gmane/215211 is common enough to be special cased to buy us much, while leaving other ".depend/foo.o.d was updated to contain a wrong info" cases still broken.

And of course the case where .depend/foo.o.d is munged by mistake cannot be solved without recompiling everything all the time, so...

Previous: Jeff KingNext: Junio C Hamano
Message 4 of 13 in “Re: Re: Segmentation fault with latest git (070c57df)”
  1. Jongman HeoFeb 4, 2013
  2. Junio C HamanoFeb 4, 2013
  3. Jeff KingFeb 4, 2013
  4. Junio C HamanoFeb 4, 2013
  5. Junio C HamanoFeb 4, 2013
  6. Jeff KingFeb 4, 2013
  7. Jeff KingFeb 4, 2013
  8. Junio C HamanoFeb 4, 2013
  9. Jonathan NiederFeb 4, 2013
  10. samMay 15, 2013
  11. samMay 15, 2013
  12. Ramkumar RamachandraMay 16, 2013
  13. Ramkumar RamachandraMay 16, 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.