Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Stefan Beller
Hi Junio, On Thu, May 10, 2018 at 2:27 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> So this would go with the latest sb/object-store-alloc ? >> >> My impression was that we never call repo_clear() on >> the_repository, which would allow us to special case >> the_repository further just

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Junio C Hamano
Stefan Beller writes: > So this would go with the latest sb/object-store-alloc ? > > My impression was that we never call repo_clear() on > the_repository, which would allow us to special case > the_repository further just as I did in v2 of that series[1] by > having static allocations for certai

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Duy Nguyen
On Wed, May 9, 2018 at 8:00 PM, Duy Nguyen wrote: > discard_index(repo->index); > if (repo->index != &the_index) > FREE_AND_NULL(repo->index); > >> What is your use case of repo_clear(the_repository)? > > No actual use case right now. See [1] for the code that triggered > this. I do want t

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Stefan Beller
On Wed, May 9, 2018 at 11:00 AM, Duy Nguyen wrote: > On Wed, May 9, 2018 at 7:50 PM, Stefan Beller wrote: >>> I was trying to test the new parsed_object_pool_clear() and found this. >> >> So this would go with the latest sb/object-store-alloc ? > > No this should be separate because sb/object-st

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Duy Nguyen
On Wed, May 9, 2018 at 7:50 PM, Stefan Beller wrote: >> I was trying to test the new parsed_object_pool_clear() and found this. > > So this would go with the latest sb/object-store-alloc ? No this should be separate because sb/object-store-alloc did not even touch this code. I mistakenly thought

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Duy Nguyen
On Wed, May 9, 2018 at 7:42 PM, Elijah Newren wrote: > On Wed, May 9, 2018 at 10:04 AM, Nguyễn Thái Ngọc Duy > wrote: >> the_repository is special. One of the special things about it is that >> it does not allocate a new index_state object like submodules but >> points to the global the_index va

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Stefan Beller
On Wed, May 9, 2018 at 10:04 AM, Nguyễn Thái Ngọc Duy wrote: > the_repository is special. One of the special things about it is that > it does not allocate a new index_state object like submodules but > points to the global the_index variable instead. As a global variable, > the_index cannot be fr

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Elijah Newren
On Wed, May 9, 2018 at 10:04 AM, Nguyễn Thái Ngọc Duy wrote: > the_repository is special. One of the special things about it is that > it does not allocate a new index_state object like submodules but > points to the global the_index variable instead. As a global variable, > the_index cannot be fr

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Brandon Williams
On 05/09, Nguyễn Thái Ngọc Duy wrote: > the_repository is special. One of the special things about it is that > it does not allocate a new index_state object like submodules but > points to the global the_index variable instead. As a global variable, > the_index cannot be free()'d. > > Add an exce

[PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-09 Thread Nguyễn Thái Ngọc Duy
the_repository is special. One of the special things about it is that it does not allocate a new index_state object like submodules but points to the global the_index variable instead. As a global variable, the_index cannot be free()'d. Add an exception for this in repo_clear(). In the future perh