Difference between revisions of "FAQ/Troubleshooting"

From OpenFOAMWiki
< FAQ
m (Forced a line break at the end)
(a few fixes and added section for cannot open script)
Line 8: Line 8:
 
=== An application ends with a ''segmentation fault''. What is wrong? ===
 
=== An application ends with a ''segmentation fault''. What is wrong? ===
  
A segmentation fault usually occurs when a program trys to access memory outside its bounds (see [http://en.wikipedia.org/wiki/Segmentation_Fault Segmentation Fault on Wikipedia]). In OpenFOAM this usually occurs when a <tt>List<></tt> or similar is accessed with an index outside of the allocated domain. To find out where this occurs make a separate copy of the OF-sources, recompile them with the swich <tt>WM_COMPILE_OPTION</tt> set to Debug (just uncomment the right lines in the bashrc/cshrc files). This makes OF run slower, but accesses to <tt>List<></tt> etc are checked for ranges and the program aborts if you access outside of a range (plus you get a stack trace). This won't solve your problem, but it will help you find out where it occurs.
+
A segmentation fault usually occurs when a program tries to access memory outside its bounds (see [http://en.wikipedia.org/wiki/Segmentation_Fault Segmentation Fault on Wikipedia]). In OpenFOAM this usually occurs when a <tt>List<></tt> or similar is accessed with an index outside of the allocated domain. To find out where this occurs see make a separate copy of the OF-sources, recompile them with the switch <tt>WM_COMPILE_OPTION</tt> set to Debug (just uncomment the right lines in the {{tt|bashrc/cshrc}} files). This makes OF run slower, but accesses to <tt>List<></tt> etc are checked for ranges and the program aborts if you access outside of a range (plus you get a stack trace). This won't solve your problem, but it will help you find out where it occurs.
  
See also [[HowTo_debugging|General debugging tips]]. For recompiling OpenFOAM look at [[Howto_compile_OpenFOAM]]
+
See also [[HowTo_debugging|General debugging tips]]. For recompiling OpenFOAM look at [[Installation]] (specially page [[Installation/Working_with_the_Shell]]) or the older page [[Howto_compile_OpenFOAM]].
  
 
=== My program stops with an output that starts with <tt>#0 Foam::error::printStack(Foam::Ostream&)</tt> ===
 
=== My program stops with an output that starts with <tt>#0 Foam::error::printStack(Foam::Ostream&)</tt> ===
  
You encountered a program error. Upon hitting that error OpenFOAM produced a stack trace (a list of the functions that were called) which is very useful to find the location at which the problem occured. It is possible to get that stack-trace with the source files and the line numbers of the functions which might help to find out what the problem is. To do so you have to [http://openfoamwiki.net/index.php/Howto_compile_OpenFOAM#Modifications_for_a_debug_version_of_OpenFOAM compile a debug version of OpenFOAM]. (see also the ''segmentation fault''-question above)
+
You encountered a program error. Upon hitting that error OpenFOAM produced a stack trace (a list of the functions that were called) which is very useful to find the location at which the problem occured. It is possible to get that stack-trace with the source files and the line numbers of the functions which might help to find out what the problem is. To do so you have to [[Howto_compile_OpenFOAM#Modifications_for_a_debug_version_of_OpenFOAM|compile a debug version of OpenFOAM]]. (see also the ''segmentation fault''-question above)
  
 
=== I'm unable to reproduce a crash. What's going on? ===
 
=== I'm unable to reproduce a crash. What's going on? ===
Line 21: Line 21:
 
* There could be some randomness introduced somewhere by a pseudo-random number generator. This is common in the particle/chemical type solvers in OpenFOAM.
 
* There could be some randomness introduced somewhere by a pseudo-random number generator. This is common in the particle/chemical type solvers in OpenFOAM.
 
* There could be a hardware problem. In this case, check this page: [[HowTo Check if RAM and CPU are OK|How to Check if RAM and CPU are OK]]
 
* There could be a hardware problem. In this case, check this page: [[HowTo Check if RAM and CPU are OK|How to Check if RAM and CPU are OK]]
 +
 +
=== Cannot open script file? ===
 +
; Symptom: The common error messages for this scenario are:
 +
<pre>./Allwmake: 7: .: Can't open /wmake/scripts/AllwmakeParseArguments
 +
./Allrun: 5: .: Can't open /bin/tools/RunFunctions
 +
</pre>
 +
 +
; Reason and solution: The OpenFOAM environment is not properly activated. For more details, read [[Installation/Working_with_the_Shell]].
  
 
<br/>
 
<br/>

Revision as of 01:11, 27 December 2016


1 FAQ Section 8: Troubleshooting

Figuring out what went wrong

1.1 An application ends with a segmentation fault. What is wrong?

A segmentation fault usually occurs when a program tries to access memory outside its bounds (see Segmentation Fault on Wikipedia). In OpenFOAM this usually occurs when a List<> or similar is accessed with an index outside of the allocated domain. To find out where this occurs see make a separate copy of the OF-sources, recompile them with the switch WM_COMPILE_OPTION set to Debug (just uncomment the right lines in the bashrc/cshrc files). This makes OF run slower, but accesses to List<> etc are checked for ranges and the program aborts if you access outside of a range (plus you get a stack trace). This won't solve your problem, but it will help you find out where it occurs.

See also General debugging tips. For recompiling OpenFOAM look at Installation (specially page Installation/Working_with_the_Shell) or the older page Howto_compile_OpenFOAM.

1.2 My program stops with an output that starts with #0 Foam::error::printStack(Foam::Ostream&)

You encountered a program error. Upon hitting that error OpenFOAM produced a stack trace (a list of the functions that were called) which is very useful to find the location at which the problem occured. It is possible to get that stack-trace with the source files and the line numbers of the functions which might help to find out what the problem is. To do so you have to compile a debug version of OpenFOAM. (see also the segmentation fault-question above)

1.3 I'm unable to reproduce a crash. What's going on?

If you run the same exact simulation twice or more times, but there is an occasional crash in different places, then there are a few possibilities:

  • There could be a numerical instability in the calculations. This could be due to the compiler options used (such as --fast-math).
  • There could be some randomness introduced somewhere by a pseudo-random number generator. This is common in the particle/chemical type solvers in OpenFOAM.
  • There could be a hardware problem. In this case, check this page: How to Check if RAM and CPU are OK

1.4 Cannot open script file?

Symptom
The common error messages for this scenario are:
./Allwmake: 7: .: Can't open /wmake/scripts/AllwmakeParseArguments
./Allrun: 5: .: Can't open /bin/tools/RunFunctions
Reason and solution
The OpenFOAM environment is not properly activated. For more details, read Installation/Working_with_the_Shell.


Facts about "FAQ/Troubleshooting"RDF feed
FaqdescriptionFiguring out what went wrong +
FaqnameTroubleshooting +
Faqnumber8 +