-
June 4th, 2009, 01:07 PM
#1
Is there any way to compare two runs of a program?
I have a program that's producing slightly different outputs on every run. I don't know why---it doesn't use randomization. It is multithreaded, but there's no sign of a bug there (no crashes or anything), and I have it set to only use 1 thread right now and it's still producing (slightly) varying outputs.
Is there any tool which can step through two runs of the program side-by-side using the same inputs, and stop when something different happens?
-
June 4th, 2009, 01:20 PM
#2
Re: Is there any way to compare two runs of a program?
I don't actually now. But VS 2010 Team System contains a historical debugger that records the execution path so that you can see what happens at any time. I don't know too many details yet. Maybe it's possible that you run your program on the beta 1.
-
June 4th, 2009, 01:48 PM
#3
Re: Is there any way to compare two runs of a program?
You could run two instances of the debugger and debug them at the same time.
You could also put TRACE statements in the code to record what it's doing and compare the outputs from the TRACE statements.
-
June 4th, 2009, 01:48 PM
#4
Re: Is there any way to compare two runs of a program?
Well obviously there's that. I was referring to something that wouldn't take forever.
-
June 4th, 2009, 02:30 PM
#5
Re: Is there any way to compare two runs of a program?
Sigh...found the problem.
Rule #1: Never assume you're only running one thread.
Rule #2: Never forget rule #1.
-
June 4th, 2009, 02:43 PM
#6
Re: Is there any way to compare two runs of a program?
Originally Posted by Lindley
Sigh...found the problem.
Rule #1: Never assume you're only running one thread.
Rule #2: Never forget rule #1.
I like to check the 'thread count' column of my process in Windows Task Manager to be sure
Old Unix programmers never die, they just mv to /dev/null
-
June 5th, 2009, 04:39 AM
#7
Re: Is there any way to compare two runs of a program?
What actually cause the problem ?
Thanks for your help.
-
June 5th, 2009, 08:46 AM
#8
Re: Is there any way to compare two runs of a program?
I had an array of parameters to my algorithm. Half my brain figured, "Hey, these are constant, I can share them between threads."
The other half said, "Hey, I'm passing this array all around the algorithm anyway, let's use it for some temporary storage!"
There was a lack of communication between the two.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|