In this paper, we propose a debugging technique for C, which can dynamically find boundary errors on strings in a highly-compatible, accurate and efficient manner. The main idea of our technique is to effectively keep track of hazardous memory bounds (called trap regions) using a small table (called a trap cache) on the static section of the instrumented program. We have implemented our technique as an extension of GCC4.1.1 and conducted experiments. The results show that our technique was easily applicable even to large real programs including Apache 1.3.37 and Linux 2.6.20.4 without requiring significant manual effort, it successfully detected all of ten known boundary errors in them with no false positives, and it incurred low run-time overheads (average 17%) for their benchmarks.
['Yoshitaka Arahori', 'Katsuhiko Gondow', 'Hideo Maejima']
TCBC: Trap Caching Bounds Checking for C