Quote:
Quote:
With about 7 MB in code this might be a difficult one to find...
I think that what I mentioned before, Windows Error Reporting, would be useful, but it is likely too cost-prohibitive for you (Verisign Class 3 digital ID or DigiCert certificate required). A brief check for an alternative turned up Google Breakpad:
http://code.google.com/p/google-breakpad/
No use. Nothing crashes. No exception. No error. Just a calculation that has INFINITE as a result, which - when you continue to calculate with it - causes all values to become NAN (Not A Number). However this is perfectly fine for the processor, it's a just a specific bit mask in the register. So, no way to detect it, unfortunatey.
I did find the cause this morning. In case anyone is interested:
- I had 4 values which could be positive or negative. Say a, b, c and d.
- I was clipping these values between +v and -v. So, a_clipped = max(min(a, v), -v).
- Then I would calculate (divide a_clipped + b_clipped + c_clipped + d_clipped) / (a + b + c + d).
Now, the chance that a+b+c+d is zero (each of these values is the sum of audio, FM pilot and RDS signal) is very very small. But with 48000 calculations per second (about 173 million per hour), it went wrong every few hours. Oddly not on all systems - I haven't been able to reproduce it on my Haswell i7. Also, when I disabled some compiler optimizations, I was also unable to reproduce it. And most strangely, it also didn't happen with the old compiler - this code has not been changed in over a year.