git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/7] Fix some sequencer leaks

From
Christian Couder <chriscool@tuxfamily.org>
Date
May 21, 2012, 14:56 UTC
Message-ID
<20120521143309.1911.94302.chriscool@tuxfamily.org>

Here is another iteration of a series to fix some leaks in the cherry-pick, revert and sequencer code.

The previous iteration only had patch 1 and 2. They haven't changed. I just added the last 5 patches.

Maybe the last 2 patches are a bit overkill. But with this series, the valgrind output with --leak-check=full is much cleaner.

There most important leaks are still there though. One of them is related to ce_entries, like this:

==2015== 522 bytes in 6 blocks are definitely lost in loss record 51 of 54 ==2015== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2015== by 0x53113B: xcalloc (wrapper.c:119) ==2015== by 0x52BBE9: create_ce_entry (unpack-trees.c:559) ==2015== by 0x52BDC6: unpack_nondirectories (unpack-trees.c:609) ==2015== by 0x52C45B: unpack_callback (unpack-trees.c:799) ==2015== by 0x529B9B: traverse_trees (tree-walk.c:407) ==2015== by 0x52CE53: unpack_trees (unpack-trees.c:1091) ==2015== by 0x4D1B89: git_merge_trees (merge-recursive.c:241) ==2015== by 0x4D673A: merge_trees (merge-recursive.c:1819) ==2015== by 0x509521: do_recursive_merge (sequencer.c:225) ==2015== by 0x509F5B: do_pick_commit (sequencer.c:457) ==2015== by 0x50B3B4: pick_commits (sequencer.c:878)

The other one is related to the index:

==2015== 574 (400 direct, 174 indirect) bytes in 2 blocks are definitely lost in loss record 52 of 54 ==2015== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2015== by 0x53113B: xcalloc (wrapper.c:119) ==2015== by 0x4EF8CF: read_index_from (read-cache.c:1441) ==2015== by 0x4EF316: read_index (read-cache.c:1282) ==2015== by 0x50940B: do_recursive_merge (sequencer.c:211) ==2015== by 0x509F5B: do_pick_commit (sequencer.c:457) ==2015== by 0x50B3B4: pick_commits (sequencer.c:878) ==2015== by 0x50B7C6: sequencer_pick_revisions (sequencer.c:994) ==2015== by 0x47A6D5: cmd_cherry_pick (revert.c:237) ==2015== by 0x404FEE: run_builtin (git.c:308) ==2015== by 0x405181: handle_internal_command (git.c:468) ==2015== by 0x40529B: run_argv (git.c:514)

Christian Couder (7):
  sequencer: fix leaked todo_list memory
  sequencer: release a strbuf used in save_head()
  merge-recursive: free some string lists
  revert: free opts.revs to do a bit of cleanup
  revert: free revs->cmdline.rev
  unpack-trees: record which unpack error messages should be freed
  Properly free unpack trees error messages
 builtin/checkout.c |  1 +
 builtin/merge.c    |  6 ++++--
 builtin/revert.c   |  6 ++++++
 merge-recursive.c  |  5 ++++-
 sequencer.c        | 16 +++++++++++++---
 unpack-trees.c     | 50 +++++++++++++++++++++++++++++++++++---------------
 unpack-trees.h     |  3 +++
 7 files changed, 66 insertions(+), 21 deletions(-)
-- 
1.7.10.2.555.g6528037
Next: Christian Couder
Message 1 of 23 in “Fix some sequencer leaks”
  1. 0/7 Fix some sequencer leaksChristian Couder, May 21, 2012
  2. 1/7 sequencer: fix leaked todo_list memoryChristian Couder, May 21, 2012
  3. Jonathan NiederMay 21, 2012
  4. Christian CouderMay 22, 2012
  5. 2/7 sequencer: release a strbuf used in save_head()Christian Couder, May 21, 2012
  6. Ramkumar RamachandraMay 22, 2012
  7. Jonathan NiederMay 22, 2012
  8. Ramkumar RamachandraMay 22, 2012
  9. Jonathan NiederMay 22, 2012
  10. Jonathan NiederMay 22, 2012
  11. Christian CouderMay 22, 2012
  12. 3/7 merge-recursive: free some string listsChristian Couder, May 21, 2012
  13. 4/7 revert: free opts.revs to do a bit of cleanupChristian Couder, May 21, 2012
  14. Ramkumar RamachandraMay 22, 2012
  15. Christian CouderMay 22, 2012
  16. 5/7 revert: free revs->cmdline.revChristian Couder, May 21, 2012
  17. Jonathan NiederMay 21, 2012
  18. Christian CouderMay 22, 2012
  19. Jonathan NiederMay 22, 2012
  20. 6/7 unpack-trees: record which unpack error messages should be freedChristian Couder, May 21, 2012
  21. Jonathan NiederMay 21, 2012
  22. Christian CouderMay 22, 2012
  23. 7/7 Properly free unpack trees error messagesChristian Couder, May 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.