[PATCH] D144565: dwp check overflow

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 11:06:35 PST 2023


ayermolo added a comment.

You might want to rebase this on trunk LLVM. Seems like you are pushing changes from an old version.



================
Comment at: llvm/test/tools/llvm-dwp/X86/overflow-warning.test:4
+RUN: llvm-dwp -e hello.o -e main.o -warn-overflow -o overflow.dwp 2>&1 | FileCheck %s
+CHECK: warning: Section size overflow in debug_info.dwo
----------------
zhuna8616 wrote:
> ayermolo wrote:
> > Can you check that overflow behavior is preserved?
> Do I check it as in https://reviews.llvm.org/D137882 ? I may have to copy much of the code if I am to check overflow behavior as in this post.
> 
> I found a invalid_cu_index.test that goes like:
> ```
> RUN: not llvm-dwp %p/../Inputs/invalid_cu_index/x.dwp -o %t 2>&1 | FileCheck %s
> CHECK: error: failed to parse cu_index
> ```
> 
> Looks like it's parsing cu index with llvm-dwp directly. I added a similar check and it passed.
> ```
> RUN: llvm-dwp overflow.dwp -o overflow-warned.dwp
> ```
> Is this line of code sufficient for verifying overflow behavior? Or should I follow this post https://reviews.llvm.org/D137882 instead?
Sorry should have been more clear. With option that turns it in to a warning can you check that for sections that overflow have correct reconstructed offset:


```
# RUN: llvm-dwarfdump --manaully-generate-unit-index --debug-cu-index %t.dwp | FileCheck %s
```

The test in that diff uses zero
At least locally. The test in comments uses: .zero   0xfffffff0 - 0x2b       # 0xfffffff0 is mimimum reserved length
Which actually creates a 4GB file on disk. Don't think we want that in build bots.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144565



More information about the llvm-commits mailing list