<div dir="ltr"><div>Hi:</div><div><br></div><div>I have a simple code myself to learn the basic usage of nest matrix. It assembles a 3x3 nest matrix and solve with that nest matrix. I can run it without a preconditioner. Running the code with -pc_type fieldsplit just leads to an error message. I have no clue of what goes wrong. The message is in below. I also have my code attached.<br></div><div><br></div><div>Thanks,</div><div><br></div><div>M<br></div><div><br></div><div>[0]PETSC ERROR: PetscTrFreeDefault() called from VecRestoreArray_Nest() line 678 in /home/lib/petsc-3.9.1-src/src/vec/vec/impls/nest/vecnest.c<br>[0]PETSC ERROR: Block at address 0x2784ec8 is corrupted; cannot free;<br>may be block not allocated with PetscMalloc()<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Memory corruption: <a href="http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind" target="_blank">http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind</a><br>[0]PETSC ERROR: Bad location or corrupted memory<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.9.1, Apr, 29, 2018 <br>[0]PETSC ERROR: ./matnest on a  named bacon by mike Tue Aug 14 10:03:56 2018<br>[0]PETSC ERROR: Configure options --with-x=0 -with-pic --with-make-np=12 --with-mpi-compilers=1 --with-mpi-dir=/home/lib/mpich-3.2/ --with-scalar-type=real --with-shared-libraries=1 --with-precision=double --with-chaco=1 --download-chaco --with-hypre=1 --download-hypre --with-plapack=1 --download-plapack --with-spai=1 --download-spai --with-sundials=1 --download-sundials --with-mumps=1 --download-mumps --with-scalapack=1 --download-scalapack --with-blacs=1 --download-blacs --with-spooles=1 --download-spooles --with-suitesparse=1 --download-suitesparse --with-superlu_dist=1 --download-superlu_dist --with-superlu=1 --download-superlu --with-zoltan=1 --download-zoltan=1 --with-debugging=yes --download-fblaslapack --with-ml=1 --download-ml --with-eigen=1 --download-eigen --prefix=~/lib/petsc-3.9.1-debug<br>[0]PETSC ERROR: #1 PetscTrFreeDefault() line 269 in /home/lib/petsc-3.9.1-src/src/sys/memory/mtr.c<br>[0]PETSC ERROR: #2 VecRestoreArray_Nest() line 678 in /home/lib/petsc-3.9.1-src/src/vec/vec/impls/nest/vecnest.c<br>[0]PETSC ERROR: #3 VecRestoreArrayRead() line 1835 in /home/lib/petsc-3.9.1-src/src/vec/vec/interface/rvector.c<br>[0]PETSC ERROR: #4 VecRestoreArrayPair() line 511 in /home/lib/petsc-3.9.1-src/include/petscvec.h<br>[0]PETSC ERROR: #5 VecScatterBegin_SSToSS() line 671 in /home/lib/petsc-3.9.1-src/src/vec/vscat/impls/vscat.c<br>[0]PETSC ERROR: #6 VecScatterBegin() line 1779 in /home/lib/petsc-3.9.1-src/src/vec/vscat/impls/vscat.c<br>[0]PETSC ERROR: #7 PCApply_FieldSplit() line 1040 in /home/lib/petsc-3.9.1-src/src/ksp/pc/impls/fieldsplit/fieldsplit.c<br>[0]PETSC ERROR: #8 PCApply() line 457 in /home/lib/petsc-3.9.1-src/src/ksp/pc/interface/precon.c<br>[0]PETSC ERROR: #9 KSP_PCApply() line 276 in /home/lib/petsc-3.9.1-src/include/petsc/private/kspimpl.h<br>[0]PETSC ERROR: #10 KSPInitialResidual() line 67 in /home/lib/petsc-3.9.1-src/src/ksp/ksp/interface/itres.c<br>[0]PETSC ERROR: #11 KSPSolve_GMRES() line 233 in /home/lib/petsc-3.9.1-src/src/ksp/ksp/impls/gmres/gmres.c<br>[0]PETSC ERROR: #12 KSPSolve() line 669 in /home/lib/petsc-3.9.1-src/src/ksp/ksp/interface/itfunc.c<br></div></div>