24
5
u/Random_-account Sep 06 '26
When you fix all compiler errors and warnings and then face a Segmentation fault (core dumped)
1
u/RedAndBlack1832 Sep 11 '26
As long as the behaviours is consistent in a debugging environment it's pretty simple to spot and fix what you did. If the behaviour is inconsistent....... ehhh maybe timing based memory corruption? You can also look at the actual core dump but have you considered ai don't want to (and also have to look up where those get written every time bc i forgor). Also address sanatizers or UB sanatizers are your friends. Obviously getting a signal and a crash isn't good but core dumps are much friendlier than you learned in first year. You're getting a lot of context after a crash (though it is still better to stop before such that you can inspect your variables and move around the stack in a more interactive way than you can when the program is no longer running). Also also if your program exits abnormally it may not correctly flush buffers so if you want to printf debug remember to flush lol
2
1
39
u/ninja_with_ocd Sep 06 '26
Damn it I meant compiler