[petsc-users] Bug in ex14f.F90 when debug flags are used?

Satish Balay balay at mcs.anl.gov
Fri Jun 5 16:11:54 CDT 2020


VecGetArray() is for F77 - it relies on  out-of-bound access.

The safer call is  VecGetArrayF90()

Now that PETSc requires F90  - perhaps VecGetArray() should be deprecated [and all examples fixed to use VecGetArrayF90]..

Satish

On Fri, 5 Jun 2020, Danyang Su wrote:

> Hi All,
> 
>  
> 
> I have a question regarding the following example. 
> 
> https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/tutorials/ex14f.F90.html
> 
>  
> 
>  
> 
> When debug flags are used in the make file, the code crashed with following error.
> 
>  
> 
> At line 335 of file ex14f.F90
> 
> Fortran runtime error: Index '-14450582413' of dimension 1 of array 'xx' below lower bound of 1
> 
>  
> 
> FFLAGS           = -g -fcheck=all -fbacktrace -Wall
> 
> CPPFLAGS         = -g -fcheck=all -fbacktrace -Wall
> 
>  
> 
> Does this make sense?
> 
>  
> 
> Danyang
> 
> 



More information about the petsc-users mailing list