On Saturday, 09 July, 2011 10:12 PM, David Pilling wrote:
So we did a test with printfs inserted, and the bug went away. Functionally the debug version is the same as the one that crashes, but it will have lots of side effects like calling OS routines.
This reminds me of a problem I once experienced, working in Fortran in a DEC PDP11 environment. The program was crashing, or corrupting data - I don't remember exactly, now.
However, we couldn't find the fault - a detailed walk through the code didn't reveal anything, if we added extra statements in an attempt to trace it, the fault went away. If we compiled and built with the system debugger enabled, the fault went away ... ultimately, this led us to the real cause - enabling the debugger disabled the compiler's code optimisation.
The fault was being introduced by a bug in the optimiser - examination of the generated machine code allowed us to identify the precise point of failure, which was not exactly where we expected to find it, because the optimiser had changed the sequence of the instructions.
-- ------------------------------------------------------------------- Peter Bell Mob: +63 (0) 9287 340 343 Tagum City, Philippines. Tel: +63 (0) 84 400 5085 email/msn: peter@xxxxxxxxxxxxxxxxx Tel: +44 (0) 118 331 0000 To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling