Software Archive
Read-only legacy content
17061 Discussions

An error that keeps moving

Intel_C_Intel
Employee
621 Views
Hate to be so unspecific, but does anybody have an approach to resolving a situation where...
(1) the errors are different for release and debug modes
(2) the debug screen shows values in a watch window and "undefined address" in the locals window for the same variable
(3) re-arranging a couple of statements that should make no difference to anything, will cause an access violation to move to a totally different section of the program
(4) I'm getting boundary errors in debug when stepping through lines and seeing a subscript clearly within bounds
(5) increasing the stack size doesn't help

I would like to send a simple example, but as soon as I isolate an error to one particular line and extract the necessary surrounding code, the example works fine. (The full exe comes from around 10,000 lines of c and fortran).
Everything's aligned on 8 byte boundaries and I'm using the c debug libraries.

There are obviously some big points I'm missing somewhere. Any ideas?(The thing runs fine under an old Wtacom compiler so it's not a syntactical problem).
0 Kudos
2 Replies
Intel_C_Intel
Employee
621 Views
...adding to the above...inspecting a disassembly shows that an array that is being used by two routines a couple of lines apart is being is being passed with different addresses. How can this be possible? The array is static with a fixed size declared in the main line and in both routines.
0 Kudos
Steven_L_Intel1
Employee
621 Views
I'd guess a stack corruption. You say that it is mixed Fortran and C. Do you know that Visual Fortran and Visual C have different default calling mechanisms? If you have a mismatch, this can corrupt the stack.

If you can't figure it out, we'll be glad to look at it - just send a ZIP archive of the project and instructions for reproducing the problem, to us at vf-support@compaq.com

Steve
0 Kudos
Reply