git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pranit Bauva <pranit.bauva@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>,
	Lars Schneider <larsxschneider@gmail.com>,
	Christian Couder <chriscool@tuxfamily.org>,
	Michael Haggerty <mhagger@alum.mit.edu>,
	Jeff King <peff@peff.net>
Subject: Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C
Date: Tue, 31 May 2016 12:03:09 +0530	[thread overview]
Message-ID: <CAFZEwPOhGuTkZcP+hmnCrNjvHGM_FKUOsQaGwWKoUzokCN5OFg@mail.gmail.com> (raw)
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:
> 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.

>> @@ -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!

>> +       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

  reply	other threads:[~2016-05-31  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 18:21 [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C Pranit Bauva
2016-05-30 21:48 ` Christian Couder
2016-05-31  6:33   ` Pranit Bauva [this message]
2016-05-31  4:25 ` Michael Haggerty
2016-05-31  6:40   ` Pranit Bauva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFZEwPOhGuTkZcP+hmnCrNjvHGM_FKUOsQaGwWKoUzokCN5OFg@mail.gmail.com \
    --to=pranit.bauva@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).