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

Re: [PATCH v2] rerere: fix crash during clear

From
Marcel Röthke <marcel@roethke.info>
Date
Feb 24, 2024, 11:25 UTC
Message-ID
<ZdnSEFgLdev3L2qs@roethke.info>
In-Reply-To
<xmqqplwsx730.fsf@gitster.g>
On 2024-02-19 17:22:43, Junio C Hamano wrote:
Show 10 quoted lines
> Marcel Röthke <marcel@roethke.info> writes:
>
> > When rerere_clear is called, for instance when aborting a rebase, and
> > the current conflict does not have a pre or postimage recorded git
> > crashes with a SEGFAULT in has_rerere_resolution when accessing the
> > status member of struct rerere_dir.
>
> I had to read this twice before realizing the reason why I found it
> hard to grok was because of a missing comma between "recorded" and
> "git".
fixed
Show 12 quoted lines
> > This happens because scan_rerere_dir
> > only allocates the status field in struct rerere_dir when a post or
> > preimage was found.
>
> But that is not really the root cause, no?  Readers following the
> above text are probably wondering why the preimage was not recorded,
> when a conflict resulted in stopping a mergy-command and invoking
> rerere machinery, before rerere_clear() got called.  Is that
> something that usually happen?  How?  Do we have a reproduction
> sequence of such a state that we can make it into a new test in
> t4200 where we already have tests for "git rerere clear" and its
> friends?

I'm unfortunately not sure how it happened. I do have the initial state of the repository and I think I know the commands that were executed, but I could not reproduce it.

I will look into adding a test case though.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 15 in “rerere: fix crash in during clear”
  1. rerere: fix crash in during clearMarcel Röthke, Feb 18, 2024
  2. Kristoffer HaugsbakkFeb 18, 2024
  3. Marcel RöthkeFeb 18, 2024
  4. rerere: fix crash during clearMarcel Röthke, Feb 18, 2024
  5. Junio C HamanoFeb 20, 2024
  6. Marcel RöthkeFeb 24, 2024
  7. Junio C HamanoMar 24, 2024
  8. Marcel RöthkeMar 25, 2024
  9. Marcel RöthkeApr 7, 2024
  10. Junio C HamanoApr 8, 2024
  11. rerere: fix crashes due to unmatched opening conflict markersMarcel Röthke, Apr 9, 2024
  12. Junio C HamanoApr 12, 2024
  13. Junio C HamanoApr 15, 2024
  14. Marcel RöthkeApr 16, 2024
  15. rerere: fix crashes due to unmatched opening conflict markersMarcel Röthke, Apr 16, 2024

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.