Re: unexplainable behaviour - f90 - looking for some tools to help diagnose



oyaron wrote:
Hi Everyone.

Sorry for the very general subject but that's exactly my problem now -
not being able to pin point on anything specific.
I have a very large piece of code in f90 that includes many
subroutines and some modules - basically a numerical scheme to solve a
set of ODEs, etc...

During my last set of updates, something was probably ruined and I'm
now in a situation in which the behaviour of the run can change
completely (including getting stuck) even when adding a very simple
debug printing (WRITE statement) or certain simple assignments or
simple DO loops - even statements that have nothing to do with the
surrounding code (meaning nothing that should affect the run).

My latest updates did include use of new arrays, a change of arguments
between subroutines etc...

My questions are:

1. Did anyone encounter such frustrating situations, and if so, are
there any suggestions.
2. Which tools can I use to try starting diagnose the situation? would
using a debugger help? maybe running a source check, e.g. like ftnchek
- but that's only for f77 (is there anything good for f90?)

Thanks in advance, Ofer.


Yes, using a debugger can help. But you should compile again your code with -g option and depending on the previous option used your code can run (but the bug still exist) because of different layout of the datas in memory. I'm stuck at this time with a code giving "memory fault" when compiled with -IPO on intel fortran. Adding a write statement or an option for checking the arrays boundaries hide the problem... very difficult to understand!

Add -g option to the compiler and the linker, launch your code with debugger. If it fails (memory fault, segmentation fault) use the where command of the debugger (or something similar) to see where you are in the code.... If it loops infinitly, use [ctrl][c] to break the loop and use the where command again...

I'm using CVS to store successive versions of my codes, but even if I can see exactly what has changed I do not undestand why I have a memory fault! But working with CVS (or similar solutions) is a good pratice. See also tkcvs for a graphic front end to cvs.


Good luck

Patrick
.



Relevant Pages

  • Re: AWS issue
    ... Debugger for ada is not installed, so I can run the debugger, but the only answer I get is exit code 01. ... So I compile a single file with this function and link with all that stuff. ... At a glance it seems like you are missing -gnat05 in the compile command so you get and Ada95 compiler instead of Ada compiler. ... I've got two problems on AWS, hope there is some aws 2.3 users here. ...
    (comp.lang.ada)
  • Re: Compilator Fortran
    ... To facilitate compilation for the Windowed Debugger ... REM Invoke the debugger if compile and link went ok. ... This will compile, link, and invoke the windowed debugger. ...
    (comp.lang.fortran)
  • Re: compiler errors
    ... compile a program that I downloaded from the net and keep getting a ... What is a DBG File and how do I set up the compiler to so I won't get ... debugging information necessary to do source code step-by-step ... The debugger is just warning you that it can't find the ...
    (microsoft.public.dotnet.languages.vc)
  • RE: Strange behavior with dynamic code compilation and VS.NET debu
    ... so when I compile with debugging information I get different behavior then ... Maybe we should go back to using lots of write lines instead of the debugger ... >> reference exception is ONLY thrown if the debugger is attached???? ...
    (microsoft.public.dotnet.framework)
  • c code memory fault
    ... We are having a problem with c code causing a "memory fault". ... is between K&R and ANSI c. ... reproduce the failure on other "picky" unix platforms without success. ... The interesting part is when we compile with –g the program ...
    (comp.unix.sco.misc)