skip to main content
OSTI.GOV title logo U.S. Department of Energy
Office of Scientific and Technical Information

Title: Lightweight runtime checking of C programs with RTC

Abstract

The C Programming Language is known for being an efficient language that can be compiled on almost any architecture and operating system. However the absence of dynamic safety checks and a relatively weak type system allows programmer oversights that are hard to spot. In this paper, we present RTC, a runtime monitoring tool that instruments unsafe code and monitors the program execution. RTC is built on top of the ROSE compiler infrastructure. RTC finds memory bugs and arithmetic overflows and underflows, and run-time type violations. Most of the instrumentations are directly added to the source file and only require a minimal runtime system. As a result, the instrumented code remains portable. In tests against known error detection benchmarks, RTC found 98% of all memory related bugs and had zero false positives. Finally, in performance tests conducted with well known algorithms, such as binary search and MD5, we determined that our tool has an average run-time overhead rate of 9.7× and memory overhead rate of 3.5×.

Authors:
 [1];  [2]; ORCiD logo [3];  [4];  [1]
  1. Univ. of Alabama at Birmingham, Birmingham, AL (United States)
  2. Matlab (United States)
  3. North Carolina State Univ., Raleigh, NC (United States)
  4. Lawrence Livermore National Lab. (LLNL), Livermore, CA (United States)
Publication Date:
Research Org.:
Lawrence Livermore National Laboratory (LLNL), Livermore, CA (United States)
Sponsoring Org.:
USDOE National Nuclear Security Administration (NNSA)
OSTI Identifier:
1477830
Report Number(s):
LLNL-JRNL-748157
Journal ID: ISSN 1477-8424; 933309
Grant/Contract Number:  
AC52-07NA27344
Resource Type:
Journal Article: Accepted Manuscript
Journal Name:
Computer Languages, Systems & Structures
Additional Journal Information:
Journal Volume: 45; Journal Issue: C; Journal ID: ISSN 1477-8424
Publisher:
Elsevier
Country of Publication:
United States
Language:
English
Subject:
97 MATHEMATICS AND COMPUTING; Runtime monitoring; Source code instrumentation; Static analysis; C; C++

Citation Formats

Milewicz, Reed, Vanka, Rajesh, Tuck, James, Quinlan, Daniel, and Pirkelbauer, Peter. Lightweight runtime checking of C programs with RTC. United States: N. p., 2016. Web. doi:10.1016/j.cl.2016.01.001.
Milewicz, Reed, Vanka, Rajesh, Tuck, James, Quinlan, Daniel, & Pirkelbauer, Peter. Lightweight runtime checking of C programs with RTC. United States. https://doi.org/10.1016/j.cl.2016.01.001
Milewicz, Reed, Vanka, Rajesh, Tuck, James, Quinlan, Daniel, and Pirkelbauer, Peter. 2016. "Lightweight runtime checking of C programs with RTC". United States. https://doi.org/10.1016/j.cl.2016.01.001. https://www.osti.gov/servlets/purl/1477830.
@article{osti_1477830,
title = {Lightweight runtime checking of C programs with RTC},
author = {Milewicz, Reed and Vanka, Rajesh and Tuck, James and Quinlan, Daniel and Pirkelbauer, Peter},
abstractNote = {The C Programming Language is known for being an efficient language that can be compiled on almost any architecture and operating system. However the absence of dynamic safety checks and a relatively weak type system allows programmer oversights that are hard to spot. In this paper, we present RTC, a runtime monitoring tool that instruments unsafe code and monitors the program execution. RTC is built on top of the ROSE compiler infrastructure. RTC finds memory bugs and arithmetic overflows and underflows, and run-time type violations. Most of the instrumentations are directly added to the source file and only require a minimal runtime system. As a result, the instrumented code remains portable. In tests against known error detection benchmarks, RTC found 98% of all memory related bugs and had zero false positives. Finally, in performance tests conducted with well known algorithms, such as binary search and MD5, we determined that our tool has an average run-time overhead rate of 9.7× and memory overhead rate of 3.5×.},
doi = {10.1016/j.cl.2016.01.001},
url = {https://www.osti.gov/biblio/1477830}, journal = {Computer Languages, Systems & Structures},
issn = {1477-8424},
number = C,
volume = 45,
place = {United States},
year = {Fri Jan 15 00:00:00 EST 2016},
month = {Fri Jan 15 00:00:00 EST 2016}
}

Journal Article:
Free Publicly Available Full Text
Publisher's Version of Record

Citation Metrics:
Cited by: 3 works
Citation information provided by
Web of Science

Save / Share:

Works referenced in this record:

Efficient detection of all pointer and array access errors
journal, June 1994


NDSeq
conference, June 2011


Run-Time Type Checking for Binary Programs
book, January 2003

  • Burrows, Michael; Freund, Stephen N.; Wiener, Janet L.
  • Compiler Construction: 12th International Conference, CC 2003, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2003, Warsaw, Poland, April 7-11, 2003, Proceedings
  • https://doi.org/10.1007/3-540-36579-6_7

Flexible Hardware Acceleration for Instruction-Grain Program Monitoring
conference, June 2008


Common specification language for static and dynamic analysis of C programs
conference, March 2013


Hardbound
conference, March 2008

  • Devietti, Joe; Blundell, Colin; Martin, Milo M. K.
  • Proceedings of the 13th international conference on Architectural support for programming languages and operating systems
  • https://doi.org/10.1145/1346281.1346295

Butterfly analysis
conference, March 2010

  • Goodstein, Michelle L.; Vlachos, Evangelos; Chen, Shimin
  • Proceedings of the fifteenth International Conference on Architectural support for programming languages and operating systems
  • https://doi.org/10.1145/1736020.1736050

On the probability distribution of faults in complex software systems
journal, February 2015


Memory-safe Execution of C on a Java VM
conference, July 2015


Fast as a shadow, expressive as a tree
conference, April 2015


Runtime Verification with Particle Filtering
book, January 2013


An Optimized Memory Monitoring for Runtime Assertion Checking of C Programs
book, January 2013


Predator
conference, February 2014


The Importance of Run-Time Error Detection
book, January 2010


Accelerating Data Race Detection Utilizing On-Chip Data-Parallel Cores
book, January 2013


SigRace
conference, June 2009


WatchdogLite
conference, February 2014


SoftBound
conference, June 2009

  • Nagarakatte, Santosh; Zhao, Jianzhou; Martin, Milo M. K.
  • Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation
  • https://doi.org/10.1145/1542476.1542504

CCured: type-safe retrofitting of legacy software
journal, May 2005


How to shadow every byte of memory used by a program
conference, June 2007


Valgrind: a framework for heavyweight dynamic binary instrumentation
journal, June 2007


CDSchecker
journal, October 2013


Array bounds check elimination in the context of deoptimization
journal, March 2009


An efficient and backwards-compatible transformation to ensure memory safety of C programs
journal, October 2004


Finding and understanding bugs in C compilers
conference, January 2011


ConSeq
conference, March 2011

  • Zhang, Wei; Lim, Junghee; Olichandran, Ramya
  • Proceedings of the sixteenth international conference on Architectural support for programming languages and operating systems
  • https://doi.org/10.1145/1950365.1950395

Works referencing / citing this record:

A Taxonomy for Classifying Runtime Verification Tools
book, January 2018