CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Debugging a segmentation fault? (http://www.cfd-online.com/Forums/openfoam-bugs/66058-debugging-segmentation-fault.html)

hansel July 4, 2009 01:19

Debugging a segmentation fault?
 
I'm having a problem with at segmentation fault in turbDyMFoam. I'm attempting a rotating mesh and something about moving that mesh is causing the fault, with no error or warning message. I would like to gather more information on the cause of the fault.

I can fire up GDB and get the name of the routines it was in, but that's not very useful. I have 2 questions:

1) Is there an option to turbDyMFoam to give more debugging information?

2) Is there an easy way to compile in debug mode. I have developed unix (solaris) code, but I only used makefiles. These huge trees with wmakes and cmakes are strange to me. Is there a master options list somewhere?

Thanks
Steve

henrik July 6, 2009 04:45

Dear Steve,

in $FOAM_SRC/../etc/cshrc you find

Code:

# WM_COMPILE_OPTION = Opt | Debug | Prof
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
#if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Debug
#setenv WM_COMPILE_OPTION Opt
setenv WM_COMPILE_OPTION Debug

Uncomment the last line. Resource. Make sure WM_COMPILE_OPTION is set correctly. Compile Everything. Compile your code.

This adds full debug information to your library and executables which you can use "gdb" OR "valgrind --tool=memcheck" on. I find the latter very useful for finding memory violations.

Here are also a few links that I found quickly after googling "openfoam debugging".

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2008/debugging.pdf
http://openfoamwiki.net/index.php/HowTo_debugging
http://powerlab.fsb.hr/ped/kturbo/Op...ngTraining.pdf

Good luck hunting

Henrik

hansel July 6, 2009 13:07

Thanks for the reply. I actually found my problem, but I will keep this information for the next one that comes up.

Steve

aldo.iannetti July 31, 2010 13:13

turbDyMFoam segmentation fault
 
[QUOTE=hansel;221636]Thanks for the reply. I actually found my problem, but I will keep this information for the next one that comes up.


Hi,
can you please explane me problems about turbDyMFoam you had? I Think I have the same problem. Can you please give me some advice in order to set up ggi in turbDyMFoam cases?
Thanks
Aldo


All times are GMT -4. The time now is 01:53.