Tim McNamara - Unwrapping unsafe

Sdílet
Vložit
  • čas přidán 4. 04. 2024
  • How do Rust developers use unsafe? Let's use data to find out. Tim has been analysing hundreds of thousands of crates and open source code repositories to inspect how the unsafe keyword is being used. This talk is an overview of what Rust's 'unsafe' keyword unlocks. Does it give you free reign? Is it inherently dangerous or unsafe? It's also a talk that describes what the terms memory safety and undefined behaviour mean. We spend some time examining what the consequences are. Let's actually be unsafe and create a program with a security vulnerability so that we can see why we should stay safe. After that, the body of the talk focuses on how unsafe is actually used by the Rust community today. Using code analysis tools, you'll see what sits within unsafe blocks. Among other things, we'll see if we're getting better. For example, the standard library has made changes to interacting with pointers using safe functions. Once changes like that are implemented, is it possible to see changes in usage?
  • Věda a technologie

Komentáře • 4

  • @nordgaren2358
    @nordgaren2358 Před měsícem +1

    Why doesn't he use the add method on the pointer, which will add the size of the type to the address for him?

  • @boenrobot
    @boenrobot Před měsícem

    I do wonder... What is the most used package that includes an unsafe block? I mean, including transient uses.
    If one knows what that is, and re-implement the unsafe blocks in a safe way (or provide extra features in core to do it), the number of projects with unsafe would go way down.

  • @clementdato6328
    @clementdato6328 Před 2 měsíci +3

    Better if logos are all on the right for a bigger slide window.

  • @-syn9
    @-syn9 Před 2 měsíci +1

    22:55 unsafe blocks georg