Abstract

A specific approach to summary-based interprocedural symbolic execution is described. The approach is suitable for analysis of program source code developed with high-level programming languages and allows executing arbitrarily complex checks during symbolic execution, including throwing reports in the callee function about defects that only become certain within the caller context. The structure of the function summary, procedure of applying the summary in a particular context, composition of symbolic values for particular contexts, effect of summary-based analysis on complexity of implementing specific checker modules, procedure for constructing path-sensitive bug reports, and other aspects of the implementation are discussed in detail. A particular implementation of the approach, based on Clang Static Analyzer, is described. The implementation is scalable enough to allow analysis of large-scale software projects in reasonable time, finding bugs faster than the existing implementation of the inlining-based interprocedural analysis, without sacrificing correctness and soundness of the analysis. Particular checker modules, which find various defects, such as integer overflows, modifications of constant-qualified memory, multithreading issues, array bound checks, exception safety checks, and file stream errors, were updated to use the summary-based approach, demonstrating flexibility of the technique proposed. The implementation was tested by running full intra-unit inter-procedural analysis of the Android Open Source Project codebase.

Highlights

  • The approach is suitable for analysis of program source code developed with highlevel programming languages and allows executing arbitrarily complex checks during symbolic execution, including throwing reports in the callee function about defects that only become certain within the caller context

  • The structure of the function summary, procedure of applying the summary in a particular context, composition of symbolic values for particular contexts, effect of summary-based analysis on complexity of implementing specific checker modules, procedure for constructing path-sensitive bug reports, and other aspects of the implementation are discussed in detail

  • Summary-based method of implementing arbitrary contextsensitive checks for source-based analysis via symbolic execution

Read more

Summary

Введение

Автоматизация поиска ошибок в программах и генерации тестов посредством статического анализа исходного кода является одним из методов контроля качества программного продукта, позволяющим выявлять дефекты, трудно обнаруживаемые другими традиционными методами [1, 2]. При этом символьное исполнение исходного кода, написанного на высокоуровневом языке программирования, является наиболее сложным из-за богатства языковых конструкций, поведение которых должно быть смоделировано с учетом того, что значения величин, которыми они оперируют, являются, вообще говоря, символьными; однако результаты подобного анализа являются наиболее полезными, поскольку позволяют получить наглядное и полноценное описание найденных дефектов в терминах исходного языка и исходного кода. В работах [14, 15] описывается методика поиска отдельно взятых видов дефектов при помощи символьного исполнения исходного кода методом резюме. В настоящей работе описывается методика, позволяющая реализовать поиск дефектов достаточно общего и произвольного вида в условиях реализации межпроцедурного анализа методом резюме, при анализе высокоуровневого исходного кода программы. 41-62 резюме при анализе исходного кода, которое оказывается существенно более сложным, чем в случае анализа низкоуровневого кода, а также достижению гибкости метода анализа, необходимой для поиска дефектов произвольного вида. В рамках настоящей работы на базе CSA был реализован межпроцедурный анализ методом резюме

Терминология и особенности CSA
Предварительные замечания
Особенности реализации
Применение резюме
Актуализация символьных величин
Применение резюме на стороне ядра анализатора
Применение резюме на стороне проверяющих модулей
Составление отчета о дефекте
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call