Wtf? Why does this happen to me

A code that i just recompiled for the 15th time without changing anything in it magically fixed its mem leaks. Feels like I spent a day fighting my anger issues

1 Like

That’s the developer experience, you can find many memes about it

1 Like

Yep:

2 Likes

How are you debugging the leak?

What is the language?

What, if any, flags are used for the compilation?


If the code is the same and the compilation is deterministic, doing it 15 times shouldn’t change anything.

Are you sure you are verifying the leak correctly?

I am using C, GCC compiler with Asan and Valgrind to look for mem leaks. Now after recompiling 15 times, they have stopped screaming at me, so i figured it somehow got fixed

Yeah, something should have changed in your code - Valgrind has deterministic behavior if you’re using the same compile and run options

I just checked if something did change or not and I can confirm nothing has changed. Maybe its just a fluke, who knows

Also that this was the same code that I copied from my previous perfectly working project. It should have worked to begin with. IDK why it didn’t for 15 recompilations.

“Working” and “leak free” are two different things in C, lol. I highly recommend aggressively using ASAN and clang-tidy when developing C code, for sure.

I use ASAN for every test build. And the project i am talking about is a well tested one with 0 currently known issues. I just said working because of habit.

Fair enough. Part of using C professionally is being paranoid about that sort of thing, so I like to remind people of that

1 Like

Whatever you do next…keep up the good fight!! :slight_smile: :pray:

  • Did you google the problem / mem leak problem ?
  • Did you try restarting machine ?
  • Have you update all the software & IDE to latest versions ?

These steps do help multiple times

We don’t need to necro old topics