27
timourf
7y

Achievement unlocked: malloc failed
😨

(The system wasn't out of memory, I was just an idiot and allocated size*sizeof(int) to an int**)

I'd like to thank myself for this delightful exercise in debugging, the GNU debugger, Julian Seward and the rest of the valgrind team for providing the necessary tools.

But most of all, I'd like that three hours of my life back 😩

Comments
  • 1
    In c++ new, its a *little* harder makin that mistake.

    By a buggy offset overflow i can say:
    I know the feeling bro :v
  • 1
    @hch11 True, but I seem to have masochistic tendencies when it comes to programming. I decided for this project, for example, that it would be fun to try writing object oriented code in C 😑
    (More fun in theory than in practice)
  • 2
    Funny, I had a memory leak in my raytracer today that caused it to be killed by the OS again and again because it would keep running out of memory on long renders.
    At least..I hope that's what was happening.
    C/C++ is fun.
  • 1
    @RememberMe What fun! I'm going to be starting a gpu raytracer soon, and I can only imagine all the things that will go wrong 🤔
Add Comment