git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] fix resource leaks in test helpers
@ 2025-07-22 17:41 Hoyoung Lee
  2025-07-22 17:41 ` [PATCH v3 1/2] t/helper/test-truncate: close file descriptor after truncation Hoyoung Lee
  2025-07-22 17:41 ` [PATCH v3 2/2] t/helper/test-delta: fix possible resource leak and ensure safe cleanup Hoyoung Lee
  0 siblings, 2 replies; 20+ messages in thread
From: Hoyoung Lee @ 2025-07-22 17:41 UTC (permalink / raw)
  To: git; +Cc: Hoyoung Lee

Thanks for the detailed and thoughtful reviews. Your comments helped me better understand how resource cleanup should be handled, especially when dealing with early program termination.

I especially appreciate your in-depth explanation regarding the difference between true resource leaks and stack-unwinding cases. The example you gave was very insightful, and it clarified how automated tools and reviewers should assess whether a resource is truly leaked. Thank you for taking the time to provide such a clear and instructive explanation.

Hoyoung Lee (2):
  t/helper/test-truncate: close file descriptor after truncation
  t/helper/test-delta: fix possible resource leak and ensure safe
    cleanup

 t/helper/test-delta.c    | 9 +++++----
 t/helper/test-truncate.c | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH v3 0/2] fix resource leaks in test helpers
@ 2025-07-22 17:48 Hoyoung Lee
  0 siblings, 0 replies; 20+ messages in thread
From: Hoyoung Lee @ 2025-07-22 17:48 UTC (permalink / raw)
  To: git; +Cc: Hoyoung Lee

Changes since v2:
- Dropped the second patch (`builtin/archive.c`) as discussed.
- Combined both resource leak fixes in `t/helper/test-delta.c` into a
  single patch using a unified cleanup path via `goto`.
- Ensured file descriptor is safely initialized and closed only when needed.

Thanks for the detailed and thoughtful reviews. Your comments helped me better understand how resource cleanup should be handled, especially when dealing with early program termination.

I especially appreciate your in-depth explanation regarding the difference between true resource leaks and stack-unwinding cases. The example you gave was very insightful, and it clarified how automated tools and reviewers should assess whether a resource is truly leaked. Thank you for taking the time to provide such a clear and instructive explanation.

Hoyoung Lee (2):
  t/helper/test-truncate: close file descriptor after truncation
  t/helper/test-delta: fix possible resource leak and ensure safe
    cleanup

 t/helper/test-delta.c    | 9 +++++----
 t/helper/test-truncate.c | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH v3 0/2] fix resource leaks in test helpers
@ 2025-07-22 17:50 Hoyoung Lee
  0 siblings, 0 replies; 20+ messages in thread
From: Hoyoung Lee @ 2025-07-22 17:50 UTC (permalink / raw)
  To: git; +Cc: Hoyoung Lee

Changes since v2:
- Dropped the second patch (`builtin/archive.c`) as discussed.
- Combined both resource leak fixes in `t/helper/test-delta.c` into a
  single patch using a unified cleanup path via `goto`.
- Ensured file descriptor is safely initialized and closed only when needed.

Thanks for the detailed and thoughtful reviews. Your comments helped me better understand how resource cleanup should be handled, especially when dealing with early program termination.

I especially appreciate your in-depth explanation regarding the difference between true resource leaks and stack-unwinding cases. The example you gave was very insightful, and it clarified how automated tools and reviewers should assess whether a resource is truly leaked. Thank you for taking the time to provide such a clear and instructive explanation.

Hoyoung Lee (2):
  t/helper/test-truncate: close file descriptor after truncation
  t/helper/test-delta: fix possible resource leak and ensure safe
    cleanup

 t/helper/test-delta.c    | 9 +++++----
 t/helper/test-truncate.c | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-07-24  0:03 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 17:41 [PATCH v3 0/2] fix resource leaks in test helpers Hoyoung Lee
2025-07-22 17:41 ` [PATCH v3 1/2] t/helper/test-truncate: close file descriptor after truncation Hoyoung Lee
2025-07-22 21:48   ` Junio C Hamano
2025-07-22 17:41 ` [PATCH v3 2/2] t/helper/test-delta: fix possible resource leak and ensure safe cleanup Hoyoung Lee
2025-07-23  7:28   ` Eric Sunshine
2025-07-23  7:55     ` Jeff King
2025-07-23  8:06       ` Jeff King
2025-07-23  8:17         ` Eric Sunshine
2025-07-23 23:59         ` Jeff King
2025-07-24  0:00           ` [PATCH 1/3] test-delta: handle errors with die() Jeff King
2025-07-24  0:02           ` [PATCH 2/3] test-delta: use strbufs to hold input files Jeff King
2025-07-24  0:03           ` [PATCH 3/3] test-delta: close output descriptor after use Jeff King
2025-07-23  8:11       ` [PATCH v3 2/2] t/helper/test-delta: fix possible resource leak and ensure safe cleanup Eric Sunshine
2025-07-23  8:46         ` Jeff King
2025-07-23 16:37           ` Eric Sunshine
2025-07-23 17:11         ` Junio C Hamano
2025-07-23 16:48       ` Junio C Hamano
2025-07-23 16:44     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2025-07-22 17:48 [PATCH v3 0/2] fix resource leaks in test helpers Hoyoung Lee
2025-07-22 17:50 Hoyoung Lee

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 NNTP newsgroup(s).