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

Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
May 31, 2016, 06:33 UTC
Message-ID
<CAFZEwPOhGuTkZcP+hmnCrNjvHGM_FKUOsQaGwWKoUzokCN5OFg@mail.gmail.com>
In-Reply-To
<CAP8UFD2wAKN2CsfndLNeCb1dAEH5H-wj_6spAm+d_AtBQDZfhQ@mail.gmail.com>
Hey Christian,

On Tue, May 31, 2016 at 3:18 AM, Christian Couder <christian.couder@gmail.com> wrote:

Show 16 quoted lines
> On Mon, May 30, 2016 at 8:21 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>> ---
>> This patch contains a bug. I have tried to identify the bug and I suppose it
>> exists in do_for_each_entry_in_dir(). I have reproduced the debugging session
>> at this link[1]. I have seen that some patches in mailing list regarding
>> iterating over refs. Will those affect this? Or is this bug fixed in those
>> patches?
>>
>> [1]: http://paste.ubuntu.com/16830752/
>
> The debug session seems to use code source from a previous version of
> this patch.
> Also it is not cear in which context you run git under gdb. What have
> you done before?
> And we don't see a crash. Could you show the crash and run the "bt"
> command in gdb to get a backtrace?

The segmentation fault will occur if I move to the next step ie. evaluate the value entry->flag.

Show 12 quoted lines
>> @@ -79,11 +90,42 @@ int write_terms(const char *bad, const char *good)
>>         strbuf_release(&content);
>>         return (res < 0) ? -1 : 0;
>>  }
>> +
>> +int remove_bisect_ref(const char *refname, const struct object_id *oid,
>> +                      int flag, void *cb_data)
>> +{
>> +       char *ref;
>> +       ref = xstrfmt("refs/bisect/%s", refname);
>
> You could save one line by concatenating the 2 above lines.
Sure!
Show 5 quoted lines
>> +       if (delete_ref(ref, oid->hash, flag))
>> +               return error(_("couldn't delete the ref %s\n"), ref);
>> +       return 0;
>
> You need to free "ref".
Sure!

Regards, Pranit Bauva

Previous: Christian CouderNext: Michael Haggerty
Message 3 of 5 in “bisect--helper: `bisect_clean_state` shell function in C”
  1. bisect--helper: `bisect_clean_state` shell function in CPranit Bauva, May 30, 2016
  2. Christian CouderMay 30, 2016
  3. Pranit BauvaMay 31, 2016
  4. Michael HaggertyMay 31, 2016
  5. Pranit BauvaMay 31, 2016

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.