[llvm-bugs] [Bug 49642] New: RangeConstraintManager areFeasible(Constraints) false, assertion failure

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 19 05:41:00 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49642

            Bug ID: 49642
           Summary: RangeConstraintManager areFeasible(Constraints) false,
                    assertion failure
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: balazs.benics at sigmatechnology.se
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

There was a similar bug https://bugs.llvm.org/show_bug.cgi?id=49490, which was
fixed by D98341.
Fortunately, that introduced an assertion, which was triggered by the following
code.
Maybe the related revision did not fix the root cause of this bug?

test.c:
```lang=c
typedef ssize_t;
b;

unsigned c;
int write(int, const void *, unsigned long);

a() {
  d();
  while (c > 0) {
    b = write(0, d, c);
    if (b)
      c -= b;
    b < 1;
  }
  if (c && c) {
    //     ^ crash
  }
}
```

clang --analyze -Xclang -analyzer-checker=core test.c

The bug originally was found by analyzing the Twin project and reduced using
reduce.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210319/c10f4c9b/attachment.html>


More information about the llvm-bugs mailing list