Introspection for C and its Applications to Library Robustness
Manuel Rigger (Johannes Kepler University Linz, Austria), Rene, Mayrhofer (Johannes Kepler University Linz, Austria), Roland Schatz (Oracle, Labs, Austria), Matthias Grimmer (Oracle Labs, Austria), Hanspeter, M\"ossenb\"ock (Johannes Kepler University Linz, Austria)

TL;DR
This paper introduces an introspection interface for C that provides runtime object information, enabling more robust library functions and improved error handling without terminating execution.
Contribution
It presents a novel introspection interface for C that exposes runtime object information, enhancing library robustness and error handling capabilities.
Findings
Implemented a more robust C standard library with introspection
Enabled detection of undefined behavior and benign errors
Demonstrated implementation in Safe Sulong, a C interpreter on JVM
Abstract
Context: In C, low-level errors, such as buffer overflow and use-after-free, are a major problem, as they cause security vulnerabilities and hard-to-find bugs. C lacks automatic checks, and programmers cannot apply defensive programming techniques because objects (e.g., arrays or structs) lack run-time information about bounds, lifetime, and types. Inquiry: Current approaches to tackling low-level errors include dynamic tools, such as bounds or type checkers, that check for certain actions during program execution. If they detect an error, they typically abort execution. Although they track run-time information as part of their runtimes, they do not expose this information to programmers. Approach: We devised an introspection interface that allows C programmers to access run-time information and to query object bounds, object lifetimes, object types, and information about variadic…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
