ErrorGeneric report type has a const char *bug_descr, which describes the type of bug that is detected. Most non-generic bugs (e.g. double-free, null pointer dereference) also already have a short keyword used in printed reports (e.g. "double-free", "null-deref"). This patch moves the bug_descr field to ErrorBase and makes sure it's populated by all constructors.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Isn't this somewhat redundant with the buffer in ScarinessScoreBase?
struct ScarinessScoreBase { ... int score; char descr[1024]; };
I was going to ask the same. And we have more information in the scariness score (e.g: in the param-overlap, and generic errors).
Maybe converting all the scattered bug_descr to use the scariness score would be better?
Isn't this somewhat redundant with the buffer in ScarinessScoreBase?
Maybe converting all the scattered bug_descr to use the scariness score would be better?
Makes sense. Updating the patch to use the description from scariness.
Well, it looks like it's not that redundant. If you look at the logic in ErrorGeneric, you see multiple calls to scariness.Scare, and that's where the complexity arises. I take it back, let's keep this separate.
Well, it looks like it's not that redundant. If you look at the logic in ErrorGeneric, you see multiple calls to scariness.Scare, and that's where the complexity arises. I take it back, let's keep this separate.
ErrorGeneric constructs scariness strings like "8-byte-write-heap-buffer-overflow-far-from-bounds", which is the description of this bug instance, whereas what I'm looking for is a description of a whole class, for the purposes of categorization, e.g. "heap-buffer-overflow", "double-free", "odr-violation" and such. So I slightly agree with you that this is a separate thing from the scariness description, but there's a lot of overlap.
So the previous patch looks good to you?
If ErrorGeneric is the only special one, why not use the scariness in general, but make that one a special case?
It's already special, so it's not really a big change.