llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.52k stars 11.79k forks source link

Bugs detected by PVS-Studio (LLVM 13.0.0) #51462

Open llvmbot opened 3 years ago

llvmbot commented 3 years ago
Bugzilla Link 52120
Version trunk
OS Windows NT
Depends On llvm/llvm-project#44113
Blocks llvm/llvm-project#30344
Reporter LLVM Bugzilla Contributor
CC @lattner,@davidbolvansky,@dushistov,@RKSimon,@xgupta,@tlattner,@tstellar

Extended Description

PVS-Studio Team: Detecting errors in the LLVM release 13.0.0 - https://pvs-studio.com/en/blog/posts/cpp/0871/

lattner commented 3 years ago

Cool, I'd bring this up for discusssion on llvm-dev or the infra working group.

davidbolvansky commented 3 years ago

Yeah, I meant “web report” :)

RKSimon commented 3 years ago

Could LLVM board request PVS license (for open source even free?) to periodically check for errors so community can help with fixes (ideally before release to avoid public "shame" like now that just recently released LLVM has some trivial bugs)

PVS have spoken about free licenses for open source projects, I don't know how this translates to licenses for specific people though - especially as many of us work on llvm as part of our paid work.

It'd be great if we could have a CI bot that maintains a web report somewhere, but then again we already have scan-build and coverity reports doing something similar and not many of us show an interest in those :-(

davidbolvansky commented 3 years ago

Yeah, right.

I think that we could enhance clang to detect:


Could LLVM board request PVS license (for open source even free?) to periodically check for errors so community can help with fixes (ideally before release to avoid public "shame" like now that just recently released LLVM has some trivial bugs)

RKSimon commented 3 years ago

rG943b3048484b fixes:

Bug N1, trying to create a 64-bit value from two 32-bit values Bug N2, hasty copy-paste Bug N3, no one knows how to write comparison functions Bug N5, table-style formatting is not always helpful Bug N13-N14, uninitialized variable

@​xbolva00 is that correct?

RKSimon commented 3 years ago

rG3649fb14d126 fixes:

Code smell N1, duplicate lines Code smell N3, the misplaced bracket Code smell N4-N6, an unsuccessful code merge? Bug N11, a dangerous index Bug N12, array initialization error Bug N13-N14, uninitialized variable

@​xbolva00 is that correct?

RKSimon commented 3 years ago

We had tried to fix this issue but RISCV backend ended up broken. Where? any patch on phab?

[Bug #​44768] discusses this as well

davidbolvansky commented 3 years ago

https://reviews.llvm.org/D69741

xgupta commented 3 years ago

We had tried to fix this issue but RISCV backend ended up broken. Where? any patch on phab?

davidbolvansky commented 3 years ago

“if (any_of(S, isIntegerOrPtr) && any_of(S, isIntegerOrPtr))”

We had tried to fix this issue but RISCV backend ended up broken. It is kinda sad that this bug is still there. Maybe riscv needs to be switched to experimental target again to get some attention …