[PATCH] D91670: Fix crash after looking up dwo_id=0 in CU index.

Jorge Gorbe Moya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 18:08:02 PST 2020


jgorbe marked 2 inline comments as done.
jgorbe added a comment.

Thanks for the comments!



================
Comment at: llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s:5
+# RUN: llvm-mc --filetype=obj --triple x86_64-pc-linux %s -o %t.dwp --defsym DWP=0
+# RUN: llvm-symbolizer --obj=%t --dwp=%t.dwp 0x0 | FileCheck %s
+# CHECK-NOT: Stack dump
----------------
jgorbe wrote:
> MaskRay wrote:
> > dblaikie wrote:
> > > Checking for "anything other than crashing" is a bit loose - could you check for the specific failure you expect when the dwo_id 0 can't be found? (I guess the symbolizer won't include some details in the symbolized stack trace, for instance)
> > If llvm-symbolizer segfaults, I think it is not guaranteed that "Stack dump" will be printed.
> > Since a segfaulting process has a non-zero exit code, simply writing `RUN: llvm-symbolizer --obj=%t --dwp=%t.dwp 0x0` performs the check.
> > 
> > This is probably sufficient for a regression test. However, if you have other interesting output to check, consider adding them to make the test better.
> The output is extremely uninteresting, but done.
Changed to expect the output of the fixed symbolizer as suggested by the other comment. I'm not sure what option is better, this test case is basically a regression test.


================
Comment at: llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s:5-6
+# RUN: llvm-mc --filetype=obj --triple x86_64-pc-linux %s -o %t.dwp --defsym DWP=0
+# RUN: llvm-symbolizer --obj=%t --dwp=%t.dwp 0x0 | FileCheck %s
+# CHECK-NOT: Stack dump
+
----------------
MaskRay wrote:
> dblaikie wrote:
> > Checking for "anything other than crashing" is a bit loose - could you check for the specific failure you expect when the dwo_id 0 can't be found? (I guess the symbolizer won't include some details in the symbolized stack trace, for instance)
> If llvm-symbolizer segfaults, I think it is not guaranteed that "Stack dump" will be printed.
> Since a segfaulting process has a non-zero exit code, simply writing `RUN: llvm-symbolizer --obj=%t --dwp=%t.dwp 0x0` performs the check.
> 
> This is probably sufficient for a regression test. However, if you have other interesting output to check, consider adding them to make the test better.
The output is extremely uninteresting, but done.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91670/new/

https://reviews.llvm.org/D91670



More information about the llvm-commits mailing list