From: Patrick Steinhardt <ps@pks•im>
To: git@vger•kernel.org
Cc: Justin Tobler <jltobler@gmail•com>, Junio C Hamano <gitster@pobox•com>
Subject: [PATCH v2 00/23] Memory leak fixes (pt.7)
Date: Thu, 26 Sep 2024 13:45:56 +0200 [thread overview]
Message-ID: <cover.1727351062.git.ps@pks.im> (raw)
In-Reply-To: <cover.1726484308.git.ps@pks.im>
Hi,
this is the second version of another round of memory leak fixes.
There's only a single change compared to v1, namely a revised commit
message.
Thanks!
Patrick
Patrick Steinhardt (23):
builtin/help: fix dangling reference to `html_path`
builtin/help: fix leaking `html_path` when reading config multiple
times
git: fix leaking argv when handling builtins
submodule: fix leaking update strategy
builtin/submodule--helper: clear child process when not running it
builtin/submodule--helper: fix leaking error buffer
t/helper: fix leaking subrepo in nested submodule config helper
builtin/submodule--helper: fix leaking remote ref on errors
dir: fix off by one errors for ignored and untracked entries
builtin/pull: fix leaking "ff" option
diff: fix leaking orderfile option
parse-options: free previous value of `OPTION_FILENAME`
diffcore-order: fix leaking buffer when parsing orderfiles
builtin/repack: fix leaking configuration
builtin/difftool: plug several trivial memory leaks
trace2: destroy context stored in thread-local storage
submodule: fix leaking submodule ODB paths
grep: fix leaking grep pattern
promisor-remote: fix leaking partial clone filter
builtin/maintenance: fix leaking config string
builtin/maintenance: fix leak in `get_schedule_cmd()`
revision: fix leaking parents when simplifying commits
diffcore-break: fix leaking filespecs when merging broken pairs
builtin/difftool.c | 6 +
builtin/gc.c | 131 +++++++++++-------
builtin/help.c | 16 ++-
builtin/pull.c | 11 +-
builtin/repack.c | 57 ++++++--
builtin/submodule--helper.c | 26 +++-
combine-diff.c | 3 +-
diff.c | 7 +-
diff.h | 2 +-
diffcore-break.c | 4 +-
diffcore-order.c | 19 +--
dir.c | 6 +-
git.c | 22 ++-
grep.c | 2 +-
parse-options.c | 22 +--
promisor-remote.c | 2 +
revision.c | 5 +
submodule-config.c | 2 +-
submodule.c | 9 +-
submodule.h | 6 +-
t/helper/test-submodule-nested-repo-config.c | 2 +-
t/t0012-help.sh | 1 +
t/t1414-reflog-walk.sh | 1 +
...common-prefixes-and-directory-traversal.sh | 1 +
t/t4008-diff-break-rewrite.sh | 2 +
t/t4022-diff-rewrite.sh | 1 +
t/t4023-diff-rename-typechange.sh | 1 +
t/t4031-diff-rewrite-binary.sh | 1 +
t/t4056-diff-order.sh | 1 +
t/t4204-patch-id.sh | 1 +
t/t5310-pack-bitmaps.sh | 1 +
t/t5326-multi-pack-bitmaps.sh | 2 +
t/t5329-pack-objects-cruft.sh | 2 +
t/t6004-rev-list-path-optim.sh | 1 +
t/t6019-rev-list-ancestry-path.sh | 1 +
t/t6111-rev-list-treesame.sh | 1 +
t/t7061-wtstatus-ignore.sh | 1 +
t/t7406-submodule-update.sh | 1 +
t/t7407-submodule-foreach.sh | 1 +
t/t7408-submodule-reference.sh | 2 +
t/t7411-submodule-config.sh | 1 +
t/t7420-submodule-set-url.sh | 1 +
t/t7521-ignored-mode.sh | 1 +
t/t7524-commit-summary.sh | 2 +
t/t7601-merge-pull-config.sh | 1 +
t/t7700-repack.sh | 1 +
t/t7800-difftool.sh | 1 +
t/t7814-grep-recurse-submodules.sh | 1 +
t/t7900-maintenance.sh | 1 +
trace2/tr2_tls.c | 10 +-
50 files changed, 279 insertions(+), 124 deletions(-)
Range-diff against v1:
1: e3bed973af = 1: e3bed973af builtin/help: fix dangling reference to `html_path`
2: 4a59fe15ae = 2: 4a59fe15ae builtin/help: fix leaking `html_path` when reading config multiple times
3: ea3dd851ad = 3: ea3dd851ad git: fix leaking argv when handling builtins
4: 7cdd2691b7 = 4: 7cdd2691b7 submodule: fix leaking update strategy
5: 0d0964a2be = 5: 0d0964a2be builtin/submodule--helper: clear child process when not running it
6: 52d12e034b = 6: 52d12e034b builtin/submodule--helper: fix leaking error buffer
7: 96bd7f01d5 = 7: 96bd7f01d5 t/helper: fix leaking subrepo in nested submodule config helper
8: d088703d31 ! 8: d5e7a24aac builtin/submodule--helper: fix leaking remote ref on errors
@@ Metadata
## Commit message ##
builtin/submodule--helper: fix leaking remote ref on errors
- 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.
+ When `update_submodule()` fails we return with `die_message()`, which
+ only causes us to print the same message as `die()` would without
+ actually causing the process to die. We don't free memory in that case
+ and thus leak memory.
Fix the leak by freeing the remote ref.
9: d5c9cccb82 = 9: fca161d389 dir: fix off by one errors for ignored and untracked entries
10: 747c9a76a2 = 10: 2338b5e2a8 builtin/pull: fix leaking "ff" option
11: 85c0f9e5f5 = 11: cb08db4d37 diff: fix leaking orderfile option
12: 330b6c52a0 = 12: 650b89bcca parse-options: free previous value of `OPTION_FILENAME`
13: c975dfe462 = 13: cd79422087 diffcore-order: fix leaking buffer when parsing orderfiles
14: a5f3931eee = 14: e015d1704b builtin/repack: fix leaking configuration
15: c79a5118e4 = 15: 7bb07ec2f0 builtin/difftool: plug several trivial memory leaks
16: 0fb3dc55e5 = 16: 30928eb8f9 trace2: destroy context stored in thread-local storage
17: f1cb8122d1 = 17: 35f5de5467 submodule: fix leaking submodule ODB paths
18: 411df7248d = 18: 3d1cece660 grep: fix leaking grep pattern
19: 690de28bef = 19: da7768bad5 promisor-remote: fix leaking partial clone filter
20: ed4091255c = 20: 0a72fc83f7 builtin/maintenance: fix leaking config string
21: 46956bd8fb = 21: 95200b8a76 builtin/maintenance: fix leak in `get_schedule_cmd()`
22: 2a23df9a68 = 22: 8e7ea54863 revision: fix leaking parents when simplifying commits
23: 57a3a9e9f8 = 23: 8cbc41425f diffcore-break: fix leaking filespecs when merging broken pairs
--
2.46.2.852.g229c0bf0e5.dirty
next prev parent reply other threads:[~2024-09-26 11:46 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 11:45 [PATCH 00/23] Memory leak fixes (pt.7) Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 01/23] builtin/help: fix dangling reference to `html_path` Patrick Steinhardt
2024-09-16 16:24 ` Justin Tobler
2024-09-16 11:45 ` [PATCH 02/23] builtin/help: fix leaking `html_path` when reading config multiple times Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 03/23] git: fix leaking argv when handling builtins Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 04/23] submodule: fix leaking update strategy Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 05/23] builtin/submodule--helper: clear child process when not running it Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 06/23] builtin/submodule--helper: fix leaking error buffer Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 07/23] t/helper: fix leaking subrepo in nested submodule config helper Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 08/23] builtin/submodule--helper: fix leaking remote ref on errors Patrick Steinhardt
2024-09-16 18:51 ` Justin Tobler
2024-09-17 10:19 ` Patrick Steinhardt
2024-09-25 20:26 ` Junio C Hamano
2024-09-26 11:58 ` Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 09/23] dir: fix off by one errors for ignored and untracked entries Patrick Steinhardt
2024-09-20 16:43 ` Junio C Hamano
2024-09-16 11:45 ` [PATCH 10/23] builtin/pull: fix leaking "ff" option Patrick Steinhardt
2024-09-20 17:00 ` Junio C Hamano
2024-09-24 7:20 ` Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 11/23] diff: fix leaking orderfile option Patrick Steinhardt
2024-09-16 11:45 ` [PATCH 12/23] parse-options: free previous value of `OPTION_FILENAME` Patrick Steinhardt
2024-09-20 17:21 ` Junio C Hamano
2024-09-16 11:46 ` [PATCH 13/23] diffcore-order: fix leaking buffer when parsing orderfiles Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 14/23] builtin/repack: fix leaking configuration Patrick Steinhardt
2024-09-20 17:28 ` Junio C Hamano
2024-09-16 11:46 ` [PATCH 15/23] builtin/difftool: plug several trivial memory leaks Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 16/23] trace2: destroy context stored in thread-local storage Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 17/23] submodule: fix leaking submodule ODB paths Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 18/23] grep: fix leaking grep pattern Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 19/23] promisor-remote: fix leaking partial clone filter Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 20/23] builtin/maintenance: fix leaking config string Patrick Steinhardt
2024-09-20 17:59 ` Junio C Hamano
2024-09-16 11:46 ` [PATCH 21/23] builtin/maintenance: fix leak in `get_schedule_cmd()` Patrick Steinhardt
2024-09-16 11:46 ` [PATCH 22/23] revision: fix leaking parents when simplifying commits Patrick Steinhardt
2024-09-19 17:17 ` Junio C Hamano
2024-09-16 11:46 ` [PATCH 23/23] diffcore-break: fix leaking filespecs when merging broken pairs Patrick Steinhardt
2024-09-19 18:54 ` [PATCH 00/23] Memory leak fixes (pt.7) Junio C Hamano
2024-09-24 7:20 ` Patrick Steinhardt
2024-09-26 11:45 ` Patrick Steinhardt [this message]
2024-09-26 11:46 ` [PATCH v2 01/23] builtin/help: fix dangling reference to `html_path` Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 02/23] builtin/help: fix leaking `html_path` when reading config multiple times Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 03/23] git: fix leaking argv when handling builtins Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 04/23] submodule: fix leaking update strategy Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 05/23] builtin/submodule--helper: clear child process when not running it Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 06/23] builtin/submodule--helper: fix leaking error buffer Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 07/23] t/helper: fix leaking subrepo in nested submodule config helper Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 08/23] builtin/submodule--helper: fix leaking remote ref on errors Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 09/23] dir: fix off by one errors for ignored and untracked entries Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 10/23] builtin/pull: fix leaking "ff" option Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 11/23] diff: fix leaking orderfile option Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 12/23] parse-options: free previous value of `OPTION_FILENAME` Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 13/23] diffcore-order: fix leaking buffer when parsing orderfiles Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 14/23] builtin/repack: fix leaking configuration Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 15/23] builtin/difftool: plug several trivial memory leaks Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 16/23] trace2: destroy context stored in thread-local storage Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 17/23] submodule: fix leaking submodule ODB paths Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 18/23] grep: fix leaking grep pattern Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 19/23] promisor-remote: fix leaking partial clone filter Patrick Steinhardt
2024-09-26 11:46 ` [PATCH v2 20/23] builtin/maintenance: fix leaking config string Patrick Steinhardt
2024-09-26 11:47 ` [PATCH v2 21/23] builtin/maintenance: fix leak in `get_schedule_cmd()` Patrick Steinhardt
2024-09-26 11:47 ` [PATCH v2 22/23] revision: fix leaking parents when simplifying commits Patrick Steinhardt
2024-09-26 11:47 ` [PATCH v2 23/23] diffcore-break: fix leaking filespecs when merging broken pairs Patrick Steinhardt
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1727351062.git.ps@pks.im \
--to=ps@pks$(echo .)im \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=jltobler@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox