Compiler fuzzing using equivalence-modulo-inputs and optimization-log-guided-fuzzing
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesisAlternative title
Kompilatorfuzzning med equivalence-modulo-inputs och optimization-log-guided-fuzzing (Swedish)
Abstract [en]
Compilers are a necessary part in the development of any modern software. As a result, the correctness of compilers not only concerns the compilers themselves but also any software that has been compiled by them. In particular, in the domain of critical applications such as telecommunications, compiler bugs have the potential to cause significant harm. Compiler fuzzing is an approach to validating compilers that has seen significant success in detecting compiler bugs such as crashes and miscompilations that static test suites miss. Three approaches to compiler fuzzing are Equivalence-modulo-inputs, concrete value-tracking, and Optimization-log-guided (OLG) fuzzing. This thesis presents novel work in combining these three approaches by using concrete-value tracking to construct EMI-variants and guiding variant acceptance using metadata from optimization logs. By extending CFuzzer, an internal fuzzer at Ericsson with the aforementioned methods, we uncovered eight new bugs in Ericsson’s internal LLVM compiler flacc, where three of these were upstream LLVM bugs, in the course of a three-month period. Additionally, we show that this approach achieves higher coverage than previous iterations of CFuzzer and, in some cases, a shorter time between bug occurrences. We also show a correlation between LLVM remarks and compiler coverage, indicating that counting remarks is a good lightweight approximation of LLVM coverage.
Abstract [sv]
Kompilatorer är oumbärliga för all modern mjukvaruutveckling. En kompilators korrekthet är därmed ytterst viktig för att inte bara säkra kompilatorn själv från fel, utan också mjukvaran som den kompilerar. Kompilatorfuzzning är en valideringsmetod som innefattar att generera slumpmässiga testfall i syfte att upptäcka fel i kompilatorn som statiska testsviter missar. I och med att kompilatorer blivit mer komplexa har behovet av avancerade fuzzare ökat, och nya metoder beträffande kompilatorfuzzning har genom åren utvecklats i syfte att motverka härdning och diversifiera programmen som kan genereras av fuzzare. Tre av dessa är concrete-value-tracking, equivalence-modulo-inputs (EMI) och optimization-log-guided (OLG) fuzzing. Även om dessa metoder har visat sig effektiva i sig själva har ingen tidigare kombinerat dessa tre metoder. I denna rapport visas hur concrete-value tracking kan nyttjas för att genomföra EMI-muteringar som i sin tur kan styras av statistiska modeller som innefattar data från optimeringsloggar. Detta i syfte att testa en version av LLVM utvidgad med stöd för DSP-C; ett tillvägagångssätt som avtäckte åtta tidigare okända kompilatorbuggar, ökade kodtäckningen och i vissa fall fann fel i kompilatorn på kortare tid än tidigare utforskade metoder. Dessutom visar denna rapport en korrelation mellan LLVMs inbyggda remarks och kodtäckning av LLVM-komponenter vilket tyder på att dessa är en god approximation av den verkliga kodtäckningen.
Place, publisher, year, edition, pages
2025. , p. 70
Series
TRITA-EECS-EX ; 2025:559
Keywords [en]
compiler fuzzing, compiler testing, testing, EMI, OLG
Keywords [sv]
kompilatortestning, fuzztestning, testning, EMI, OLG
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-368214OAI: oai:DiVA.org:kth-368214DiVA, id: diva2:1987619
External cooperation
Ericsson
Supervisors
Examiners
2025-08-112025-08-062025-08-11Bibliographically approved