The return of the Stanford Checker
[Posted June 11, 2002 by corbet]
We first looked at the "Stanford Checker"
back in March, 2001. The Checker
is a system built on top of gcc which analyzes large amounts of source code
and looks for obscure errors. In the past, it has been responsible for
many kernel bug fixes. The Checker team has been quiet for a while; now,
perhaps with the end of the academic year, the group has returned with a
new set of error reports.
So what has the checker group found this time?
- Missing unlocks. Here, the Checker
looked for situations where kernel code could either take out a lock
or disable interrupts, then fail to undo the action before returning.
18 possible errors were found.
- Memory leaks. The Checker looked for
failure paths which failed to return allocated memory. "while
we only include 24 errors, there were lots in general."
- Failure to check return codes. Numerous
places were found where kernel code does not look at the return status
from a function which can fail.
- Missing null pointer checks (54
errors). Most of the errors seem to be with calls to
kmalloc.
- Large stack variables (37). Allocating
a variable of size greater than 1KB may not be, strictly, an error,
but it can lead to problems quickly when the stack runs out of space.
The Checker code itself remains unreleased, unfortunately. The Checker
group does the kernel a great service by performing this testing and
passing on the problems for fixing. But there are no end of other
development projects out there that could benefit from this code. One can
only hope that, someday, the Checker code will be more widely available.
(
Log in to post comments)