[PATCH] D44285: Fix computeSymbolSizes SEGFAULT on invalid file

Teng Qin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 14:15:14 PDT 2018


palmtenor added inline comments.


================
Comment at: test/tools/llvm-symbolizer/sym.test:22
 RUN: llvm-symbolizer -inlining -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck --check-prefix="PRETTY" %s 
+RUN: dd if=/dev/zero of=%t.zero_file bs=1024 count=1
+RUN: echo "0x1" > %t.input
----------------
aprantl wrote:
> This will not work on all operating systems. Since the file is only 1K in size, would you mind just checking in the binary?
I can do that. How can I submit a binary file on Phabricator?


================
Comment at: test/tools/llvm-symbolizer/sym.test:24
+RUN: echo "0x1" > %t.input
+RUN: llvm-symbolizer -obj=%t.zero_file < %t.input
 
----------------
aprantl wrote:
> This will also succeed if llvm-symbolizer is symlinked to /bin/true. Is there some way you could check the output?
> if llvm-symbolizer is symlinked to /bin/true

It actually seem to work:
```
$ /bin/true -obj ~/test-bad-file  < test_input
$ echo $?
0
```
Just want to check the tool doesn't crash here...


Repository:
  rL LLVM

https://reviews.llvm.org/D44285





More information about the llvm-commits mailing list