28

My question was closed with the reason that it was a duplicate. But, to me, the referenced question is completely different.

I agree I can still learn a lot about debugging, but my question was about a specific context: how to read an OPC-UA variable, using the Qt 6 framework, avoiding the segmentation fault when the host goes down after the read call and before the signal is emitted.

I showed my code and my research, but that wasn't enough.

I hope, at least here, my real intention is clear. How should I edit/improve my question in order to explain it better and avoid such a misunderstanding?

12
  • 8
    The comments seem to suggest that the problem could be somewhere else in the code. The question would likely benefit from a complete example so that the failure could be reproduced by other users.
    – E_net4
    Commented Jun 15, 2023 at 7:33
  • 7
    Just looking at the question, I saw a screenshot with possibly an error, but I would have to get out a microscope to read it. That would have been justification enough for me to give it a close vote. Questions are best short and sweet, with graphics only if absolutely necessary, and never to describe an error (unless the error is a graphic issue, of course).
    – theMayer
    Commented Jun 16, 2023 at 3:10
  • 2
    @theMayer Re "That would have been justification enough for me to give it a close vote": well that's a real problem, but not with the question. You could instead simply post a comment asking the OP to create a more legible image and/or post it in text form, as appropriate. Regardless, you wouldn't have to "have to get out a microscope to read it" at all. Just click the image and it is perfectly legible. By all means vote to close if your comment is then ignored, but let's not zealously squash perfectly salvageable questions just because we can come up with some flimsy pretext to do so.
    – skomisa
    Commented Jun 17, 2023 at 0:25
  • 3
    @skomisa - that's just not how I do things... if a person asks a question and can't be bothered to follow one of the first formatting rules when doing so, they earn a close vote. I suspect most on this site follow the same principle.
    – theMayer
    Commented Jun 17, 2023 at 14:55
  • @skomisa A close vote is not meant to be an insult, it's exactly what the site suggest to do with questions which need more work before they can be answered. Not that I agree with the close reason in this particular case. Commented Jun 17, 2023 at 20:47
  • 1
    @DmitryGrigoryev No, that's the purpose of downvotes, and even those are advised to be accompanied by a comment explaining the reason for the downvote. Close votes are intended to be used when the question needs to be closed, such as being off-topic or a duplicate - they are not intended to be used to close good questions that have problems, but anyone who's spent some time trying to ask good questions on here knows that in practice that's exactly how most use them, and it's why this community has such a reputation for being inaccessible to anyone who isn't trying to game points. Commented Jun 17, 2023 at 20:53
  • 1
    @skomisa: Please do not upload images of code/data/errors. is in the FAQs for a reason. My response to questions that use images when inappropriate is a close vote ;(needs details or clarity) and a comment containing that link. If the OP edits the question and pings me to let me know, or I happen on the question later, and it has been edited to properly ask, I retract my CV. Leaving questions open that don't comply with site standards and policies doesn't help anyone, including the OP (who doesn't learn about their error and repeats it in the future).
    – Ken White
    Commented Jun 17, 2023 at 22:52
  • 1
    @KenWhite My earlier comment related to someone stating that the question linked to in the OP deserved a close vote purely because of the screen shot. It didn't. It was helpful and relevant for the OP's question, and I note that nobody from meta has since chosen to delete it, nor close vote the question. And while it may be your policy to close vote questions containing images of code/data/errors, it is not a stated policy of SO. I agree with Hashim's comment above: "Close votes are...not intended to be used to close good questions that have problems".
    – skomisa
    Commented Jun 18, 2023 at 2:13
  • 1
    @skomisa: If it's a FAQ post, it's pretty much official policy, as it has been selected to be a FAQ - as I said, it's there for a reason. Close votes are intended to be used to close posts that do not comply with site guidelines, and images of textual content are not in compliance. Images should only be used when there is no other way to demonstrate an issue, such as a rendering problem. Clearly, a text error message can be posted as text rather than an image. (With that said, I probably would not have CV'd the OP's question, but would have asked them to add the error as text via comment.)
    – Ken White
    Commented Jun 18, 2023 at 2:26
  • 1
    @HashimAziz Check out close vote reasons. How is "Needs details or clarity" is not a request to improve an otherwise salvageable question? Commented Jun 19, 2023 at 8:10
  • @DmitryGrigoryev "Needs details or clarity" should be used for questions that are unsalvageable because they cannot be answered due to crucial missing information from the OP. If a question contains enough information that it can be answered, it's in almost all cases salvageable. Commented Jun 19, 2023 at 15:15
  • 1
    Two comments engaging in ad hominem attacks have been removed. You can discuss appropriate use of close votes without resorting to calling each other toxic.
    – Ryan M Mod
    Commented Jun 20, 2023 at 4:26

2 Answers 2

46

I'm gonna go out on a limb and say that closing a question as a duplicate of What is a debugger and how can it help me diagnose problems? is quite passive-agressive behavior that we don't want to see on the platform.

1,831 questions have had that treatment already. Edit: untrue, not every link is a duplicate vote.

It's the equivalent of "It looks like your question is a non-repro. Or maybe not. The bug might even be in the code that you show. But I'm not gonna tell you. I'm going to tell you that with enough effort you can figure it out for yourself. We I don't want this question here. Get lost."

I'd say: welcome to the C++ tag, you must be new here.

9
  • 2
    And before people start digging through my history to point out my hypocrisy: yes, I have closed plenty a C# question as a dupe of What is a NullReferenceException and how can I fix it?, but that is a very specific root cause and IIRC I always post a comment telling them which variable is (possibly) null. That question's most-upvoted answer needs a total rewrite anyway.
    – CodeCaster
    Commented Jun 15, 2023 at 8:26
  • 7
    The comments under the question by the gold badge owner who has closed the question are also passive-aggressive IMHO. Out of strike for this one, I've voted to reopen.
    – Tensibai
    Commented Jun 15, 2023 at 8:29
  • 1
    related: When should one duplicate a question to "What is a debugger and how can it help me diagnose problems?" I had an answer post there but deleted it to take some time to get more experience on the platform. I think some of the ideas I expressed there are wrong/flawed, even though my answer had positive score.
    – starball
    Commented Jun 16, 2023 at 1:33
  • 1
    And yet, nobody seems to object, on Meta, to the constant dupe-hammering of individual "I personally don't think my questions are bad enough to merit a q-ban" to the "What can I do when getting “We are no longer accepting questions/answers from this account”?" canonical (which never really tells them the specific thing they want to know, if they actually want to know something - a lot of the time they are really just complaining)... Commented Jun 16, 2023 at 6:42
  • @Karl not nobody: meta.stackoverflow.com/questions/336622/…
    – CodeCaster
    Commented Jun 16, 2023 at 7:17
  • It's all about how that question is asked that determines whether or not it's a duplicate.
    – Cody Gray Mod
    Commented Jun 16, 2023 at 15:38
  • 1
    @Cody I'd say if someone asks "What is a debugger and how can it help me diagnose problems?", it ought to be a perfect duplicate target.
    – CodeCaster
    Commented Jun 16, 2023 at 15:58
  • If the question is indeed asking how to use a debugger, it would be appropriate to link as a duplicate. This does not appear to be a good dupe candidate for that question. However, the question does not include a reproducible example, and indeed would appear to require a significant amount of debugging by someone with an environment able to reproduce. So it is not a good question for this site in that it is almost certainly unanswerable with the info provided.
    – theMayer
    Commented Jun 17, 2023 at 14:59
  • 4
    @theMayer then close as non-repro, and optionally post a comment explaining what's missing, additionally linking to said debugger question. One should not use their dupehammer as a super-closevote.
    – CodeCaster
    Commented Jun 17, 2023 at 15:13
7

While I don't think the question should have been closed for the reason it was, because it definitely demonstrates an understanding of how to use the debugger, possibly the frustration is with the question as asked:

How should I prevent such a crash?

because the answer is that you can't, since it's happening due to a bug in a library you don't control.

5
  • 11
    "because the answer is..." so...post that, if it's the answer. Sometimes you really do need to work around a bug in a library you don't control. Sometimes that means catching and doing your best to recover from crashes, if there's no way to prevent it when using the library. If that's not possible in this scenario, well, then that's a useful piece of information to have in our knowledge library.
    – Ryan M Mod
    Commented Jun 16, 2023 at 0:57
  • 2
    This is a segfault not an exception. It's extremely unreliable in general to install a signal handler for SIGSEGV which tries to continue or repair anything. C++ isn't memory-safe, and a segfault means something fully unsafe has already happened: (Why is a segmentation fault not recoverable?). In memory-safe languages like Java or C# where library code throws a NullPointerException or something, then yeah you can maybe catch that and try something else. Commented Jun 16, 2023 at 1:32
  • I guess maybe if you had a binary build of a library and had already reverse-engineered the bug to figure out when and how it crashed and what got messed up, you might then know what was safe to do in a SIGSEGV handler if you couldn't just modify the machine code in the binary library to fix the bug. In this case the library is open-source so fixing it is vastly better. Commented Jun 16, 2023 at 1:33
  • 14
    While I agree with Peter, those comments only serve to reinforce Ryan's point, which is that this should have been posted as the answer to the question. Getting frustrated with a question that is asked on a Q&A site because you know the answer makes little sense.
    – Cody Gray Mod
    Commented Jun 16, 2023 at 3:04
  • Now the question is closed as "needs debugging details" LMAO. And I thought I wielded my close-votes harshly...
    – Ian Kemp
    Commented Jun 16, 2023 at 12:10

You must log in to answer this question.

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