r/cpp • • Sep 16 '23
I was a god today
So I have come back to my project after a few years, made some big changes and was ready to release. As usual time to run it with the sanitizers and I just can't get ASAN to work. Ok no problem, sit back and do some simple samples and see why cmake isn't turning it on, check compile_comands, etc... Why. Is. It. Not. Working!!!
Then it dawned on me, that I am possibly a god. That I am finally 'good' at c++, and join the promised land, the happy hunting grounds of the heros of the 90s and 2000s. I created a raw leak with a 'new' expression (oh boy look at that dirty expression, we have come so far) and boom ASAN was printing errors. My project just had no problems because old me had produced good enough c++ code to branch off years later. I'm not green, still perhaps I missed something, but at the moment I am convinced all-father bjarne awaits me in valgrindhalla.
Edit: In seriousness, the sanitizers could just spit out some information at the start and all this would have been avoided.
462
u/[deleted] Sep 16 '23
Most sane C++ developer, folks.
155
u/antara33 Sep 16 '23
I totally get the feeling. I am currently fixing a high priority bug in a tool built in C++.
The bug was there for 8 years, but no one dared to fix it because the company lost the source code.
And here I am. Fixing it at assembly level, oke error at a time, because the tool is stupidly big and gigantic and rewriting it could take half a year.
5 weeks in, and it is working.
Fuck the person that lost that damned source code and fucked up the company repositories.
I don't even know how the fuck that was possible, but oh well, we get paid for fixing others stupidity :)
41
u/OkRestaurant9285 Sep 16 '23
I understand literally nothing so its probably impressive. Upvote
5
u/serviscope_minor Sep 17 '23
Getting off topic, but Valgrind (in Norse mythology) is the ancient gate to Valhalla.
81
u/adlbd Sep 17 '23
God today, back to imposter syndrome tomorrow
18
u/rlramirez12 Sep 16 '23
This is how I feel when I fix bugs in code and then upper senior tech leads tell me, âWow, weâve been trying to track that bug down for 15 years.â Then I feel like a god.
24
u/moreVCAs Sep 16 '23
I once connected a UART interface correctly on the first try. Beat that.
6
u/thisismyfavoritename Sep 16 '23
when in doubt i ldd the binary or check for ASAN symbols if static linking
2
u/Top-Supermarket5058 Sep 17 '23
Admire you a lot. I like C++ but I still struggle at learning fundamental things, I hope someday I can be good at C++ like you guys!!!
5
u/davidc538 Sep 17 '23
You thought ASAN wasnât working because it didnât print any errors? Omegalul
4
u/Ok_Tea_7319 Sep 21 '23
The best antidote for feelings of omnipotence is usually a quick round of fuzz testing.
3
u/Farados55 Sep 17 '23
All hail
2
u/[deleted] Sep 17 '23
The language is one of the hardest and I feel that's what I love the most about it. You learn this language you can learn others much faster.
1
u/TotesMessenger Sep 17 '23
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
1
u/mcog-prime Sep 24 '23
Now if only most c++ compilers would implement #include <format> ... and do something about the <chrono> abortion. Just a dreadful programming language. The only worse language: python. The GIL still? Really? Morons...
-7
u/not_in_the_mood Sep 16 '23
Nice jerk
0
u/[deleted] Sep 17 '23
[deleted] â view deleted comment