<div dir="ltr">What does the message imply? That PETSc error handler is misbehaving? or that the user code is wrong? I don't understand. This is the latest release with a faulty code that I use as an example for using valgrind and gdb.<div><br></div><div>[0]PETSC ERROR: Memory corruption: <a href="https://petsc.org/release/faq/#valgrind">https://petsc.org/release/faq/#valgrind</a><br>[0]PETSC ERROR: Corrupted memory<br>[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.18.1, unknown <br>[0]PETSC ERROR: ./vecerror on a arch-ecrcml-double-debug named localhost.localdomain by szampini Fri Nov  4 12:01:33 2022<br>[0]PETSC ERROR: Configure options ...<br>[0]PETSC ERROR: #1 PetscTrFreeDefault() at /home/szampini/Devel/miniforge/Devel/petsc/src/sys/memory/mtr.c:305<br>[0]PETSC ERROR: #2 VecDestroy_Seq() at /home/szampini/Devel/miniforge/Devel/petsc/src/vec/vec/impls/seq/bvec2.c:753<br>[0]PETSC ERROR: #3 VecDestroy() at /home/szampini/Devel/miniforge/Devel/petsc/src/vec/vec/interface/vector.c:521<br>[0]PETSC ERROR: #4 main() at /home/szampini/Devel/petscexamples/debugging/vecerror.c:22<br>[0]PETSC ERROR: Reached the main program with an out-of-range error code 1. This should never happen<br><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Stefano</div></div></div>