Malloc() error on Ubuntu

Hello,
I’m using FreeFem on Ubuntu 20.04 and I have a strange issue.
I simply want to glue two meshes with the command “Th = Th1 + Th2”.
It returns the error
“malloc(): invalid size (unsorted)
Abandon (core dumped)”
I don’t understand why. The very same code runs properly on my Windows machine, so I guess it’s an Ubuntu issue…
Can anyone help me?!
Thanks a lot.
Lily

Hello Lily,
Could you please share your code?
Thanks.

Hello prj,

I have extracted the simplest code :
load “msh3”

mesh3 Th, Th1, Th2;

Th1 = readmesh3(“mesh1.mesh”);
Th2 = readmesh3(“mesh2.mesh”);

Th = Th1 + Th2;
savemesh(Th,“finalmesh.mesh”);

The meshes “mesh1.mesh” and “mesh2.mesh” were created with GMSH, then remeshed with MMG3D. They have respectively 30246 and 33342 tetrahedral elements.
Even with the simplest code above, I get the malloc error on Ubuntu and not on Windows. Otherwise, all my code run correctly on Ubuntu.

Thank you.

We need those meshes. Are they conforming?

Yes, they are conforming.

Upload them somewhere so we can reproduce the error, please.

What is your FreeFEM version?

I’m using FreeFem++ 4.1

Please update to the latest version, 4.7-1, there is no error there.

Ok, I will. Is there a way to have both versions on the same machine, or do I have to uninstall the version 4.1 and then install the version 4.7-1?

If you compile FreeFEM from sources, you can have two installations. Otherwise, I’m not sure.

There is no error with the version 4.7-1.
Thank you!