Level set "distance" / Assertion fail

Dear developpers.

I am encountering a bug when I try to apply the function “distance” to a level set function on a 3D mesh:

load "medit";
load "distance";

real tclock;//For measuring time

mesh3 Th=readmesh3("Th.meshb");
fespace Fh1(Th,P1);
Fh1 phi;

Fh1 dOmega;
distance(Th, phi, dOmega[]);

which results, on my mesh and solution file as the following error:

  current line = 14
Assertion fail : (Norme2(AGG - AG) < 1e-6)
	line :189, in file distance.cpp
Assertion fail : (Norme2(AGG - AG) < 1e-6)
	line :189, in file distance.cpp
 err code 6 ,  mpirank 0

I attach the problematic example in PJ. Many thanks in advance for your help.

test.zip (2.2 MB)

Je vais regarder , Merci.

I am currently encountering the same problem trying to apply the distance function to a level-set. Is there something to do to avoid this bug?
I temporarily solved the problem by precising the parameter meshdist, but now I run my scripts on really thin meshes and the issue reappeared. Do you have any idea how to solve this?
Thanks in advance.

I have to debug the distance code function, I think this is due to very bad mesh, but I am not sure.