Detecting uninitialized variables in C++ with the Clang static analyzer

Umann Kristóf; Porkoláb Zoltán: Detecting uninitialized variables in C++ with the Clang static analyzer. In: Acta cybernetica, (25) 4. pp. 923-940. (2022)

[thumbnail of cybernetica_025_numb_004_923-940.pdf]
Előnézet
Cikk, tanulmány, mű
cybernetica_025_numb_004_923-940.pdf

Letöltés (503kB) | Előnézet

Absztrakt (kivonat)

Uninitialized variables have been a source of errors since the beginning of software engineering. Some programming languages (e.g. Java and Python) will automatically zero-initialize such variables, but others, like C and C++, leave their state undefined. While laying aside initialization in C and C++ might be a performance advantage if an initial value can't be supplied, working with such variables is an undefined behavior, and is a common source of instabilities and crashes. To avoid such errors, whenever meaningful initialization is possible, it should be used. Tools for detecting these errors run time have existed for decades, but those require the problematic code to be executed. Since in many cases the number of possible execution paths are combinatoric, static analysis techniques emerged as an alternative. In this paper, we overview the technique for detecting uninitialized C++ variables using the Clang Static Analyzer, and describe various heuristics to guess whether a specific variable was left in an undefined state intentionally. We implemented a prototype tool based on our idea and successfully tested it on large open source projects.

Mű típusa: Cikk, tanulmány, mű
Befoglaló folyóirat/kiadvány címe: Acta cybernetica
Dátum: 2022
Kötet: 25
Szám: 4
ISSN: 2676-993X
Oldalak: pp. 923-940
Nyelv: angol
Kiadó: University of Szeged, Institute of Informatics
Kiadás helye: Szeged
Befoglaló mű URL: https://acta.bibl.u-szeged.hu/86901/
DOI: 10.14232/actacyb.282900
Kulcsszavak: Programanalízis, Programozási nyelv - C++ - fejlesztés, Statikus kódelemzés, Hibakeresés, Szoftverbiztonság
Megjegyzések: Bibliogr.: p. 938-940. ; összefoglalás angol nyelven
Szakterület: 01. Természettudományok
01. Természettudományok > 01.02. Számítás- és információtudomány
Feltöltés dátuma: 2025. ápr. 15. 12:40
Utolsó módosítás: 2025. ápr. 15. 12:40
URI: http://acta.bibl.u-szeged.hu/id/eprint/86961
Bővebben:
Tétel nézet Tétel nézet