Hello, (Probably nobody cares, but) it looks like -on_error_attach_debugger is neither “-malloc_dump"-clean nor valgrind-clean.
$ cd src/ksp/ksp/tutorials $ ~/petsc/arch-darwin-c-debug-real/bin/mpiexec -n 2 valgrind --leak-check=full --show-leak-kinds=all ./ex2 -on_error_attach_debugger Norm of error 0.000411674 iterations 7 ==2074== 24 bytes in 1 blocks are still reachable in loss record 1 of 1 ==2074== at 0x483E340: memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2074== by 0x4A80902: PetscMallocAlign (mal.c:49) ==2074== by 0x4A822E8: PetscMallocA (mal.c:422) ==2074== by 0x4AD2B45: PetscPushErrorHandler (err.c:161) ==2074== by 0x4B1D47B: PetscOptionsCheckInitial_Private (init.c:545) ==2074== by 0x4B25AE7: PetscInitialize (pinit.c:1019) ==2074== by 0x10B4FA: main (ex2.c:31) $ ~/petsc/arch-darwin-c-debug-real/bin/mpiexec -n 2 ./ex2 -on_error_attach_debugger -malloc_dump Norm of error 0.000411674 iterations 7 [ 0]32 bytes PetscPushErrorHandler() line 161 in /home/john/petsc/src/sys/error/err.c [ 1]32 bytes PetscPushErrorHandler() line 161 in /home/john/petsc/src/sys/error/err.c Thanks, Pierre