1

I'm trying to debug a particularly nasty state-based issue that has no known repro, and has only been seen in the wild on other people's machines. The issue is very specific and hard to detect (basically a 3D physics engine breaks at a random time, but doesn't actually harm program stability)

I would like to be able to take a full memory snapshot of the application at the users discretion, like a crashdump but with as much of the program's state as possible. But I'm not sure if such a thing is even possible in a release build for a C++ program. (And even if it was, a lot of data will be obfuscated...)

Is there a way to generate a full memory dump? What other alternatives do I have?

Platform details: Windows and Linux, Microsofts default compiler for VS2013

Empty
  • 506
  • 3
  • 12
  • 1
    This is going to be very platform-specific. What platform does your program run on? – BoBTFish Feb 18 '19 at 08:52
  • 1
    To begin with please specify compiler and target platform, as that can play a crucial part. – Some programmer dude Feb 18 '19 at 08:52
  • 2
    On Linux (and varyingly on other Unix flavours) tools such as [`gstack` (a.k.a. `pstack`)](https://linux.die.net/man/1/gstack) and [`gcore`](http://man7.org/linux/man-pages/man1/gcore.1.html) may be useful to you. – BoBTFish Feb 18 '19 at 08:55
  • Generation of memory dump won't be any different compared to debug build. – user7860670 Feb 18 '19 at 09:08
  • No need to add such a feature to your program. Not a great idea either, considering that you know that the process state is kinda corrupted. On Windows it is simply done with Task Manager, Processes tab. Right-click > Create dump file. – Hans Passant Feb 18 '19 at 09:23
  • Possible duplicate of [How do I take a good crash dump for .NET?](https://stackoverflow.com/questions/24874027/how-do-i-take-a-good-crash-dump-for-net) – Thomas Weller Apr 07 '19 at 17:46

0 Answers0