3

I've come across way too many questions regarding the topic that show absolutely no debugging effort on the part of the asker. Two recent examples are here and here.

In questions like these, I always see comments asking the asker whether a debugger was used, which line the segfault occurred in and so on.

Now I'm not saying that these askers purposely do not debug, nor am I insinuating that the asker is lazy. Most of the time, it seems to me, the fact that debuggers exist and are helpful in that situation may not occur to the asker.

So I'm thinking, if there's an easy way to detect whether the question is about a segmentation fault and whether the asker has not included any debugging efforts, then maybe pop up a hint that says something along the lines of, "Have you considered using a debugger to debug your program?" I'm thinking maybe a simple regex could do this? I don't know too much about regexes though.

A disadvantage that I see is that this may irritate askers who know what debuggers are and have reached a dead-end debugging the code. Also, it may irritate people who like clean interfaces without annoying popups. So maybe tune the detection mechanism such that it will never detect false positives, at the cost of letting some legitimate negatives escape?

I also realize that this probably applies to any question asked on Stack Overflow, but I see this happening so very often with questions tagged .

If you think that this is a load of rubbish, I'll be happy to hear why :)

1
  • This is a problem for all sorts of debugging questions, not just seg-faults.
    – eesiraed
    Commented Apr 28, 2018 at 15:37

2 Answers 2

5

Writing an automation function for these edge cases can be a real tar baby. There are literally hundreds of possible cases similar to the one you describe where it seems like an automated solution would work, but many of them (including this one) rely on an underlying assumption: that computers can read and understand meaning. They can't. Not yet, anyway.

After years of determined effort, we've succeeded in creating spam filters that actually work. We only made the effort because spam is a huge problem, and it relies on mechanisms (like bayesian filtering) that don't understand meaning. For everything else, there's Masterc... er, humans.

About debugging and prior effort: If the question says "I am getting a segfault, why?" and is followed by a code dump, the proper course of action is to vote to close the question as "Insufficient information to diagnose the problem."

3
  • Yeah makes sense. But have simple regexes been tried? Just to identify if certain word phrases exist in a post. Or am I grossly oversimplifying this? I don't think the meaning of the sentence would need to be inferred.
    – Anish Ramaswamy
    Commented Mar 20, 2014 at 19:58
  • I'm actually having trouble seeing the difference between training bayesian filtering for incoming email based on users marking it 'spam/not-spam', and training bayesian filtering for questions based on close votes.
    – AShelly
    Commented Jun 4, 2014 at 14:13
  • @AShelly, Exactly. I feel that maybe that would work, however, considering the scale of what we're talking about, that might actually cause some considerable slow-downs in the site. However, I could be completely wrong about what I just said. Commented Sep 18, 2014 at 22:24
4

It's not easy for a new programmer to even see that segmentation faults are debuggable. Unlike errors with actual tracebacks, a segmentation fault seems to be a massive and insurmountable barricade.

In my opinion, creating a relevant and canonical answer for

I have a segmentation fault. I don't know what to do.

is by far the best choice. Something like this, but good.

Then cleanup of these questions can be a lot faster, and people will be left with good information. There's no use asking "have you used a debugger?" if the people you are asking aren't even aware that debuggers exist!


If you have an error in a library, and there seems to be nothing you can learn from the errors you are getting out of it and you don't know enough to read the source, what do you do?

You do exactly what these people are doing: you ask and hope other people have solved this error before. That's why this needs a canonical answer, and that's why it's an XY problem. They really would want to know how to solve segmentation faults, but they instead ask how to fix their code.

1
  • Well, that's the point of those tooltips. If they tell the asker that debuggers exist before they post a question in such a way that the asker feels some sort of compulsion to want to click on the link leading to what a debugger is, and how to use it, that would require nobody to vote to close, comment, etc. This seems to result in a more positive experience for the asker, IMHO. Commented Sep 18, 2014 at 22:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .