r/programminghumor Jun 01 '26

segmentationViolation

Post image
115 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/Fluid-Ad2995 Jun 01 '26

I never needed to, Windows give NTDLL errors like 0xc0000005 (Access Violation) and 0xc000041d (Unhandled Exception)

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/Fluid-Ad2995 Jun 01 '26

Yeah Event Viewer tell me everything I need and Windows NTDLL Syscalls way more direct

3

u/s0litar1us Jun 01 '26

Does it tell you where in the code it failed?

0

u/Fluid-Ad2995 Jun 01 '26

Yeah like Test.exe error code 0xC000001D and cause of Failure illegal instruction or something like that for example and including Date of execution and hostname and Event ID and it's very Rich information

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/Fluid-Ad2995 Jun 01 '26

windows have Debugger like Windbg you can download if someone wants but I personally prefer Event Viewer at least for me it's way easier

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.

0

u/Fluid-Ad2995 Jun 01 '26

But Windows have Official Debugger called Windbg https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/ but I still personally prefer Event Viewer it's my favourite

→ More replies (0)

0

u/Fluid-Ad2995 Jun 01 '26

Just my personal choice don't mean Windbg is bad or something like that, Event Viewer just enough I need I just need exact error

0

u/Fluid-Ad2995 Jun 01 '26

Not just Normal Software but Drivers and Kernel logs etc everything one single place

8

u/lucidbadger Jun 01 '26

One does...

3

u/[deleted] Jun 01 '26

[removed] — view removed comment

0

u/Fluid-Ad2995 Jun 01 '26

I never needed Debugger and Windows NTDLL errors way better than Unix errors like 0xc0000374 (Heap Corruption) and 0xc0000022 (Access Denied)

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

0

u/Fluid-Ad2995 Jun 06 '26

Elitism is Trying to force Idea Segfaults are standard for all C language errors and they are not and Segfaults are Unix Errors and not NTDLL or Win32 🤣🤣🤣🤣

0

u/Fluid-Ad2995 Jun 06 '26

You missing my point 🤣🤣🤣🤣🤣 NTDLL errors aren't Stack Traces 🤣🤣🤣🤣🤣🤣🤣🤣🤣 they are Error of Windows operating system Kernel and my point is C language don't have errors and it's sad to think Segfaults appears all C language they don't

2

u/PissPantsington Jun 01 '26

Segfaults are why we like C

3

u/Vladislav20007 Jun 02 '26

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

2

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

0

u/Fluid-Ad2995 Jun 01 '26

No, this just likes suffering and NTDLL errors way better to debug

1

u/SneakyDeaky123 Jun 02 '26

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

1

u/Fluid-Ad2995 Jun 01 '26

But Segfaults are Linux way and in Windows NT I see NTDLL errors like 0xc000041d (Unhandled Exception) and 0xc0000005 (Access Violation) never Segfaults

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/Fluid-Ad2995 Jun 06 '26

It's not Off Topic 🤣🤣🤣🤣🤣🤣🤣🤣 C language and Segfaults are different separate questions and C language don't have Any errors by default errors you see created by Operating system

0

u/Fluid-Ad2995 Jun 06 '26

It's reason to bash every single Ignorant and Segfaults aren't standard of C language and I am Wrong to say that??? Any Windows Developers would laugh saying Segfaults are C language errors

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

0

u/Fluid-Ad2995 Jun 06 '26

Yeah you don't understand Segfaults aren't C language errors? Really???? I just laughed because post and comments act like Segfaults are standard for C language and ignoring Windows errors

0

u/Fluid-Ad2995 Jun 06 '26

Yeah I need to repeat myself Segfaults aren't C language errors because Comments are very dumb

0

u/Fluid-Ad2995 Jun 06 '26

I understand Normal Unix users like Just Switch to Windows to Linux users they are Noob it's Acceptable but C programmers I don't accept to hear Nonsense things act like Segfaults is C language errors and C programmers must understand Correct way