Knowing the shapes of dynamic data structures is key when formally reasoning about pointer programs. While modern shape analysis tools employ symbolic execution and machine learning to infer shapes, they often assume well-structured C code or programs written in an idealised language. In contrast, our Data Structure Investigator (DSI) tool for program comprehension analyses concrete executions and handles even C programs with complex coding styles. Our current research on memory safety develops ways for DSI to synthesise inductive shape predicates in separation logic. In the context of trusted computing, we investigate how the inferred predicates can be employed to generate runtime checks for securely communicating dynamic data structures across trust boundaries. We also explore to what extent these predicates, together with additional information extracted by DSI, can be used within general program verifiers such as VeriFast. This paper accompanies a talk at the ISoLA 2018 track "A Broader View on Verification: From Static to Runtime and Back". It introduces DSI, highlights the above use cases, and sketches our approach for synthesising inductive shape predicates.
MotivationFormally reasoning about the memory safety and security of C code executing on processors is a serious challenge, especially when dynamic data structures are involved. The advent of separation logic [18] for modularly specifying heap operations and data structure shapes has sparked a wealth of research in the computer-aided verification of pointer programs. This has led to the development of powerful static verifiers, including shape analysis tools such as Forester [9] and Infer [6, 7] and program verifiers such as VeriFast [17]. While the latter requires significant manual effort in annotating programs with contracts, recent automated shape analysis techniques employ machine learning [4,25] but assume well-structured code and a well-behaved execution environment. However, these