Can you try running with valgrind? 
https://petsc.org/release/faq/?highlight=valgrind#what-does-corrupt-argument-or-caught-signal-or-segv-or-segmentation-violation-or-bus-error-mean-can-i-use-valgrind-or-cuda-memcheck-to-debug-memory-corruption-issues
 
<https://petsc.org/release/faq/?highlight=valgrind#what-does-corrupt-argument-or-caught-signal-or-segv-or-segmentation-violation-or-bus-error-mean-can-i-use-valgrind-or-cuda-memcheck-to-debug-memory-corruption-issues>

  Barry


> On Oct 5, 2022, at 7:39 AM, ashish bhole <ashishbhol...@gmail.com> wrote:
> 
> Hi All,
> 
> I am writing a code in Fortran to solve a linear advection equation using 
> PETSc 3.18.0 (Vec and TS). It seems to work fine on my HP elitebook laptop 
> with Fedora 30 OS and GCC 9.3.1. It gives acceptable numerical solutions, but 
> throws the following error at the end, with as well as without parallel 
> computing. The same error also appears with the slightly older version I 
> tried: PETSc 3.14.0.
> 
> The error message gives a hint for error locations, but I am unable to figure 
> out what is wrong. I have attached a snippet for my TS usage lines. I spent 
> some time searching for similar error reports but it was not so fruitful. So 
> I am approaching the PETSc community for help understanding this error. 
> Thank you.
> 
> ------------------------------------
> [0]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_Seq() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/impls/seq/bvec2.c:753
> [0]PETSC ERROR: Block [id=2154(800)] at address 0x2309ac0 is corrupted 
> (probably write past end of array)
> [0]PETSC ERROR: Block allocated in VecCreate_Seq() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/impls/seq/bvec3.c:34
> [0]PETSC ERROR: --------------------- Error Message 
> --------------------------------------------------------------
> [0]PETSC ERROR: Memory corruption: https://petsc.org/release/faq/#valgrind 
> <https://petsc.org/release/faq/#valgrind>
> [0]PETSC ERROR: Corrupted memory
> [0]PETSC ERROR: See https://petsc.org/release/faq/ 
> <https://petsc.org/release/faq/> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.18.0, Sep 30, 2022 
> [0]PETSC ERROR: ./exe on a arch-linux-c-debug named ischia by abhole Wed Oct  
> 5 13:06:27 2022
> [0]PETSC ERROR: Configure options --with-cc=mpicc --with-cxx=mpicxx 
> --with-fc=mpif90 --download-fblaslapack --download-scalapack --download-mumps 
> --download-superlu --download-ptscotch 
> --with-metis-include=/user/abhole/home/lib/metis-5.1.0/include 
> --with-metis-lib=/user/abhole/home/lib/metis-5.1.0/lib/libmetis.a -lmetis 
> --with-parmetis-include=/user/abhole/home/lib/parmetis-4.0.3/include 
> --with-parmetis-lib=/user/abhole/home/lib/parmetis-4.0.3/lib/libparmetis.a 
> -lparmetis -lmetis 
> --with-hdf5-include=/user/abhole/home/lib/hdf5-1.8.18/include 
> --with-hdf5-lib=/user/abhole/home/lib/hdf5-1.8.18/lib64/libhdf5.a 
> --with-valgrind=1 --with-scalar-type=real --with-precision=double
> [0]PETSC ERROR: #1 PetscTrFreeDefault() at 
> /home/abhole/lib/petsc-3.18.0/src/sys/memory/mtr.c:305
> [0]PETSC ERROR: #2 VecDestroy_Seq() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/impls/seq/bvec2.c:753
> [0]PETSC ERROR: #3 VecDestroy() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/interface/vector.c:521
> [0]PETSC ERROR: #4 VecDestroyVecs_Default() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/interface/vector.c:977
> [0]PETSC ERROR: #5 VecDestroyVecs() at 
> /home/abhole/lib/petsc-3.18.0/src/vec/vec/interface/vector.c:606
> [0]PETSC ERROR: #6 TSRKTableauReset() at 
> /home/abhole/lib/petsc-3.18.0/src/ts/impls/explicit/rk/rk.c:1102
> [0]PETSC ERROR: #7 TSReset_RK() at 
> /home/abhole/lib/petsc-3.18.0/src/ts/impls/explicit/rk/rk.c:1109
> [0]PETSC ERROR: #8 TSReset() at 
> /home/abhole/lib/petsc-3.18.0/src/ts/interface/ts.c:2644
> [0]PETSC ERROR: #9 TSDestroy() at 
> /home/abhole/lib/petsc-3.18.0/src/ts/interface/ts.c:2706
> [0]PETSC ERROR: #10 main.F90:159
> ------------------------------------------
> 
> -- With Regards
> Ashish Bhole
> <petsc_ts.png>

Reply via email to