Undefined behavior warnings are pervasive in typical Linux desktop use
Typical desktop usage on a Linux distribution triggers many undefined behavior warnings in C/C++ programs
Software arXiv 10 Jun 2026 Measurement Prototype evidence
Published as “Undefined Behavior in C and C++: An Experiment With Desktop Use Cases”
Why it matters
The high prevalence of undefined behavior in everyday desktop libraries suggests that enabling UBSan by default could help developers discover and fix many latent bugs.
Summary
The experiment found that undefined behavior is very common in typical desktop Linux use, with UBSan reporting warnings for about 61% of the 59 tasks and a total of 10,914 unique warnings. Most of these warnings (88%) were virtual pointer table issues, and a single library (libgallium-25.3.6.so from Mesa) accounted for roughly 98% of all warnings. The study is limited to a Gentoo desktop running in a Qemu VM and uses GCC's UBSan without comparison to other tools, so the prevalence numbers are tentative.
What they found 4
- UBSan reported warnings for about 61% of the experimental tasks.
“UBSan outputted one or more warnings for about 61% of the simple experimental tasks in Table I.”
- The experiment generated 10,914 unique undefined-behavior warnings.
“In total, the experimental tasks generated 10, 914 unique undefined behavior warnings.”
- The Mesa graphics library (libgallium-25.3.6.so) produced roughly 98% of all unique warnings.
“libgallium-25.3.6.so, which is part of the low-level Mesa graphics library, accounted for about 98% of all unique warnings.”
- Virtual table pointer issues dominate the warning categories (88% of warnings).
“virtual table pointers and-to a much lesser extent-shift operators, NULL pointers, and misaligned accesses are behind most of the warnings observed”
Caveats 6
- UBSan is known to miss many undefined-behavior cases, making the 61% figure a lower bound.
- The authors acknowledge that false positives are presumably present, so some of the reported warnings may not correspond to real bugs.
- Selection bias is a typical issue in software engineering quasi-experiments; tasks may not represent typical desktop Linux use.
- Some packages (e.g., Firefox, LibreOffice) failed to compile with UBSan and were omitted.
- UBSan is known to miss a lot of undefined behavior; thus the answer to RQ1 is only tentative, and false positives are presumably also present.
- The experiment was conducted on an x86_64 Qemu virtual machine, so hardware-specific undefined behaviors may be missed or mis-characterized.
What’s new here 3
- Observes undefined behavior in a natural desktop usage setting rather than testing a curated code sample.
- Provides a task-based quasi-experiment covering a wide range of everyday activities (system admin, multimedia, web browsing, office, scientific work).
- Quantifies warning distribution across 32 packages and highlights extreme concentration in a single graphics library.