Re: [PATCH 08/23] builtin/submodule--helper: fix leaking remote ref on errors
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 17, 2024, 10:19 UTC
- Message-ID
- <ZulXjXSozNrXgMUM@pks.im>
- In-Reply-To
- <l5aljv4zlvkfpjsizofsypgfaxdzkihwghd3voxin5oxibuixz@fesroo5tihzi>
On Mon, Sep 16, 2024 at 01:51:21PM -0500, Justin Tobler wrote:
Show 10 quoted lines
> On 24/09/16 01:45PM, Patrick Steinhardt wrote: > > When `update_submodule()` fails we return with `die_message()`. > > Curiously enough, this causes a memory leak because we use the > > `run_process_parallel()` interfaces here, which swap out the die > > routine. > > Naive question, is `update_submodule()` itself being run in parallel > here? Is that why the die routine gets swapped out so a child process > dying is handled differently? Also is it correct to say leaks are not > considered when we "die" normally?
Hm. Revisiting this patch: my analysis was wrong. It's not the parallel subsystem that swaps out `die()`, but it's the fact that we call `die_message()`, which actually doesn't die. It really only prints the message you would see when we call `die()`, nothing more.
I'll amend the commit message and send out the amended version once there is more feedback to address.
Patrick