[PATCH] D44285: Fix computeSymbolSizes SEGFAULT on invalid file

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 16:05:59 PDT 2018


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: test/tools/llvm-symbolizer/sym.test:24
+RUN: echo "0x1" > %t.input
+RUN: llvm-symbolizer -obj=%t.zero_file < %t.input
 
----------------
palmtenor wrote:
> 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...
My point was that a test that just checks the exit status without checking any output even works when the program doesn't do anything at all, so if there is any output you can check from llvm-symbolizer, that would be much better!
If it doesn't generate any output, you can use FileCheck --allow-empty.


https://reviews.llvm.org/D44285





More information about the llvm-commits mailing list