• Deebster@programming.dev
    ·
    edit-2
    11 months ago

    I thought there was a type of bug called a notgull at first but that's the author's handle. The bugs are a use-after-free and an invalid pointer that was wrong due to an unsound calculation in non-unsafe code.

    This isn't meant as a saved you a click summary; the article's worth the read!

  • KillTheMule@programming.dev
    ·
    edit-2
    11 months ago

    This parting shot sounds pretty dire

    a bug in safe code can easily cause unsound behavior in your unsafe code if you’re not careful.

    That's definitely not how it should be. Fortunately, I think I disagree with that, since miri points to the "real" buggy code:

    unsafe { inner.as_ref() }

    As opposed to the article, I'd argue this code is not correct, since it did not account for alignment, which it must (I mean, by standard use of the word unsound this is unsound, since it can be called from safe code introducing UB). Or am I wrong? Is the fundamental value proposition of rust moot?