# Segmentation fault in ffddm

**URL:** <https://community.freefem.org/t/segmentation-fault-in-ffddm/988>\
**Category:** General Discussion\
**Created:** [May 20, 2021, 3:52pm UTC](https://community.freefem.org/t/segmentation-fault-in-ffddm/988 "2021-05-20T15:52:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LazarosP](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@LazarosP](https://community.freefem.org/u/LazarosP)\
**Post date:** [May 20, 2021, 3:52pm UTC](https://community.freefem.org/t/segmentation-fault-in-ffddm/988/1 "2021-05-20T15:52:26Z")

</div>

Hi,

I have been trying to run a minimal example with mesh decomposition using ffddmbuildDmesh, but I run into a segmentation fault:

Minimal example code (test.edp):

```
load "msh3"
macro dimension 3// EOM
include "ffddm.idp"
mesh3 ThGlobal("inputmesh.mesh");
ffddmbuildDmesh(Lap, ThGlobal, mpiCommWorld)

```

I run the script using:  
`ff-mpirun -np 4 test.edp`

Error log:

```
  [Lap] Building decomposition from mesh of 549080 elements

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 242 RUNNING AT 96ad2211bf64
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

```

I’m currently using FreeFem v4.9 and I have encountered no error with `ffddmbuildDmesh` when running other example scripts (like [https://github.com/FreeFem/FreeFem-sources/blob/master/examples/ffddm/diffusion-3d-minimal-direct.edp](https://github.com/FreeFem/FreeFem-sources/blob/master/examples/ffddm/diffusion-3d-minimal-direct.edp)).

In the past I have successfully used this mesh (inputmesh.mesh) to solve equations in parallel using pARMS in FreeFem v3.6.  
I was wondering if `ffddmbuildDmesh` doesn’t work with arbitrary meshes or if there is another issue with my mesh/code/FreeFem installation?

If anyone is willing to test things out on his side, the script (test.edp) and the mesh (inputmesh.mesh) are available [here](https://filesender.renater.fr/?s=download&token=8dfc9942-eefa-45cc-afbc-52c30db7a43d).

Thanks a lot in advance,  
Kind regards,  
Lazaros

---

<div class="post-metadata">

**Author:** ![phtournier](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@phtournier](https://community.freefem.org/u/phtournier)\
**Post date:** [May 22, 2021, 5:41pm UTC](https://community.freefem.org/t/segmentation-fault-in-ffddm/988/2 "2021-05-22T17:41:13Z")

</div>

Hello,

it appears that the following example also produces a segmentation fault, which would suggest that your mesh is defective in some way:

```auto
mesh3 ThGlobal("inputmesh.mesh");
fespace Uh(ThGlobal,P1);
Uh u = x;
plot(u);

```

I tried to clean/fix your mesh and understand where the problem lies, but with no success so far.

---

<div class="post-metadata">

**Author:** ![LazarosP](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@LazarosP](https://community.freefem.org/u/LazarosP)\
**Post date:** [June 2, 2021, 4:48pm UTC](https://community.freefem.org/t/segmentation-fault-in-ffddm/988/3 "2021-06-02T16:48:06Z")

</div>

Thank you for taking the time to investigate this! Indeed, one of the keywords in the .mesh file was incorrect (`Triangle` instead of `Triangles`). Thanks for your help!
