Hi, I am getting a large program running under the nvfortran
compiler, and I ran into a confusing crashing bug. Here is a minimum reproducible case:
program crash
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real(dp), allocatable :: arr(:)
!$omp parallel default(shared) private(arr)
allocate( arr(50) )
deallocate( arr )
!$omp end parallel
end program crash
When I compile this program with these arguments, it fails reliably:
nvfortran -mp -Mchkptr crash.f90 -o crash.x
./crash.x
0: Null pointer for arr (crash.f90: 6)
[repeated some number of times]
When I get rid of the -Mchkptr
argument, it runs fine.
What am I missing here? Is this a bug in nvfortran
, or a bug in my understanding of what is going on?