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

Re: [PATCH] Don't segfault if we failed to inflate a packed delta

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 25, 2007, 17:56 UTC
Message-ID
<7v8x7z5why.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.0.999.0708250815150.25853@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 11 quoted lines
> Hmm. We should actually make "unpack_entry()" return print an error and 
> return NULL for these cases, rather than die, I think.
>
> Most of the callers seem to already check for NULL (not "load_tree()" in 
> fast-import.c), but for something like fsck, while "die()" is obviously 
> better than a SIGSEGV, we should probably continue and try to see what 
> else we find.
>
> (Although, to be honest, it might not matter. If your pack-file is corrupt 
> enough for this to trigger, there's seldom anything interesting fsck will 
> tell, so in practical terms this probably isn't a big deal).

But if the delta does not apply we already die(). Last night I and Shawn actually were wondering if it makes sense to have unpack_entry() die -- quite the opposite of being nicer to fsck.

Previous: Linus Torvalds
Message 5 of 5 in “Don't segfault if we failed to inflate a packed delta”
  1. Don't segfault if we failed to inflate a packed deltaShawn O. Pearce, Aug 25, 2007
  2. 1/2 blame: check return value from read_sha1_file()Junio C Hamano, Aug 25, 2007
  3. 2/2 pack-objects: check return value from read_sha1_file()Junio C Hamano, Aug 25, 2007
  4. Linus TorvaldsAug 25, 2007
  5. Junio C HamanoAug 25, 2007

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.