llvm-project/llvm/test/tools
Adrian Prantl bbe980dfe1 Fix computeSymbolSizes SEGFAULT on invalid file
We use llvm-symbolizer in some production systems, and we run it
against all possibly related files, including some that are not
ELF. We noticed that for some of those invalid files, llvm-symbolizer
would crash with SEGFAULT. Here is an example of such a file.

It is due to that in computeSymbolSizes, a loop uses condition

  for (unsigned I = 0, N = Addresses.size() - 1; I < N; ++I) {

where if Addresses.size() is 0, N would overflow and causing the loop
to access invalid memory.

Instead of patching the loop conditions, the commit makes so that the
function returns early if Addresses is empty.

Validated by checking that llvm-symbolizer no longer crashes.

Patch by Teng Qin!

Differential Revision: https://reviews.llvm.org/D44285

llvm-svn: 330610
2018-04-23 16:08:01 +00:00
..
dsymutil [dsymutil] Don't try to load Swift ASTs as objects. 2018-04-09 09:09:59 +00:00
gold Require asserts for stats-file-option tests. 2018-04-20 11:21:13 +00:00
llvm-ar [llvm-ar] Temporarily make the tool case detection test Windows-only to fix the build (introduced in r329658) 2018-04-10 10:26:23 +00:00
llvm-cfi-verify/X86 [cfi-verify] Add blame context printing, and improved print format. 2018-02-01 23:45:18 +00:00
llvm-config llvm-config: Add advapi32 to --system-libs on Windows (PR36372) 2018-02-23 12:20:26 +00:00
llvm-cov [llvm-cov] Implement -ignore-filename-regex= option for excluding source files. 2018-04-09 15:20:35 +00:00
llvm-cvtres [llvm-cvtres] Update the help test after SVN r326244. 2018-02-27 21:11:03 +00:00
llvm-cxxdump
llvm-cxxfilt Add test for demangling GNU ABI tags. 2018-03-22 22:04:32 +00:00
llvm-diff Let llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr 2018-04-12 21:28:04 +00:00
llvm-dlltool [COFF] Ignore semicolons in module definition identifiers 2017-12-06 19:18:24 +00:00
llvm-dwarfdump [test] Avoid spurious failure in debug-names-find.s. NFC. 2018-04-16 11:16:41 +00:00
llvm-dwp llvm-dwarfdump: automatically dump both regular and .dwo variant of sections 2017-09-13 22:09:01 +00:00
llvm-extract BlockExtractor: Don’t delete functions directly 2018-03-12 22:28:18 +00:00
llvm-isel-fuzzer Revert r326710 "Fuzzer: remove temporary files after we're done with them." 2018-03-12 13:22:12 +00:00
llvm-lib [test] Move llvm-lib tests into tools/llvm-lib. NFC. 2017-11-02 20:05:20 +00:00
llvm-lit
llvm-lto [ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed backends 2018-02-07 04:05:59 +00:00
llvm-lto2 Fix test by allowing it to accept an upper or lower case letter as the first character. 2018-04-20 15:23:57 +00:00
llvm-mc
llvm-mca [llvm-mca][X86] Add BMI/LZCNT/POPCNT resource tests to all relevant models 2018-04-22 20:42:24 +00:00
llvm-modextract
llvm-mt Change "UNSUPPORTED: windows" to be "UNSUPPORTED: system-windows" so that test is actually skipped on Windows. 2018-02-08 18:45:16 +00:00
llvm-nm For llvm-nm and Mach-O files that are fully stripped, special case a redacted LC_MAIN 2018-03-29 20:04:29 +00:00
llvm-objcopy [llvm-objcopy] Fix sh_link 2018-04-20 20:46:04 +00:00
llvm-objdump [llvm-objdump] Remove test object file 2018-04-19 17:05:03 +00:00
llvm-opt-fuzzer Revert r326710 "Fuzzer: remove temporary files after we're done with them." 2018-03-12 13:22:12 +00:00
llvm-opt-report
llvm-pdbdump [pdbutil] Print the checksum hex string when using the '-lines' option 2018-04-10 14:47:12 +00:00
llvm-profdata Revert "Revert "[lit] Generalized /dev/null support on Windows."" 2018-03-27 01:39:17 +00:00
llvm-rc Really fix llvm-rc include-paths.test 2017-10-11 21:27:54 +00:00
llvm-readobj Add PPC64_GLINK dynamic tag. 2018-04-13 16:42:48 +00:00
llvm-size
llvm-split Make GlobalValues with non-default visibilility dso_local. 2018-01-18 02:08:23 +00:00
llvm-strings [llvm-strings] Add support for the -a/--all options 2017-11-14 19:58:36 +00:00
llvm-symbolizer Fix computeSymbolSizes SEGFAULT on invalid file 2018-04-23 16:08:01 +00:00
llvm-xray/X86 [NFC] fix trivial typos in comments 2018-02-22 07:48:29 +00:00
lto Add REQUIRES: arm-registered-target to test using an arm-apple-ios triple. 2018-03-11 03:17:34 +00:00
obj2yaml [obj2yaml] Don't crash for input files without symbol table 2017-09-22 09:30:40 +00:00
opt-viewer [opt-viewer] Set title for the source pages 2018-02-26 21:15:50 +00:00
sancov
sanstats [sanstats] Remove a flaky test. 2017-07-13 01:36:12 +00:00
yaml2obj Add ELF dynamic symbol support to yaml2obj/obj2yaml 2017-11-16 18:10:15 +00:00