[PATCH] D87792: [sanitizer] Add facility to print the full StackDepot

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 08:03:01 PDT 2020


tejohnson added a comment.

I realized I had to make a change, PTAL.



================
Comment at: compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp:84
+                    "sanitizer_common.stackdepotprint.tmp.");
+  fd_t fd = mkstemp(tmpfile);
+  __sanitizer_set_report_fd(reinterpret_cast<void *>(fd));
----------------
I realized last night that this isn't going to work on all platforms. The sanitizer_libc_test already had some handling for getting temp files, and for unlinking them, on various platforms. So I copied that handling here and structured the file handling similarly.

Note I tried moving it into sanitizer_test_utils.h and using it from there, but that caused some include file conflicts in an asan test that included sanitizer_test_utils.h and therefore ended up including both include/sanitizer/common_interface_defs.h and lib/sanitizer_common/sanitizer_interface_internal.h (the latter through the include files I had to add to sanitizer_test_utils.h to move this code there).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87792/new/

https://reviews.llvm.org/D87792



More information about the llvm-commits mailing list