[petsc-users] DMPlexRestoreCellCoordinates failing with optimized PETSc mode

Daniele Prada daniele.prada85 at gmail.com
Mon Jun 8 11:30:05 CDT 2026


Hello everyone,

I am having the following message:

[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access out of range

when using DMPlexRestoreCellCoordinates() with PETSc built in optimized
mode, whereas the same function is not giving any trouble with PETSc built
in debug mode. By looking into the
implementation of DMPlexRestoreCellCoordinates(), it seems the issue comes
from DMPlexVecGetOrientedClosure().

The debug mode has been built with:

./configure PETSC_ARCH=arch-linux-c-debug --download-fblaslapack
--download-mpich --with-64-bit-integers --with-strict-petscerrorcode

whereas the optimized one with:

./configure PETSC_ARCH=arch-linux-c-opt --with-debugging=0 COPTFLAGS="-O3
-march=native -mtune=native" CXXOPTFLAGS="-O3 -march=native -mtune=native"
FOPTFLAGS="-O3 -march=native -mtune=native" --download-fblaslapack
--download-mpich

Other info:
- I am working with an Intel Xeon laptop
- uname -a: Linux daniele-Precision-7560 6.17.0-35-generic
#35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 19:30:42 UTC 2 x86_64
x86_64 x86_64 GNU/Linux
- PETSc version: the most recent one
- Compiler: gcc 13.3

Attached, please find:
- ex03.c: a selection of the relevant lines of the main program that are
causing the issue. Note: DMPlexCreateFromOVMFile() is a function I wrote to
create a fully interpolated (and symmetric) DMPlex from a .ovm file
- torus_from_CVT2d_Npol_000624.ovm: the .ovm file containing a 3D mesh.

Thank you in advance for your assistance
Best regards

Daniele Prada
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260608/ead12975/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex03.c
Type: text/x-csrc
Size: 2031 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260608/ead12975/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: torus_from_CVT2d_Npol_000624.ovm
Type: application/octet-stream
Size: 157107 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260608/ead12975/attachment-0001.obj>


More information about the petsc-users mailing list