segfault in vasp 5.2 due to uninitialized pointer
Posted: Wed Feb 02, 2011 5:04 am
Dear vasp developers:
I have encountered a segfault in vasp 5.2 which could be traced to an uninitialized pointer in chi.F
The segfault appears because of the reliance on the associated subroutine to return false when called on a pointer that has never been associated.
Here is a quote that I think sets things straight:
"Many people think that the status of a pointer which has never been associated is .not. associated. This is false.", and more detail here:
http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html
Thus, the line
TYPE (one_center_handle), POINTER :: H
in chi.F should be replaced with
TYPE (one_center_handle), POINTER :: H=>NULL()
because checks ASSOCIATED(H) are called later on on H in chi_base.F, expecting it to return false, which is not guaranteed in the current version.
Thank you.
Alex Kutana
I have encountered a segfault in vasp 5.2 which could be traced to an uninitialized pointer in chi.F
The segfault appears because of the reliance on the associated subroutine to return false when called on a pointer that has never been associated.
Here is a quote that I think sets things straight:
"Many people think that the status of a pointer which has never been associated is .not. associated. This is false.", and more detail here:
http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html
Thus, the line
TYPE (one_center_handle), POINTER :: H
in chi.F should be replaced with
TYPE (one_center_handle), POINTER :: H=>NULL()
because checks ASSOCIATED(H) are called later on on H in chi_base.F, expecting it to return false, which is not guaranteed in the current version.
Thank you.
Alex Kutana