[PATCH] ElmerGUI crash when loading/remeshing

Clearly defined bug reports and their fixes
jmankiewicz
Posts: 3
Joined: 06 Mar 2012, 16:35
Antispam: Yes

[PATCH] ElmerGUI crash when loading/remeshing

Post by jmankiewicz »

URL to bugtracker-ticket: ID: 3497597

I work on a Linux (OpenSuse 12.1) x64_86 System with revision 5605 compiled from source. While working on large meshes I experienced segmentation faults when loading a big file. The same happened when remeshing an object in higher resolution. After further investigation I could narrow the problem down to invalid pointer-iterations in the meshutils.cpp . To solve this problem and harden the code a little against wild pointers I added some additional conditions to prevent iteration over non-existent objects.
But this ist far from a secure and final solution. Currently I have no idea if elmer behaves like this in all environments, but pointers have to be guarded closely anyway.
The code dearly needs to be refactored to use save containers (vectors, boost arrays or boost maps) in the future. We need a much more robust and error-tolerant mesh-handling-structure.


Regards

Jörn

EDIT: I modified the patch to circumvent another problem when loading a .unv file made by Salome.
Attachments
pointer_meshhandling_rev5605_2.patch
Revisioned patch.
(3.3 KiB) Downloaded 467 times
vince90
Posts: 9
Joined: 06 May 2013, 15:14
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by vince90 »

Hello Jörn,

I'm sorry to ask you about a year after you make that patch but what is the file that I need to patch?

Because I'm trying to import big meshes too and I have the "segmentation fault" problem.

Vincent
raback
Site Admin
Posts: 4825
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by raback »

Hi Vincent

The most robust way to treat .unv is to say

Code: Select all

ElmerGrid 8 2 mesh.unv
and then use the mesh directory as is in ElmerSolver or open it in ElmerGUI with "load mesh".

Do the problems persist in this way?

-Peter
vince90
Posts: 9
Joined: 06 May 2013, 15:14
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by vince90 »

Hello Peter,

Actually my problem is with loading a mesh coming from gmsh not a unv-file but a msh-file.

I tried of course the

Code: Select all

ElmerGrid 14 2 "my_mesh".msh
but when I'm loading the folder with ElmerGUI I have the 'segmentation fault' message

I thought that the patch would work but I don't know how and what to patch..

Vincent
jmankiewicz
Posts: 3
Joined: 06 Mar 2012, 16:35
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by jmankiewicz »

Hi Vincent,

the patch has to be applied against the files meshtype.cpp and meshutils.cpp in /trunk/ElmerGUI/Application/src/. Running the patch in the /trunk/ElmerGUI/Application/ should automatically find the needed files. But beware, that this patch is against an older version of the Elmer-trunk. You might have to manually apply some of the changes, when the code has changed to much for the auto-patcher to determine the right spots.

Regards,

Jörn
vince90
Posts: 9
Joined: 06 May 2013, 15:14
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by vince90 »

Thank you Peter!

I will try to use the patch. :)

Regards

Vincent
vince90
Posts: 9
Joined: 06 May 2013, 15:14
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by vince90 »

Hi,

I'm sorry to ask a question like that but I can't find the trunk directory for Elmer..

I have installed Elmer using the "apt-get install Elmer" form so I don't have any clue where the Elmer files are.

I searched with the Synaptic Package Manager where those files would be but I found nothing.

I am again sorry but I'm just a starter on linux and Elmer :oops:

Vincent
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by mzenker »

Hi,

I don't use Elmer under Linux (have to use Windoze at work :( ), but I would guess that there might be a separate package for the Elmer source. You can also try using find (see man find) from the Linux command line to search for the Elmer sources.

HTH,

Matthias
vince90
Posts: 9
Joined: 06 May 2013, 15:14
Antispam: Yes

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by vince90 »

Hi Matthias,

Desperation as its finest!
I already searched the sources files with the find command..and there's nothing.
I don't know what to do to apply this patch now..


Vincent
raback
Site Admin
Posts: 4825
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: [PATCH] ElmerGUI crash when loading/remeshing

Post by raback »

Elmer source code is available at:
http://sourceforge.net/p/elmerfem/code/HEAD/tree/
Post Reply