2

I have a C++ binary (GNU LilyPond) that is occasionally generating different output for the same input. valgrinding the binary is not helping to track down where this fuzz occurs, nor is reading over gprof data. What would be very useful is a profiling tool that compares multiple runs of the same program on the same input and identifies divergence in arguments and return values of functions (and perhaps even the number of times a function is called and/or which functions are called when). A sort of intelligent "diff" file between multiple program runs. The debug data is too voluminous to spot this by hand, so some type of synthetic tool would be very helpful. Does anyone know a tool that can get this sort of task done?

  • The way I do that is first make sure I can reproduce the regression, hopefully on simpler input. Then I run both software versions under the debugger at the same time, and step along in parallel, comparing state, until I can see a difference. I might have to restart the process a few times before I pinpoint the difference. It's not easy, but we're not wimps. – Mike Dunlavey Sep 14 '12 at 14:26

1 Answers1

0

The closest thing I know of would be a code coverage-like tool, but I haven't used one recently enough to make suggestions.

However we may be able to take some guesses. The most likely candidates are undefined behavior, uninitialized memory, and possibly floating point math.

If you enable as many warnings as possible you may detect some forms of UB that sneaked through before if that happens to be the cause.

Otherwise I think you're going to be stuck at a point where you have to dump the program's state at various points and compare each checkpoint to see where the divergence occurs.

Mark B
  • 95,107
  • 10
  • 109
  • 188