Skip to content

fix memory leaks; add memory sanitizer#479

Merged
idkakorin merged 2 commits intoGENIE-MC:masterfrom
idkakorin:master
Mar 24, 2026
Merged

fix memory leaks; add memory sanitizer#479
idkakorin merged 2 commits intoGENIE-MC:masterfrom
idkakorin:master

Conversation

@idkakorin
Copy link
Copy Markdown
Contributor

Summary

This PR adds support for AddressSanitizer (ASan) in the GENIE build system and fixes several memory-related issues uncovered during testing.

Changes

  • Added a new --enable-asan configure option
  • Propagated sanitizer flags (-fsanitize=address -fno-omit-frame-pointer) to both compilation and linking stages
  • Updated multiple Makefile targets to ensure sanitizer flags are consistently applied when building shared libraries
  • Fixed several memory issues (including leaks) identified with ASan, including leaks in TuneId

Notes

  • ASan support is intended for debugging and development builds
  • Leak detection may be noisy due to external dependencies (e.g. ROOT), so it can be optionally disabled via ASAN_OPTIONS=detect_leaks=0
  • No impact on default builds unless explicitly enabled

Motivation

The changes improve debugging capabilities and help identify memory safety issues (e.g. use-after-free, leaks) that are otherwise difficult to trace with standard tools. In particular, enabling ASan allowed detection of memory leaks in TuneId.

@idkakorin idkakorin requested a review from nusense March 20, 2026 22:34
Comment thread src/Framework/Utils/TuneId.cxx
Comment thread src/make/Make.include
@idkakorin idkakorin merged commit 1f32bfc into GENIE-MC:master Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants