[PATCH] D91853: [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions with large stack buffers
Adrian McCarthy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 16:56:04 PST 2020
amccarth added a comment.
I prefer the relatively localized disabling of the warning with the `#pragma`s as you've done as opposed to building the sanitizer builds with different settings.
I'm concerned about what looks to be an existing possible buffer overrun.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp:144
// See http://msdn.microsoft.com/en-us/library/ms680578(VS.85).aspx
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
----------------
1. The sample code used `sizeof(TCHAR)` not `CHAR`. So I'm guessing this is a potential stack buffer overrun bug for "Unicode" builds. (Windows defines `CHAR` to `char` as indicated here: https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types)
2. Does symbolizing happen on multiple threads? If not, the buffer could be static, which would keep the frame size small.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91853/new/
https://reviews.llvm.org/D91853
More information about the llvm-commits
mailing list