Heapster: Warn about common forms of permission mistakes #1787
Labels
subsystem: heapster
Issues specifically related to memory verification using Heapster
type: enhancement
Issues describing an improvement to an existing feature or capability
usability
An issue that impedes efficient understanding and use
It is quite easy to accidentally write a Heapster permission type that is syntactically correct but otherwise nonsensical due to programmer mistakes. Here are a couple of common mistakes of this form:
Array permissions with incorrectly sized field shapes
I recently made a mistake when writing a permission of this form:
Can you spot the mistake? Although I indicated that the length is
8
and the stride is8
, I gave it a field shape with 8 bytes. This is wrong as 8 cells * 8 stride yields 64 bytes, so the field shape should actually befieldsh(64,true)
.In cases where the number of cells, stride length, and field shape size are statically known, we should warn whenever the field shape is not large enough to accommodate the size of the array implied by the number of cells and stride length. If Heapster had done this, I would have figured out my mistake sooner.
Disjoint permissions that aren't actually disjoint
I also recently made a mistake when writing a
*
permission like so:These permissions are not actually disjoint, as the second array permission's offset (at 8 bytes) overlaps with the first permission, which occupies 64 bytes. I probably meant to give the second permission offset 64 instead. Again, we should warn about these sorts of situations whenever statically possible.
The text was updated successfully, but these errors were encountered: