Each day we get many questions with a title along the line of "Segmentation fault (core dumped)" followed by some source code with bugs. This is particularly true for questions in the c and c++ tags.
A segmentation fault could be caused by anything, see Definitive List of Common Reasons for Segmentation Faults. It literally just means: "It appears that you have a memory-related run-time bug in your program". As it turns out, most bugs are memory-related.
Therefore "segmentation fault" is not a good question title nor is it a good error description. Questions with such descriptions are generally of low quality. Often they are "debug this for me" requests and they often lack an MCVE.
Just as an example, here are all "segmentation fault" questions I could found posted in the C and C++ tags today:
- How do I fix a segmentation fault (core dump) in C?
Closed as it was simple typo/very common FAQ.
Cause for seg fault: forgot&
in scanf. - A macro for printf caused Segmentation fault
Somewhat incomplete question. The OP would have gotten a better answer with a MCVE.
Cause for seg fault: most likely not checking if a function returned an error after using it. - Segmentation fault (core dumped) [matrix of pointers] Closed, basically just a wall of code, "debug this for me". It contained many basic FAQ newbie mistakes.
Cause for seg fault: missing string null termination and array out-of-bounds bugs. - segmentation fault ( core dump)
Appears to be another debug request with no MCVE, that can't get reproduced.
Cause for seg fault: no idea, can't reproduce.
I propose that we do something against questions with "segmentation fault", "seg fault" or "sigsegv" in the title, in order to increase the quality of such questions.
(SIGSEGV
is the formal name for the signal used by the OS for indicating segmentation faults.)