4

I asked a question today (a program that I am responsible for maintaining used to work on all computers but now generates errors on all computers). I know it's low on detail, but I provided all the information I currently have, and I've been updating it as I find out more - from the feedback from SO users.

I'm trying to find out the root cause so I can fix it. When I do find the root cause, I mightn't know instantly how to fix it. At the moment I'm totally stuck. Some part of my code base (i.e. it could be any line) is calling .NET, and .NET generates an error (it could be anywhere in .NET since the error message is nonspecific).

My problem now is how to communicate the issue in a way that is answerable. How do you provide enough information from a Windows error message (it's .NET that has the error so it's very divorced from my code, and it mightn't even be a bug in my code) so that people can write an answer?

2
  • 9
    It's very difficult. Stack Overflow is not a crowd-sourced debugging engine. You really do need to have all the required information presented as part of the question, preferably as a minimal, reproducible example. At a minimum, you're going to need to provide a complete stack trace, along with a detailed description of your setup/environment, and even that might not be enough. Feb 13, 2020 at 3:07
  • 2
    Debugging is often really hard work. To be effective when facing a system bug, an engineer needs access to the documentation, project history, (eg log books/diaries), all source, build environment, test environment, debugger, logger, peripherals, network, libraries, hardware....everything. Debugging cannot be usefully performed by exchanging text on a Q&A site, (except for trivial examples). Feb 13, 2020 at 5:09

1 Answer 1

8

As said in the comments, we cannot remote-debug your application for you. I've looked at the question you're referring to, and all you have as information is more or less "it works when compiled in compiler version X but produces an error when compiled with version Y". Well, since it's a large popular compiler, let's rule out that something's fundamentally broken in compiler version Y. Select isn't broken. It's something specifically about your code interacting with that compiler. So asking a generic broad question about the compiler doesn't help, and we cannot find the problem for you without seeing all of your code. Which is obviously too broad for Stack Overflow.

So what you need to do is dig in. Do A/B testing with both compiler versions to see if that's indeed the issue. Is the problem really reproducible if the only thing you do is switch between compiler X and Y? If yes, you could start reading the changelog/release notes of the compiler to see if there are any backward-incompatibility notices which may apply to you. If not, if the compiler doesn't seem to make a difference, then you've disproven one factor and may in fact be looking at other factors, like code which has also changed between your two compiled versions. In that case you could go down a route like git bisect to narrow down what exactly introduced the bug.

Of course, there are still many other things you could do, like adding a whole bunch of log statements to your code to narrow down what exactly fails where, hooking into the process with a debugger to execute everything step by step, add some tracing tools to your code and so on and so forth.

If you have a detailed question with any of those steps or tools, those are questions we can answer here. We can help you successfully complete concrete steps which enable you to track down the bug, but we cannot find the bug for you. If you've eventually tracked it down to one specific piece of code with one specific compiler version which demonstrably raises an error and you just don't know how to fix that, we can also help with that then. But the way there you need to find first.

5
  • Same source code to the byte (unless Git is lying), same compiler. What's changed since 2016? Software patches or the original developers deliberately put in code to break after 2020. However, I'm not trying to fix the problem here, I'm trying to massage my question into an answerable form by finding clues that other people can recognise.
    – CJ Dennis
    Feb 13, 2020 at 12:18
  • 2
    The issue is that someone has put in code somewhere to deliberately break after 2020?! Is that really what caused your issue and you have proof for that? Either way though, that would still be something that could be narrowed down. Change your clock to before 2020 and run it, and do the same again after 2020. That's not something anyone could just guess at, no matter how many clues you drop.
    – deceze Mod
    Feb 13, 2020 at 12:23
  • i'm just Sherlock Holmesing it. I've checked out the old code and I trust that it is indeed identical to what was compiled in 2016. I'm using the version of Visual Studio that was used back then (2015), although it could have received patches since then. If patches don't explain the difference, then what? Weird year dependent code? The more likely options would seem to be eliminated. Or are you saying that Visual Studio 2015 in 2016 is X and Visual Studio 2015 in 2020 is Y?
    – CJ Dennis
    Feb 13, 2020 at 12:35
  • 2
    I don't know anymore what's what in your case, but the details are pretty irrelevant. The crash is caused by something. If you did have an A/B test of any sort where one fails and one doesn't, you could use that to narrow down what's causing the issue by narrowing down the difference. If you don't have an A/B test and all you have is the issue itself, then you can't use that to narrow down the issue and have to use other debugging techniques then. My answer above still stands as is.
    – deceze Mod
    Feb 13, 2020 at 12:39
  • 4
    @CJDennis Most cases I found where programs broke with new compiler versions was when the program itself was faulty to begin with (like memory overwrites etc.) but the issue was hidden until the new compiler did arrange the memory layout slightly different. So I agree that the best bet is that your code is at fault.
    – piet.t
    Feb 13, 2020 at 13:30

You must log in to answer this question.

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