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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 17:56:18 PST 2020


MaskRay added inline 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
----------------
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.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91670



More information about the llvm-commits mailing list