Skip to content

talloc and memory leak debugging

Sascha Hauer barebox 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected] change-id 20251107-talloc-68c86806dc53

Versions newest first

  1. v2 Latest4 patches 1 replyApplied

Changes in v2 from the cover letter

- pass originally allocated pointer to malloc_usable_size()
- align talloc allocations to 8 bytes
- Use __lsan_do_recoverable_leak_check() instead of __lsan_do_leak_check() to keep barebox running after memory leaks have been detected

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4lib: add talloc for overlaying a tree onto allocationsinclude/talloc.h include/xfuncs.h lib/Makefile +2 more+485 -00 replies
2/4test: self: add talloc selftesttest/self/Kconfig test/self/Makefile test/self/talloc.c+160 -00 replies
3/4hush: fix memory leakscommon/hush.c+25 -160 replies
4/4sandbox: add memory leak debugging tooling around LeakSanitizerarch/sandbox/Makefile arch/sandbox/os/libc_malloc.c commands/Kconfig +4 more+84 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] talloc and memory leak debugging

This picks up the talloc series previously sent by Ahmad. I also added the memory leak debugging patch tooling for sandbox.

This series includes my review comments to v1.

Changes since v1:
- pass originally allocated pointer to malloc_usable_size()
- align talloc allocations to 8 bytes
- Use __lsan_do_recoverable_leak_check() instead of __lsan_do_leak_check() to keep barebox running after memory leaks have been detected

---
Ahmad Fatoum (4):
lib: add talloc for overlaying a tree onto allocations
test: self: add talloc selftest
hush: fix memory leaks
sandbox: add memory leak debugging tooling around LeakSanitizer

 arch/sandbox/Makefile         |   2 +-
 arch/sandbox/os/libc_malloc.c |   9 +
 commands/Kconfig              |   9 +
 commands/Makefile             |   1 +
 commands/checkleak.c          |  52 ++++++
 common/Kconfig.debug          |   6 +
 common/hush.c                 |  41 +++--
 include/malloc.h              |   6 +
 include/talloc.h              |  43 +++++
 include/xfuncs.h              |   6 +
 lib/Makefile                  |   1 +
 lib/talloc.c                  | 415 ++++++++++++++++++++++++++++++++++++++++++
 lib/xfuncs.c                  |  20 ++
 test/self/Kconfig             |   6 +
 test/self/Makefile            |   1 +
 test/self/talloc.c            | 153 ++++++++++++++++
 16 files changed, 754 insertions(+), 17 deletions(-)

---
base-commit: 594850b2de53300ae25c103e4ec88b2dac418106
change-id: 20251107-talloc-68c86806dc53

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>