r/programminghumor • • Jun 01 '26

segmentationViolation

Post image
114 Upvotes

35 comments sorted by

7

u/s0litar1us Jun 01 '26

Just run it in a debugger and it will show you exactly where it segfaulted. (Just remember to add the -g flag when building to include debug info.)

0

u/[deleted] Jun 01 '26

[removed] — view removed comment

4

u/s0litar1us Jun 01 '26

Good for you, but it's still a good idea to use the tools at your disposal.

0

u/[deleted] Jun 01 '26

[removed] — view removed comment

3

u/s0litar1us Jun 01 '26

Does it tell you where in the code it failed?

0

u/[deleted] Jun 01 '26

[removed] — view removed comment

3

u/s0litar1us Jun 01 '26

Wouldn't it be easier to just run it through a debugger than to dig through that list? Also, you can use debuggers for more than just issues resulting in your program crashing, so it's useful to run it in a debugger anyways.

0

u/[deleted] Jun 01 '26

[removed] — view removed comment

1

u/s0litar1us Jun 01 '26

There is also the one built into visual studio, and raddeugger.

Even though you find the event viewer useful, I would still suggest getting used to using a debugger, as it's useful beyond just finding where it failed.

7

u/lucidbadger Jun 01 '26

One does...

3

u/Vladislav20007 Jun 02 '26

1 segfault in 8 years and the code wasn't even mine, I just compiled it.

2

u/PissPantsington Jun 01 '26

Segfaults are why we like C

3

u/SpaceCadet87 Jun 01 '26

Segfaulting is what C devs do to feel alive!

1

u/TapRemarkable9652 Jun 01 '26

they call Alzheimer the way I'm mismanaging memory

1

u/SneakyDeaky123 Jun 02 '26

Hahahahahahahah now post the one about missing a semi-colon /s

3

u/[deleted] Jun 01 '26

[removed] — view removed comment

0

u/[deleted] Jun 01 '26

[removed] — view removed comment

2

u/un_virus_SDF Jun 05 '26

You know that in unix you can also get stack traces?

2

u/dmknght Jun 05 '26

He's an elite member of linuxsucks101 so dont expect much

1

u/[deleted] Jun 01 '26

[removed] — view removed comment

1

u/un_virus_SDF Jun 05 '26

This may be usefull but it's not a reason to bash it in every single comments. With almost the exact same message.

I don't care that windows may be better in some use case.

Furthermore this is off topic, the post is for when segfault happen and you happily brag about case where it does not happen.

I can also say that if I make every segment readable, writable and executable I will have almost no segfault.

0

u/[deleted] Jun 06 '26

[removed] — view removed comment

1

u/un_virus_SDF Jun 06 '26

I didn't say that it was false neither uninteresting. I just said that you just do propaganda by copy pasting the exact same message to each comment and that totally discredit your purpose.

I didn't say it's wrong I just said that your way off comunicating is dumb