Does RUST has this problem?

Does RUST has this problem?

Nothing Ever Happens Shirt $21.68

Unattended Children Pitbull Club Shirt $21.68

Nothing Ever Happens Shirt $21.68

  1. 2 years ago
    Anonymous

    No. Rust doesn't let you use the value of an unitialized value.

    • 2 years ago
      Anonymous

      neither does basically any modern language

    • 2 years ago
      Anonymous

      >unitialized value.
      variable*

      neither does basically any modern language

      OP was asking about rust

      Yes, it relies on C libraries all over the place and you'll see your "rust" program segfault.

      > it relies on C libraries all over the place
      what C libraries

      • 2 years ago
        Anonymous

        it literally uses libc and let's not mention all these crates that bundle C code and people use without a second thought

        • 2 years ago
          Anonymous

          >it literally uses libc
          Which libc? GNU libc? Musl?

          • 2 years ago
            Anonymous

            moron

    • 2 years ago
      Anonymous

      You can create uninitialized memory in Rust (AND THATS A GOOD THING!): https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html

      brainlet who has never written a performant program in his entire life

      • 2 years ago
        Anonymous

        Ah yea, I forgot about unsafe

    • 2 years ago
      Anonymous

      most c compilers will swear at you if you attempt to as well

      • 2 years ago
        Anonymous

        Cool, rust just won't compile.

  2. 2 years ago
    Anonymous

    Yes, it relies on C libraries all over the place and you'll see your "rust" program segfault.

  3. 2 years ago
    Anonymous

    So rust protects you against noob errors?

  4. 2 years ago
    Anonymous

    Can a Rust program hypothetically have this problem? Yes. Is it likely to show up often? No. Deliberately using uninitialized memory requires the MaybeUninit type and an unsafe block. It's very difficult to use uninitialized memory accidentally.

    • 2 years ago
      Anonymous

      >It's very difficult to use uninitialized memory accidentally.
      >what is in-line assembly?
      it takes two seconds to make rust completely unsafe, defeating its entire purpose.

      • 2 years ago
        Anonymous

        >seatbelts are pointless because you can take them off

      • 2 years ago
        Anonymous

        And it's taken 5 decades and counting to try to make C safe, and the best they could come up with was an entirely new language instead. All the projects attempting to make C programming less error prone in-place with linters/sanitizers/AI magic always limit themselves to detecting a very narrow set of bugs at runtime (asan/msan/tsan work, and are great at their narrow tasks, and catch most bugs most of the time) or inevitably become new language projects (cyclone, verona, wuffs, etc. And Rust).

    • 2 years ago
      Anonymous

      https://i.imgur.com/MDYsSDy.jpg

      Does RUST has this problem?

      You cant use standard library memory allocators in kernel space, it requires your own functions. Sometimes you want uninitialized memory for performance, sometimes you dont for security. In such cases there is no practical difference between C and rust because you need to implement the functions in both languages and they could have the same name. It would be the exact same thing. It's not inherently a C problem, it's an optimization problem.

      • 2 years ago
        Anonymous

        >You cant use standard library memory allocators in kernel space, it requires your own functions
        You can plug your own allocator into Rust's standard library, either globally or per object (though the latter is unstable). They do it here: https://gitlab.com/linux-kernel/linux-next/-/blob/master/rust/kernel/allocator.rs
        The standard library promises it won't let you access uninitialized memory without unsafe, and it keeps that promise even if you swap out libc's malloc/realloc for Linux's krealloc.
        I don't know what it looks like when memory is moved from kernelspace to userspace though.

  5. 2 years ago
    Anonymous

    Rust sisters where can I buy hrt?

    • 2 years ago
      Anonymous

      Higher Ranked Trait bounds has been stabilized since v1.0.

  6. 2 years ago
    Anonymous

    Rust is pedantic about uninitialized memory, but buffer reuse is "safe" and has similar risks.
    I don't know how this affects kernels.

  7. 2 years ago
    Anonymous

    > corporation that's invested millions of dollars in <competing language> makes moronic claims
    shocking.

  8. 2 years ago
    Anonymous

    Having uninitialized arrays are useful for highly optimized math functions

  9. 2 years ago
    Anonymous

    >leaking uninitialized kernal memory
    No, but they do leak shit and puss from the rotting hole where their dick used to be.

Your email address will not be published. Required fields are marked *