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
Thatâs the developer experience, you can find many memes about it
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
Whatever you do nextâŚkeep up the good fight!!
- 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