0

I have a program consisting of ~30k lines of code. It's made up of a few different .dll files in that 30k. It's all my code, but some of it's old and not all my documentation is top-notch.

After a recent change, there is a very rare crash that occurs. In the limited time I have available, I'm unable to recreate the crash. But then, I'll come back to my PC having forgotten about the crash and I'll run the program to see where I was at, take an action, and then it'll crash. As I wasn't running it through GDB, I have no idea what happened.

It's a 64bit app compiled with MingW64 on windows. Because of this, the only available JIT debugger that I know of is Dr Memory, which doesn't work for 64bit.

I'm sure the crash is memory related (aren't they always), so I was wondering, is it possible to manipulate memory to make the crash more likely?

For example, if I was writing past the end of an array or something, can I whack in some new calls somewhere to make it more likely that the write will cause a crash?

It's very rare that this crashes; I've only seen it happen twice, both times when I wasn't debugging.

NeomerArcana
  • 1,978
  • 3
  • 23
  • 50
  • Start your application using procdump and if the application crashes then procdump can produce a crash dump of the application, you can then load the dump and see where the program crashed. https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx – Jonathan May 10 '16 at 11:12
  • For this kind of rare crash, configure your system to dump the crashing application as explained [here](http://stackoverflow.com/a/20238046/1475411) and then use any dump analys tools such as [DUMPBIN](https://msdn.microsoft.com/en-us/library/c1h23y6c.aspx) – MNS May 10 '16 at 11:29

1 Answers1

0

I suggest writing some output messages to terminal at critical lines so you can track at which line the crash occurs. It's way simpler than messing with memory and possibly causing a crash with different source. Also use try and catch blocks and write out error reports.

Anže
  • 181
  • 8