|
ABSTRACT
The effectiveness of traditional type checking in C is limited by the presence of type conversions using type casts. Because the C standard allows arbitrary type conversions between pointer types, neither C compilers, nor tools such as lint, can guarantee type safety in the presence of such type conversions. In particular, by using casts involving pointers to structures (C structs), a programmer can interpret any memory region to be of any desired type, further compromising C's weak type system. Not only do type casts make a program vulnerable to type errors, they hinder program comprehension and maintenance by creating latent dependencies between seemingly independent pieces of code.To address these problems, we have developed a stronger form of type checking for C programs, called physical type checking. Physical type checking takes into account the layout of C struct fields in memory. This paper describes an inference-based physical type checking algorithm. Our algorithm can be used to perform static safety checks, as well as compute useful information for software engineering applications.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
} L. 0. Andersen. Program Analysis and Specialization for the C Pmgmmming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
|
| |
2
|
|
| |
3
|
Satish Chandra and Thomas Reps. Physical type checking for C. Technical Report BL0113590-990302-04, Lucent Technologies, Bell Laboiatories, March 1999. Available at http://vuv.bell-labs.com/'schandra/pubs/checking-tr.ps.
|
 |
4
|
|
| |
5
|
|
| |
6
|
|
| |
7
|
F.-J. Grosch and G. Snelting. Polymorphic components for monomorphic languages. In R. Prieto-Diaz and W.B. Frakes, editors, Advances in Software Reuse: Selected Papers from the Second International Workshop on Software Reusability, pages 47-55, Lucca, Italy, March 1993. IEEE Computer Society Press.
|
| |
8
|
J. Hughes. Backwards analysis of functional programs. Partial Evaluation and Mixed Computation: Proc. of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avemaes, Denmark, Oct. 18-24, lg87), pages 187-208, 1988.
|
| |
9
|
S. C. Johnson. Lint, a C program checker, July 1978.
|
| |
10
|
|
| |
11
|
Robert O'Callahan and Daniel Jackson. Detecting shared representations using type inference. Technical Report CMU-CS-95-202, Carnegie Mellon University, September 1995.
|
 |
12
|
G. Ramalingam , John Field , Frank Tip, Aggregate structure identification and its application to program analysis, Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.119-132, January 20-22, 1999, San Antonio, Texas, United States
[doi> 10.1145/292540.292553]
|
| |
13
|
|
 |
14
|
|
| |
15
|
M. Siff, S. Chandra, T. Ball, K. Kunchithapadam, and T. Reps. Coping with type casts in C. - Tech: nical Renort BL0113590-990202-03. Lucent Technologies, Beli Laboratories, February i999. Available at http://ww.bell-labs.com/-schandra/pubs/coping-tr.ps.
|
 |
16
|
|
 |
17
|
|
 |
18
|
Suan Hsi Yong , Susan Horwitz , Thomas Reps, Pointer analysis for programs with structures and casting, Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementation, p.91-103, May 01-04, 1999, Atlanta, Georgia, United States
|
 |
19
|
Sean Zhang , Barbara G. Ryder , William Landi, Program decomposition for pointer aliasing: a step toward practical analyses, Proceedings of the 4th ACM SIGSOFT symposium on Foundations of software engineering, p.81-92, October 16-18, 1996, San Francisco, California, United States
|
| |
20
|
|
| |
21
|
|
| |
22
|
|
CITED BY 18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Umesh Shankar , Kunal Talwar , Jeffrey S. Foster , David Wagner, Detecting format string vulnerabilities with type qaualifiers, Proceedings of the 10th conference on USENIX Security Symposium, p.16-16, August 13-17, 2001, Washington, D.C.
|
|
|
|
|
|
Umesh Shankar , Kunal Talwar , Jeffrey S. Foster , David Wagner, Detecting format string vulnerabilities with type qualifiers, Proceedings of the 10th conference on USENIX Security Symposium, p.16-16, August 13-17, 2001, Washington, D.C.
|
|
|
|
|
|
|
|
|
|
|
|
|
|