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

Re: Segmentation fault with latest git (070c57df)

From
Jeff King <peff@peff.net>
Date
Jan 31, 2013, 07:35 UTC
Message-ID
<20130131073543.GA5342@sigill.intra.peff.net>
In-Reply-To
<CALWbr2y8veWYRwEGrbGq-PhxZjXbBF5HMgQXrRr=1JzGQ9Y-tQ@mail.gmail.com>
On Thu, Jan 31, 2013 at 08:02:06AM +0100, Antoine Pelisse wrote:
Show 5 quoted lines
> In "clean.c" we have a "string_list" created on the stack with
> "STRING_LIST_INIT_NODUP" (there are probably others, I stopped at the
> first occurrence).
> But, "STRING_LIST_INIT_NODUP" doesn't init the "list->cmp" pointer
> which can thus be random.

I don't think that is the problem. Extra struct members that are not mentioned by an initializer will get set to 0 or NULL.

A code path that tried to initialize each member individually would run into problems, but I could not find any such code path (all of them either use an initializer, are static, or memset the struct to all-zeroes).

-Peff
Previous: Antoine Pelisse
Message 4 of 4 in “Segmentation fault with latest git (070c57df)”
  1. Jongman HeoJan 31, 2013
  2. Jeff KingJan 31, 2013
  3. Antoine PelisseJan 31, 2013
  4. Jeff KingJan 31, 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.