From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
Git Mailing List <git@vger.kernel.org>,
Jonathan Tan <jonathantanmy@google.com>
Subject: Re: [PATCH v2] fetch-pack: clear alternate shallow when complete
Date: Wed, 06 Feb 2019 18:47:55 -0800 [thread overview]
Message-ID: <xmqq4l9gs49w.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CACsJy8Ae0ZZjh8+f+TwbfJ-V9SzrHpDFyfjwScwKJj+kc7FDTQ@mail.gmail.com> (Duy Nguyen's message of "Thu, 7 Feb 2019 09:32:21 +0700")
Duy Nguyen <pclouds@gmail.com> writes:
> On Thu, Feb 7, 2019 at 7:00 AM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
>>
>> When we write an alternate shallow file in update_shallow, we write it
>> into the lock file. The string stored in alternate_shallow_file is
>> copied from the lock file path, but it is freed the moment that the lock
>> file is closed, since we call strbuf_release to free that path.
>>
>> This used to work, since we did not invoke git index-pack more than
>> once. However, we now do, and starting with bd0b42aed3 (fetch-pack: do
>> not take shallow lock unnecessarily - 2019-01-10), we no longer reset
>> this value unconditionally; consequently, we reuse the freed memory.
>> Ensure we reset the value to NULL to avoid using freed memory. git
>> index-pack will read the repository's shallow file, which will have been
>> updated with the correct information.
>
> The patch looks good to me.
Thanks, all.
next prev parent reply other threads:[~2019-02-07 2:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 8:58 t5702 failing under ASan on master brian m. carlson
2019-01-30 10:07 ` Duy Nguyen
2019-01-30 11:40 ` brian m. carlson
2019-01-31 18:12 ` Junio C Hamano
2019-02-04 0:06 ` [PATCH] fetch-pack: clear alternate shallow when complete brian m. carlson
2019-02-04 10:34 ` Duy Nguyen
2019-02-05 16:26 ` Jonathan Tan
2019-02-06 23:26 ` brian m. carlson
2019-02-06 23:59 ` [PATCH v2] " brian m. carlson
2019-02-07 2:32 ` Duy Nguyen
2019-02-07 2:47 ` Junio C Hamano [this message]
2019-02-07 2:53 ` Junio C Hamano
2019-02-07 4:07 ` brian m. carlson
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=xmqq4l9gs49w.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=pclouds@gmail.com \
--cc=sandals@crustytoothpaste.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).