Using TLA+ to Fix a Very Difficult glibc Bug - Malte Skarupke - C++Now 2025 @CppNow
Using TLA+ to Fix a Very Difficult glibc Bug - Malte Skarupke - C++Now 2025  @CppNow
Uploaded October 2025 | Updated December 2026, 3 hours ago
cppnow.org
---

Using TLA+ to Fix a Very Difficult glibc Bug - Malte Skarupke - C++Now 2025
---

The glibc condition variable (meaning std::condition_variable) was subtly broken for years, breaking Python, C#, OCaml and countless programs. There were various attempted fixes but nobody seemed to fully understand this complex implementation of condition variables. I used the formal specification language TLA+ to model glibc condition variables and to reproduce the bug, figure out which of the patches actually worked (not the one everyone was using) and then used my TLA+ implementation to reason about the working patch, allowing me to clean it up and simplify it. I will show how you can take complex real world C code and do a straightforward translation into TLA+. It really is quite a pleasure to use since it has a simple model of "just run all interleavings of all threads" that makes it easy to translate code and to reason about what simplifications are necessary.
---

Slides: docs.google.com/presentation/d/1h-Ux08WAwrSrBNt1qaBhstaCUcIZaDh0QFjXg-LB8i4/edit?usp=sharing

think-cell develops one of the world’s leading PowerPoint applications, with C++ at the core of everything we build, from layout algorithms to deep integration with Microsoft Office. Interested in working on challenging C++ problems with real-world impact? Explore our open roles: think-cell.com/en/career/tech---

Malte Skarupke

I do formal verification of glibc for fun, or write a new sorting algorithm. At home I like working on algorithms, at work I tend to work on testing or performance.

I have 12 years of industry experience. For the last five years I have worked in finance, writing Ocaml, Python and CUDA. Before that I wrote C++ for 7 years in video games.

I gave two previous talks, one on generalized radix sorting in 2017 and one on fast hash tables in 2018. I blog at probablydance.com


---

C++Now 2026 - 4th May - 8th May
C++Now is an annual onsite international C++ programming and coding conference held in Aspen, Colarado. For all C++ developers, C++ software engineers and those involved with the C++ language, CppNow provides an indepth and technical content provided by the best and brightest C++ experts of the C++ world.
Annual CppNow Conference - cppnow.org
linkedin.com/company/cppnow
twitter.com/cppnow
facebook.com/CppNow
reddit.com/r/CppNow
https://mastodon.social/@cppnow
Video Sponsors: think-cell and Bloomberg
---

Videos Filmed & Edited By Bash Films: bashfilms.com
YouTube Channel Managed & Optimized By Digital Medium Ltd: events.digital-medium.co.uk
---

#debugging #debug #boost #cpp #cplusplus #programming #coding #softwareengineering #softwaredeveloper #code #cplusplusprogramming #cplusplustutorial #cplus #softwaredevelopment
Using TLA+ to Fix a Very Difficult glibc Bug - Malte Skarupke - C++Now 2025Lightning Talk: Taking C++ Benchmarking Seriously  - Malte Skarupke  - C++Now 2025From SIMD Wrappers to SIMD Ranges - Part 1 Of 2 - Denis Yaroshevskiy & Joel Falcou - C++Now 2025Achieving Peak Performance for Matrix Multiplication in C++ - Aliaksei Sala - C++Now 2025AI is Forcing us to Obey Scott Meyers - Jody Hagins - C++Now 2026C++26 Preview - Jeffrey Garland - C++Now 2024Declarative Style Evolved - Declarative Structure - Ben Deane - C++Now 2025Zero-Cost Abstractions in C++ - High Performance Message Dispatch - Luke Valenty - C++Now 2024Lightning Talk: Strongly Typed `using` C++ Declarations - Ali Almutawa Jr. - C++Now 2025Keynote: Reflection Is Only Half the Story - Barry Revzin - C++Now 2026Functional Composition Beyond Monads - Jonathan Müller - C++Now 2026Testability and C++ API Design - John Pavan, Lukas Zhao & Aram Chung - C++Now 2024
CppNow |

Using TLA+ to Fix a Very Difficult glibc Bug - Malte Skarupke - C++Now 2025

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER