[PATCH] D44285: Fix computeSymbolSizes SEGFAULT on invalid file
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 28 17:25:41 PDT 2018
aprantl added inline comments.
================
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:
> > 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.
> It should just output the normal unknown result
> ```
> ??
> ??:0:0
> ```
> Do you feel it's worth checking?
Yes, please do check for the result. Thanks!
https://reviews.llvm.org/D44285
More information about the llvm-commits
mailing list