CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Debugging a segmentation fault?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 4, 2009, 01:19
Default Debugging a segmentation fault?
  #1
Senior Member
 
Steve Hansel
Join Date: Jun 2009
Location: Colorado, USA
Posts: 112
Rep Power: 8
hansel is on a distinguished road
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
hansel is offline   Reply With Quote

Old   July 6, 2009, 04:45
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
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
henrik is offline   Reply With Quote

Old   July 6, 2009, 13:07
Default
  #3
Senior Member
 
Steve Hansel
Join Date: Jun 2009
Location: Colorado, USA
Posts: 112
Rep Power: 8
hansel is on a distinguished road
Thanks for the reply. I actually found my problem, but I will keep this information for the next one that comes up.

Steve
hansel is offline   Reply With Quote

Old   July 31, 2010, 13:13
Default turbDyMFoam segmentation fault
  #4
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 7
aldo.iannetti is on a distinguished road
[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
aldo.iannetti is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation fault when starting paraFoam gaffu OpenFOAM Installation 16 November 18, 2011 20:05
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 3 June 10, 2011 09:30
segmentation fault usker CD-adapco 5 March 6, 2007 00:14
KIVA and Segmentation Fault Felix Main CFD Forum 2 January 18, 2006 02:24
Fluent parallel: segmentation fault? hp FLUENT 2 September 6, 2001 14:18


All times are GMT -4. The time now is 09:10.