I have some unstable mistake in my program and out-of-idea how to catch it.
I am looking for advice with a way to work it out!
I have in a pretty complicated program (but one source file) set of int-counters - 15, if exactly.
Lately, on final printout I have inpossible value (I am processing 1000 records, but counter shows more than 900 millions number.)
The most strange point is that when I put some printf(..) around the changing the counter statements, another counter becomes unreal, but this one shows correct number.
The same actions (add printf()s) around next one have the same result: that one become correct, but another one changed to huge number.
Finally, if all counters are followed by the printf() statements - all counters are completely reasonable!!
(Acctually, if I removes all debug-printf()s, again, all counters are fine, ... but somewere the problem still exist!!)
Sure, the code compiled without problem and warnings.
I have check the code with 'lint' - everything fine (at least nothing reasonable!)
What would you advice to do to find the problem?
I am not comfortable to leave the code with such condition, but no idea how to catch it!
Please, help!
(no way to post the code here - more than 3K lines, many system(the business system in addition to OS) library, headers..., so, you will not be able to compile it)