>100k loc C project. >only error message you get is Segmentation fault: core dumped

>100k loc C project
>only error message you get is Segmentation fault: core dumped
how do you even proceed to debug this shit?
meanwhile in Rust error messages show you everything you need to fix the problem

DMT Has Friends For Me Shirt $21.68

Yakub: World's Greatest Dad Shirt $21.68

DMT Has Friends For Me Shirt $21.68

  1. 1 week ago
    Anonymous

    That's the neat part, you don't debug.

  2. 1 week ago
    Anonymous

    gdb lldb

    • 1 week ago
      Anonymous

      just print shit???

      Unironically these. Rust code isn't immune to logic errors or UB either so you have to know what could be happening.

      • 1 week ago
        Anonymous

        Well actually, Rust is safe from UB as long as you don't use unsafe blocks.

        • 1 week ago
          Anonymous

          no

        • 1 week ago
          Anonymous

          >as long as you don't use unsafe blocks
          so, not a single nontrivial rust project in existence

        • 1 week ago
          Anonymous

          Ok sure. LLVM's broken shit still randomly fricks up rust code though and you're going to have to use unsafe eventually anyhow. I'm not saying rust isn't a step up by the way, merely pointing out weird "heisenbugs" will happen and you have to just know how to solve them.

          • 1 week ago
            Anonymous

            The fact that they don't understand this immediately tells you that they're nocoders and should be disregarded. They will argue with you until they're blue in the face that optimizing compilers are good boys and perfect in every way, and you can always trust the hardware. They will do so because this is what they've been told. Their lack of experience shields them from the brutal reality of software engineering.

            Me? I've seen things you people wouldn't believe. CPUs hopping memory fences. Compilers throwing out critical code for no discernable reason. NaN > 0.0f == true. I trust nothing and no one anymore. Complexity is just more space for shit to break, and believe me, shit WILL break. We're just pawns fighting an unwinnable war.

  3. 1 week ago
    Anonymous

    Compile it with debugging.

  4. 1 week ago
    Anonymous

    just print shit???

    • 1 week ago
      Anonymous

      This, unironically. I've fixed atrocious bugs in company's .js engine just by console.log() stuff. I'm too lazy to configure nvim-dap.

  5. 1 week ago
    Anonymous

    The neat thing about a segfault is that it's 95% of the time synonymous to "yo dumbfrick, you tried to access memory that doesn't exist", i.e. either a nullptr dereference or array indexing out of bounds. Just attach a debugger, run the program, and enjoy your program halting at the exact line that caused the segfault.

    • 1 week ago
      Anonymous

      If only, a good portion of segfaults go away with the debugger attatched.

      • 1 week ago
        Anonymous

        Not since 1989, you dumb frick

        • 1 week ago
          Anonymous

          I am pretty sure I have done some coding more recently than 1989

        • 1 week ago
          Anonymous

          It doesn't matter what decade you're in. Undefined behavior is still undefined.

          • 1 week ago
            Anonymous

            And it doesn't stop being undefined when a debugger is attached.

  6. 1 week ago
    Anonymous

    -g3 -fsanitize=address
    come on dude

    • 1 week ago
      Anonymous

      >Code becomes so slow the problem doesn't happen.
      I know you'll cope, but it's true.

  7. 1 week ago
    Anonymous

    >these are the mentally ill losers telling you your language is bad and they'll invent a new one that's better
    lol
    lmao

  8. 1 week ago
    Anonymous

    Compiler options? Never heard of em!

    -W -Wall -pedantic -Werror etc

    gcc14 even has something similar to a borrow checker (a symbolic interpreter).-fsomething

    And Rust is just another level from C, way. better, decades (of research) more advanced. The most advanced imperative language ever, which borrows from CLU, Ada and other academic imperative languages, even from Haskell

    https://lngnmn2.github.io/articles/like-haskell-but-imperative/

    Idiots, idiots everywhere.

  9. 1 week ago
    Anonymous

    >no evidence
    sure, guy

  10. 1 week ago
    Anonymous

    >-W -Wall -pedantic -Werror etc
    Cniles don't even know these exist

  11. 1 week ago
    Anonymous

    With a debugger, you absolute moron. The same way you do in Rust.

  12. 1 week ago
    Anonymous

    gdb main
    start
    run until it breaks
    bt
    info locals / select frame / display expr etc.
    there you go if you want magic use rr make sure you use a modern ryzen or a intel cpu.
    tldr use gdb/lldb

  13. 1 week ago
    Anonymous

    congrats on compiling!
    Now you are going to pipe to bash and print "nyello minasama" and close the connection every 10k lines until you find where the problem is
    >i have done that and its a runtime segfault
    LOLOL, reread the code, this will take you a week at the least

  14. 1 week ago
    Anonymous

    imagine not knowing what a debugger is

  15. 1 week ago
    Anonymous

    skill issue

  16. 1 week ago
    Anonymous

    skill issue

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