Reputation: 3
I am currently writing an eigenvalue algorithm in Fortran. I am just trying to get some insight on the cause of the issue I was having. I traced the issue but I want to know how the problems are related.
Specifically, I was making a series of calls to LAPACK as follows
call DGEMV('T', ROWS, COLUMNS, 1.0_dp, updates(j,k), LEADING_DIM, v, 1, 0.0_dp, w, 1)
call DGER(ROWS, COLUMNS, -2.0_dp, v, 1, w, 1, updates(j,k), LEADING_DIM)
The problem was that my indices j and k for which to begin the submatrix operation were incorrect. After the above code executed, there was no error-even with bounds checking turned on. However, a completely unrelated variable that was properly passed as 'intent(in)' was changed instead. After correcting the indices the problem no longer occurred.
Upvotes: 0
Views: 58
Reputation: 60058
When you access arrays out of bounds anything can occur. You write to some unknown part of memory, which can trigger other random errors.
The program is not standard conforming and its behaviour is undefined. You can't expect anything.
Upvotes: 1