# Segmentation Error

**URL:** <https://community.freefem.org/t/segmentation-error/1386>\
**Category:** General Discussion\
**Created:** [December 13, 2021, 4:13pm UTC](https://community.freefem.org/t/segmentation-error/1386 "2021-12-13T16:13:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevinurafni](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/sevinurafni/32/508_2.png) [@sevinurafni](https://community.freefem.org/u/sevinurafni)\
**Post date:** [December 13, 2021, 4:13pm UTC](https://community.freefem.org/t/segmentation-error/1386/1 "2021-12-13T16:13:11Z")

</div>

Hello,  
I came across a segmentation fault when trying to run membrane program in the documentation. I have compiled Freefem++ 4.6 on Xubuntu 20.04.  
Any ideas on how to solve this?  
Thank you.

```auto
real theta = 4.*pi/3.;
real a = 2.; //The length of the semimajor axis
real b = 1.; //The length of the semiminor axis
func z = x;

// Mesh
border Gamma1(t=0., theta){x=a*cos(t); y=b*sin(t);}
border Gamma2(t=theta, 2.*pi){x=a*cos(t); y=b*sin(t);}
mesh Th = buildmesh(Gamma1(100) + Gamma2(50));

// Fespace
fespace Vh(Th, P2); //P2 conforming triangular FEM
Vh phi, w, f=1;

// Solve
solve Laplace(phi, w)
	= int2d(Th)(
		dx(phi)*dx(w)
		+ dy(phi)*dy(w)
	)
	- int2d(Th)(
		f*w
	)
	+ on(Gamma1, phi=z);

// Plot
plot(phi, wait=true, ps="membrane2.eps"); //Plot phi
plot(Th, wait=true, ps="membraneTh2.eps"); //Plot Th

// Save mesh
savemesh(Th,"Th2.msh");

```

![segmentation_fault](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/e24a15226d0e164b11385fcea9b583bc3ea750d6.png)

---

<div class="post-metadata">

**Author:** ![julienG](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/julieng/32/222_2.png) [@julienG](https://community.freefem.org/u/julienG)\
**Post date:** [December 13, 2021, 5:03pm UTC](https://community.freefem.org/t/segmentation-error/1386/2 "2021-12-13T17:03:21Z")

</div>

Hi  
Add `fill=true` option to your plot.  
This is a bug with Ubuntu, probably related to openGL, I reported in this [thread](https://community.freefem.org/t/segmentation-fault-due-to-fill-false-option-in-plots/1348)

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [December 14, 2021, 4:00pm UTC](https://community.freefem.org/t/segmentation-error/1386/3 "2021-12-14T16:00:44Z")

</div>

I think, the graphic part (ffglut) trap, because the freefem++ end normal.  
I have try with the last version 4.10 not problem on my MacOS

1. test without graphic
2. reinstall FreeFEM may be.
