[PATCH] [Sanitizer] Plug a leak in POSIXSymbolizer::FindModuleForAddresss happening after module load/unload
Timur Iskhodzhanov
timurrrr at google.com
Wed Mar 25 13:43:21 PDT 2015
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:355
@@ -354,3 +354,3 @@
explicit POSIXSymbolizer(IntrusiveList<SymbolizerTool> tools)
- : Symbolizer(tools) {}
+ : Symbolizer(tools), n_modules_(0), modules_fresh_(false) {}
----------------
This change is not required *right now* as POSIXSymbolizer is placement new'd on a mmap'ed memory block, but let's set the default values explicitly just in case.
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:372
@@ -371,3 @@
- if (modules_ == 0 || !modules_fresh_) {
- modules_ = (LoadedModule*)(symbolizer_allocator_.Allocate(
- kMaxNumberOfModuleContexts * sizeof(LoadedModule)));
----------------
Please note this code assumed LoadedModule is trivially default constructable, which wasn't the case strictly speaking as the implicit default constructor was not available.
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:411
@@ -410,3 +409,3 @@
static const uptr kMaxNumberOfModuleContexts = 1 << 14;
- LoadedModule *modules_; // Array of module descriptions is leaked.
uptr n_modules_;
----------------
The comment was well said :)
http://reviews.llvm.org/D8618
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list