Yet Another CppCon 2019 Trip Report
CppCon is the main(stream) C++ programming language conference in the US, and it has recently relocated near my neck of the prairie in Aurora, Colorado. I’ve always been a little skeptical of the usefulness of conference trip reports for the dear reader, but I’ve learned first hand that handwritten notes get lost in some inexplicable black hole as soon as they are archived on the bookshelf. The sections of this trip report will focus on aspects of the conference which can be independently researched (such as the talks which are usually uploaded on the CppCon Youtube channel) or considered for future years (such as whether to volunteer or not, or what the classes were like).
The venue, the Gaylord Rockies, is massive, and was hosting several other conferences in the adjacent ballrooms. This proximity drew in some curious non-programmers, and it was actually kind of fun trying to explain what CppCon was about to off-duty police officers who were raising funds for the Law Enforcement Torch Run for the Special Olympics. And apparently Discount Tire throws fancy tuxedo and gown balls for their employees???
There were some challenges that the venue imposes, such as the extreme parking prices, lack of rooms for all the attendees that wanted to stay, and the relative scarcity of nearby hotels and restaurants (translation: the Gaylord is in the middle of the nowhere). But most insulting of all, the promo renders of the venue depict the Rocky Mountains on the wrong side of the building!!! (The real life mountain view is still fabulous, though.)
Overall, despite the annoyances of the venue, I’m still excited to have CppCon so conveniently close to home for the next few years.
This year, I volunteered part time at the conference, in exchange for free admission during the week. Volunteering also discounts the cost of the pre-and-post conference classes. Is volunteering worth it? I really enjoyed the experience and hope to volunteer again next year! You may sometimes miss a talk due to conflicting shift responsibilities, but it’s a lot of fun working and hanging out with other volunteers who are passionate enough about C++ and software engineering to give their time to the conference.
One piece of advice I would give though, is that volunteers should sign up for shifts as soon as the scheduling system is published. The most popular slots were those helping speakers set up their talks, which allows you to watch the talk (with the responsibility of flashing reminder cards to the speakers)! If you were like me and waited until the weekend to decide, you may end up with a lot of shifts manning the book store or coat check. But even those responsibilities were still fun due to the interesting conversations with fellow shift volunteers.
Pre-Conference Class: Concurrency with Modern C++
For the pre-conference class, I took Rainer Grimm’s class Concurrency with Modern C++. I thought the class was a great exploration of the foundations of concurrency in C++, such as the memory model of C++ and the standard library APIs for locks, atomics, futures, condition variables, and other functionality.
Truthfully though, I felt that the class didn’t actually reach the real reason I took the class, namely the coverage of concurrent/parallel data structures and algorithms. The class syllabus promised such topics, but the pace of the class didn’t quite allow us to reach that point in two days. However, we got to keep electronic copies of the course slides and code samples, which did include coverage of such topics. And as an added bonus, students also received E-book copies of Rainer’s latest 2 books, “The C++ Standard Library” and “Concurrency with Modern C++”.
Rainer did a great job of exploring live code demos of some tricky concurrency bugs, and was extremely helpful with answering questions that arose during those interactive sessions. He also demonstrated some of the tooling available for diagnosing concurrency bugs, such as sanitize flags in gcc and clang.
The weeks before, I had actually done some class prework of going through the video class High-Performance Computing and Concurrency by Fedor G. Pikus. To compare the two styles of class, Fedor’s online course had more time to present lecture content than the 2 day live class, but it was much easier to understand Rainer’s coding demos when you can ask for live clarification!
Talking with students from other classes, I heard that Anthony William’s class More Concurrent Thinking in C++: Beyond the Basics took very little time to cover the basics of concurrency/parallelism in C++, and instead jumped directly into higher-level concepts such as a revisitation of the Dining Philosopher’s problem with modern C++.
For anyone deciding between the two concurrency classes, I would say that it depends on your familiarity with the concurrency APIs offered by C++11 and later standards. If you don’t need an explanation on the difference between threads and futures, it may be worth just going straight into the Beyond the Basics class.
Post-Conference Class: Exploiting Modern C++: Building Highly Dependable Software
(Disclosure: Matthew Butler and I work for the same company at this time of writing, and it’s probable that our prior association may make me less likely to say mean things about him in this blog? Also, he and Rainer Grimm did not receive any monetary compensation for my taking their classes. As a volunteer, the cost of your discounted class attendance goes entirely to the Gaylord, and apparently each day the Gaylord management needs $100/person to deliver a $25 lunch voucher and two snack periods…? I guess those were some really expensive muffins/bagels at the morning snacks…)
After the conference, I took Matthew Butler’s class Exploiting Modern C++: Building Highly-Dependable Software. This was a blue team focused class that focused mainly on software construction errors that can cause bugs in C++. The introduction to threat hunting and the perspective of the red team/threat-actors was interesting, but the real highlight of the class were the discussions with other students on their experiences with starting or maintaining an application security presence in the SDLC of their respective companies. Another highlight was the examination of some notorious C++ bugs (such as Dirty COW), as well as what the results of undefined behavior look like under Compiler Explorer.
When I wasn’t busy selling copies of The C++17 Lands poster at the conference store, I managed to attend talks during off-shifts and speaker-assisting time-slots. Having read some of the existing trip reports listed on the CppCon page, I’m not sure if an exhaustive list of the talks I went to is all that understandable to any reader (even if the reader is me from the future!). Instead, I would recommend taking a look at the titles of the talks uploaded to the CppCon Youtube channel and reading the abtracts provided in the video descriptions.
That aside, what follows are my comments on a sample of talks I attended.
Matthew Butler presented another run of his C++Now 2019 talk, “If You Can’t Open It, You Don’t Own It”, which explores how layers in the Roots of Trust concept can affect the security of the applications we write, even if we take the integrity of things like the supply chain of consumer hardware and the integrity of our compiler software for granted. Between the CppCon and C++Now version of this talk, I would actually recommend the C++Now version as it has an extra half hour of content and may have been less compressed than the CppCon version.
Preventing Spectre One Branch at a Time: The Design and Implementation of Fine Grained Spectre v1 Mitigation APIs discusses the mitigations available for Spectre v1, such as lfence insertions into assembly code and Speculative Load Hardening of compiler output. I thought that it was interesting that this talk suggests Chandler Carruth’s CppCon 2018 talk on Spectre as “recommended background”. It’s possible that depending on your preference of details-first versus overview-first learning, these talks can be watched in either order.
Compiler Explorer: Behind The Scenes by Matt Godbolt was an update on the current challenges of running Compiler Explorer on the cloud, and also a demonstration of some lesser-known features (such as optimization threshold analysis by Clang).
Abusing Your Memory Model for Fun and Profit was a dense, code-sample-heavy talk that also explored how patterns such as separating thread creation from management, or “lazy futures” can be implemented as generic template algorithms. Worth going through slowly if you are interested in writing fast, concurrent code.
Safe Software for Autonomous Mobility With Modern C++ discusses the issues encountered when working toward compliance with ISO 26262 for autonomous vehicle safety. Highlights covered the avoidance of memory allocations at runtime, and how use of large open-source libraries such as Boost or POCO can utterly destroy your chances of ever passing code review qualification due to their massive scope. This talk also provided another anecdote for the hazards of exceptions, as they can introduce branches invisibly, and cause gaps in branch coverage even when code coverage is theoretically 100%. This talk also recommended foonathan’s memory allocator framework.
At this point, it’s been weeks after CppCon and I still haven’t kicked this trip report out the door. As this post is growing into TLDR territory, it looks like it’s time to turn this report into a listicle…
Recommendations from colleagues and friends:
The following is a list of talks that friends/colleagues saw and recommended, in no particular order:
- Sean Parent “Better Code: Relationships”
- Andrei Alexandrescu “Speed Is Found In The Minds of People”
- Eric Niebler, David Hollman “A Unifying Abstraction for Async in C++”
- Chandler Carruth “There Are No Zero-cost Abstractions”
- Ben Deane “Everyday Efficiency: In-Place Construction (Back to Basics?)”
- Conor Hoekstra “Algorithm Intuition (part 1 of 2)”
- Conor Hoekstra “Algorithm Intuition (part 2 of 2)”
- Phil Nash “The Dawn of a New Error”
- Stephen Dewhurst “TMI on UDLs: Mechanics, Uses, and Abuses of User-Defined Literals”
- Hana Dusíková “A State of Compile Time Regular Expressions”
- Anthony Williams “Concurrency in C++20 and Beyond”
- Matt Godbolt “Path Tracing Three Ways: A Study of C++ Style”
- Ben Saks “Better Code with C++ Attributes”
- Bob Steagall “The Business Value of a Good API”
- Corentin Jabot “Dependency Management at the End of the Rainbow”
Talks/resources from the past:
These were talks and other resources that were mentioned at the conference, yet were not part of CppCon 2019. I figure it’s a sign of staying power and relevance if a speaker goes out of their way to reference an older talk.
- GoingNative 2013 C++ Seasoning - Sean Parent gets the top spot for being constantly mentioned in speaker talks and hallway conversations.
- CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”
- C++Now 2019: Oded Shimon “Undefined Behavior - Not what you expected” is only 3 minutes and shows a baffling compiler optimization as a consequence of undefined behavior in the code sample.
- C++Now 2018: Jason Turner “Initializer Lists Are Broken, Let’s Fix Them”
- C++ and Beyond 2012: Andrei Alexandrescu - Systematic Error Handling in C++
- Concurrent data structures are very hard to get right, but Rainer Grimm recommends Max Khizhinsky’s C++ library of Concurrent Data Structures.
- Herb Sutter’s proposal for atomic smart pointers was mentioned in both Rainer’s concurrency class and Matthew’s security class. The thing to remember about
std::shared_ptr<T>is that while the shared_ptr is atomic-friendly, the
<T>that it is holding is NOT protected.
- How To Write Shared Libraries by Ulrich Drepper was mentioned in the Milian Wolff “How to Write a Heap Memory Profiler” talk. Drepper is the same author of What Every Programmer Should Know About Memory fame.