Usually when we generated stacktraces the process is in error state, so
running hooks may crash the process and prevent meaningfull error report.
Symbolizer, unwinder and pthread are potential source of mallocs.
Paths
| Differential D123566
[sanitizer] Don't run malloc hooks for stacktraces Changes PlannedPublic Authored by vitalybuka on Apr 11 2022, 8:45 PM.
Details Summary Usually when we generated stacktraces the process is in error state, so Symbolizer, unwinder and pthread are potential source of mallocs.
Diff Detail
Unit TestsFailed Event TimelineThis revision is now accepted and ready to land.Apr 12 2022, 4:36 PM vitalybuka retitled this revision from [sanitizer] Don't run malloc hooks for symbolizer to [sanitizer] Don't run malloc hooks for stacktraces.Apr 13 2022, 12:37 AM vitalybuka added inline comments. kstoimenov added inline comments.
vitalybuka added inline comments.
This revision was landed with ongoing or failed builds.Apr 13 2022, 11:45 AM Closed by commit rG6345d7f2a829: [sanitizer] Don't run malloc hooks for stacktraces (authored by vitalybuka). · Explain Why This revision was automatically updated to reflect the committed changes. vitalybuka marked an inline comment as done. Comment Actions It looks like this is causing a test to fail: This revision is now accepted and ready to land.Apr 13 2022, 1:11 PM vitalybuka added a reverting change: rG5d4df59de103: Revert "[sanitizer] Don't run malloc hooks for stacktraces".Apr 13 2022, 1:13 PM Closed by commit rGd3531fc7f005: [sanitizer] Don't run malloc hooks for stacktraces (authored by vitalybuka). · Explain WhyApr 13 2022, 4:34 PM This revision was automatically updated to reflect the committed changes. This revision is now accepted and ready to land.Apr 13 2022, 11:52 PM vitalybuka added a reverting change: rGc36fbe05a719: Revert "[sanitizer] Don't run malloc hooks for stacktraces".Apr 13 2022, 11:52 PM Comment Actions I probably going to abandon this, as I don't see good solution for all platforms.
Revision Contents
Diff 422751 compiler-rt/lib/msan/msan_allocator.cpp
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_common.cpp
compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp
compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp
compiler-rt/test/sanitizer_common/TestCases/malloc_hook_skip.cpp
|
Maybe this can be a static class member of ScopedDisableMallocHooks? You could add a static ScopedDisableMallocHooks::DisableMallocHooks accessor. Your call.