This website uses cookies to ensure you get the best experience on our website. Learn more

Curiously Recurring C Bugs at Facebook

x

Adi Shavit & Björn Fahller: The Curiously Recurring Pattern of Coupled Types

The C++ Distributed Meetup 0x03: Malmö C++ (Malmö) & Core C++ (Mevasseret Ziyyon) & SwedenCpp (Stockholm)
StockholmCpp, 0x10 October 2018

Slides:

See the whole C++ Distributed Meetup 0x03 here:
x

C++Now 2019: David Sankel “C++: Engineers Wanted, Programmers not so Much”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

The software development world is groaning as it transforms into a mature engineering discipline. As C++ software projects both grow and age, a fundamental shift in mindset is happening, that from the programmer to the engineer.

This talk explores the recent shifts in focus from language, to system, to business value in both the commercial and C++ standardization settings. We'll see, in particular, how this impacts conventions, maintenance, specifications, tools, and ideologies.

David Sankel
Bloomberg
New York, New York

David Sankel is a Software Engineering Manager/TL at Bloomberg and an active member of the C++ Standardization Committee. His experience spans microservice architectures, CAD/CAM, computer graphics, visual programming languages, web applications, computer vision, and cryptography. He is a frequent speaker at C++ conferences and specializes in large-scale software engineering and advanced C++ topics. David’s interests include dependently typed languages, semantic domains, EDSLs, and functional reactive programming. He is the project editor of the C++ Reflection TS, a member of the Boost steering committee, and an author of serveral C++ proposals including pattern matching and language variants.

Videos Filmed & Edited by Bash Films:
x

CppCon 2018: Louis Dionne “Compile-time programming and reflection in C++20 and beyond”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Compile-time programming and reflection have been getting a lot of attention recently. Indeed, from Herb Sutter's well-known Metaclasses proposal to the newly created Reflection TS, a lot of effort is being put into solving the general problem of programmatic code generation and program introspection. More recently, the C++ Standards Committee has also been evaluating and adopting proposals that vastly expand the realm of constructs available at compile-time, in constexpr functions: new-expressions, try-catch blocks, virtual functions, some standard containers, and more.

For most people, it is unclear how all these features, whether exploratory or voted into the Draft International Standard, relate together. Without being active in the Committee, it can be difficult to see the big picture, the unifying vision driving all these changes. Fortunately, there is one, and this is what this talk is about.

We will go over these features and explain how they might interact with each other by boiling them down to their essential parts. We will present how different use cases for compile-time programming will be solved in C++20, and how even more use cases can be unlocked in the future. Attendees will leave this talk with an understanding of the improvements to constexpr planned for C++20, of what's needed to unlock more advanced use cases and an unifying vision for how to get there.

Louis Dionne, Apple, C++ Standard Library Engineer
Louis is a math and computer science enthusiast who got swallowed by the C++ monster when he was a naive, unsuspecting student. He now works for Apple, where he is responsible for libc++, the Standard Library shipped with LLVM/Clang. He is a member of the C++ Standards Committee and of the Boost community, where he authored the Boost.Hana metaprogramming library.

Videos Filmed & Edited by Bash Films:
x

How to find bugs in C, C++, С# and Java software by using tool static code analysis

PVS-Studio is a tool for bug detection in the source code of programs, written in C, C++, C# and works under Windows and Linux. It is possible to integrate it into Visuial Studio and other widespread IDE.

We regularly check various open-source projects (Tizen OS, Linux kernel, Chromium, Unreal Engine 4, CryEngine V, Mono, Qt and others) with PVS-Studio and send analysis results to developers and usually describe them in our posts as well. Besides, we add them into our bug database -


You may download and try the tool by this link:

-----------------------------------------------------------------------------------------------
Facebook:
Twitter:
Instagram:
Vk:
x

CppCon 2017: Michael Spencer “My Little Object File: How Linkers Implement C++”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Ever wonder how the linker turns your compiled C++ code into an executable file? Why the One Definition Rule exists? Or why your debug builds are so large? In this talk we'll take a deep dive and follow the story of our three adventurers, ELF, MachO, and COFF as they make their way out of Objectville carrying C++ translation units on their backs as they venture to become executables. We'll see as they make their way through the tangled forests of name mangling, climb the cliffs of thread local storage, and wade through the bogs of debug info. We'll see how they mostly follow the same path, but each approach the journey in their own way.

We'll also see that becoming an executable is not quite the end of their journey, as the dynamic linker awaits to bring them to yet a higher plane of existence as complete C++ programs running on a machine.

Michael Spencer: Sony Interactive Entertainment, Compiler Engineer

Michael Spencer is a Compiler Engineer at Sony Interactive Entertainment where he has spent 6 years works on PlayStation's C++ toolchain. He is an active member of the LLVM community focusing on object files and linkers. He also serves as Sony's representative to the ISO C++ standard committee.

Videos Filmed & Edited by Bash Films:

CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Hash tables consume a large volume of both compute resources and memory across Google's production system. The design for hash tables in C++ traces its origins to the SGI STL implementation from 20 years ago. Over these years, computer architecture and performance has changed dramatically and we need to evolve this fundamental data structure to follow those changes. This talk describes the process of design and optimization that starts with std::unordered_map and ends with a new design we call SwissTable, a 2-level N-way associative hash table. Our implementation of this new design gets 2-3x better performance with significant memory reductions (compared to unordered_map) and is being broadly deployed across Google.

Matt Kulukundis: Google, Senior Software Engineer

Matt is a senior software engineer on the C++ libraries team at Google. Prior to Google he has worked on compilers, machine learning, and underwater robotics. In his free time, he scuba dives in warm places.

Videos Filmed & Edited by Bash Films:

The Curiously Recurring Pattern of Coupled Types - Adi Shavit and Björn Fahller

Why can pointers be subtracted but not added?

What do raw C pointers, STL iterators, std::chrono types, and 2D/3D geometric primitives have in common?

In this talk we will present some curiously coupled data types that frequently occur in your programs, together forming notions that you are already intuitively familiar with. We will shine a light on the mathematical notion of Affine Spaces, and how they guide stronger design. We will review the properties of affine spaces and show how they improve program semantics, stronger type safety and compile time enforcement of these semantics.

By showing motivational examples, we will introduce you to the mathematical notion of affine spaces. The main focus will then be on how affine space types and their well defined semantics shape expressive APIs.

We will give examples and guidelines for creating your own affine types. Although the examples in the talk will use C++, the general concepts are applicable to other strongly typed programming languages.



Don't forget to check out Adi Shavit's and Björn Fahller's next talks at this year's NDC Techtown:



Check out more of our talks in the following links!

NDC Conferences

C++ Weekly - Ep 125 - The Optimal Way To Return From A Function

Upcoming Classes In Stuttgart, Sept 2020!



My Training Classes:
Support these videos:
Follow me on twitter:
ChaiScript:
Music:

Finding hard to find bugs with Address Sanitizer - Marshall Clow - Meeting C++ 2019

Finding hard to find bugs with Address Sanitizer - Marshall Clow - Meeting C++ 2019 Secret Lightning Talks
Slides:
Wikipedia Asan page:

CppCon 2016: Nicholas Ormrod “The strange details of std::string at Facebook



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Standard strings are slowing you down. Strings are everywhere. Changing the performance of std::string has a measurable impact on the speed of real-world C++ programs. But how can you make strings better? In this talk, we'll explore how Facebook optimizes strings, especially with our open-source std::string replacement, fbstring. We'll dive into implementation tradeoffs, especially the storage of data in the struct; examine which standard rules can and cannot be flouted, such as copy-on-write semantics; and share some of the things we've learned along the way, like how hard it is to abolish the null-terminator. War stories will be provided.

Nicholas Ormrod
Software Engineer, Facebook
Nicholas is a developer efficiency engineer at Facebook. If he talks too much, disable him with a well-placed nerd snipe.

Videos Filmed & Edited by Bash Films:
x

CppCon 2017: David Sankel “So, you inherited a large code base...”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

This is a talk about solving the most difficult problem a software engineer ever faces, converting a large codebase with antiquated designs and spotty quality into a state-of-the-art, modern system. We'll be covering clang-based refactoring, mnemonic reasoning methods, safe rewrites, coding standards, and, oh yes, migration paths.

If you've ever been tasked with making a legacy codebase the best-in-class, or think you might, then this talk is for you.

David Sankel: Bloomberg

David Sankel is a professional software developer/architect based in the USA and an active member of the C++ Standardization Committee. His prolific software developments have included CAD/CAM, computer graphics, visual programming languages, web applications, computer vision, and cryptography. He is a frequent speaker at the C++Now conferences and is especially well known for his advanced functional programming in C++ talks. David’s interests include large-scale development, dependently typed languages, semantic domains, EDSLs, and functional reactive programming. David's current research interests include dependently typed languages, semantic domains, EDSLs, and functional reactive programming. He currently works for Bloomberg.

Videos Filmed & Edited by Bash Films:

2014.10.29 - Security@Scale - Louis Brandy, Facebook

CppCon 2017: Kenny Yu “End-to-end Deadlock Debugging Tools at Facebook”

Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Facebook has developed tooling to help quickly find and debug several classes of concurrency bugs in Facebook's large C++ codebase. In this talk, we will focus specifically on deadlocks and the tools we use to detect and prevent them. We will explore the various tools we use — some open source tools we have deployed and some we have developed — and how they work by walking through several examples of real-world bugs found by these tools in Facebook's large production systems.

Topics include:
* How we deploy and utilize ThreadSanitizer on Facebook's large codebase
* Linux eBPF tools to detect potential deadlocks on running binaries
* gdb extensions to examine mutex internals to detect deadlocks
* folly::Synchronized and other libraries that make it more difficult to introduce concurrency bugs

Kenny Yu: Facebook, Software Engineer

Kenny Yu is a software engineer at Facebook. In his time there, he has focused on improving testing and developer experience for engineers at Facebook, working on things such as debugging tools and concurrency bug-finders. He currently works on Facebook's cluster manager and container deployment platform.

Videos Filmed & Edited by Bash Films:

Bug fix in C++ AMP, amp.h and Curiously Recurring Template Pattern

Microsoft C++ amp.h has a minor bug

error C3861: '_Access': Identifier not Found

We learn how to fix this error. We will also learn about the Curiously Recurring Template Pattern

Curiously Recurring Template Pattern

CRTP is a means to get compile-time polymorphism in C++. Join us as we look at how it works along with a a discussion of complete vs incomplete types
x

C++Now 2018: Daniel Dilts “Avoiding Virtual Call in CRTP”



Lightning Talk

Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Videos Filmed & Edited by Bash Films:

C++Now 2019: David S. Hollman “Thoughts on Curiously Recurring Template Pattern”



Lightning Talk

Presentation Slides, PDFs, Source Code and other presenter materials are available at:

Videos Filmed & Edited by Bash Films:

CppCon 2017 Curiously Recurring C++ Bugs at Facebook

Curiously Recurring C++ Bugs at Facebook

I've spent the last few years watching Facebook's C++ codebase grow by several orders of magnitude. Despite constantly improving abstractions, constantly improving tooling, frequent internal courses, and ongoing internal discussion, there are bug-patterns we simply cannot stop from being reintroduced into our code. My hope is to show some of the most common (and infamous) bugs in our history, and the surprising complexity that arises in some apparently simple situations.

This talk serves the dual purpose of educating the intermediate (and perhaps the occasional advanced) C++ programmer about some really nasty common pitfalls, as well as serves as a plea to experts to help further improve the language, libraries, and best practices to help educate and eradicate some of these problematic patterns.

EVENT:

CppCon 2017

SPEAKER:

Louis Brandy: Engineering Director, Facebook

PERMISSIONS:

CppCon Organizer provided Coding Tech with the permission to republish this video.

Additional material for C++ learners:
Murach's C++ Programming
C++ in One Hour a Day, Sams Teach Yourself (8th Edition)
A Tour of C++ (2nd Edition) (C++ In-Depth Series)
C# Programming Illustrated Guide For Beginners & Intermediates: The Future Is Here! Learning By Doing Approach

CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”



Presentation Slides, PDFs, Source Code and other presenter materials are available at:

I've spent the last few years watching Facebook's C++ codebase grow by several orders of magnitude. Despite constantly improving abstractions, constantly improving tooling, frequent internal courses, and ongoing internal discussion, there are bug-patterns we simply cannot stop from being reintroduced into our code. My hope is to show some of the most common (and infamous) bugs in our history, and the surprising complexity that arises in some apparently simple situations.

This talk serves the dual purpose of educating the intermediate (and perhaps the occasional advanced) C++ programmer about some really nasty common pitfalls, as well as serves as a plea to experts to help further improve the language, libraries, and best practices to help educate and eradicate some of these problematic patterns.

Louis Brandy: Engineering Director, Facebook

My team is responsible for the overall health of the Facebook C++ codebase, both the tools and the libraries. We work on: compilers, static/dynamic analysis, linters, large scale changes, and the core libraries.

Videos Filmed & Edited by Bash Films:

Shares

x

Check Also

x

Menu