From: Benjamin on

After compiling the whole codes without no errors, I'm getting into
the trouble of "segmentation fault" when I try to run the executable
file.
It's a little bit annoying....
Although I've known it's generated by several factors:
# An array index is outside the declared range.
# The name of an array index is misspelled.
# The calling routine has a REAL argument, which the called routine
has as INTEGER.
# An array index is miscalculated.
# The calling routine has fewer arguments than required.
# A pointer is used before it has been defined.
.....I can't find the fatal factor(s).

But is there any software or package to check this progress?
My OS is openSUSE 11.0, the compiler is SCons.


From: steve on
On Jun 1, 7:53 am, Benjamin <benjami...(a)googlemail.com> wrote:
> After compiling the whole codes without no errors, I'm getting into
> the trouble of  "segmentation fault" when I try to run the executable
> file.
> It's a little bit annoying....
> Although I've known it's generated by several factors:
> # An array index is outside the declared range.
> # The name of an array index is misspelled.
> # The calling routine has a REAL argument, which the called routine
> has as INTEGER.
> # An array index is miscalculated.
> # The calling routine has fewer arguments than required.
> # A pointer is used before it has been defined.
> ....I can't find the fatal factor(s).
>
> But is there any software or package to check this progress?
> My OS is openSUSE 11.0, the compiler is SCons.

Scons appears to be some sort of integrated build environment.
What is the actual Fortran compiler installed on your system?

--
steve
From: Benjamin on
On 1 Jun., 16:59, steve <kar...(a)comcast.net> wrote:
> On Jun 1, 7:53 am, Benjamin <benjami...(a)googlemail.com> wrote:
>
>
>
> > After compiling the whole codes without no errors, I'm getting into
> > the trouble of  "segmentation fault" when I try to run the executable
> > file.
> > It's a little bit annoying....
> > Although I've known it's generated by several factors:
> > # An array index is outside the declared range.
> > # The name of an array index is misspelled.
> > # The calling routine has a REAL argument, which the called routine
> > has as INTEGER.
> > # An array index is miscalculated.
> > # The calling routine has fewer arguments than required.
> > # A pointer is used before it has been defined.
> > ....I can't find the fatal factor(s).
>
> > But is there any software or package to check this progress?
> > My OS is openSUSE 11.0, the compiler is SCons.
>
> Scons appears to be some sort of integrated build environment.
> What is the actual Fortran compiler installed on your system?
>
> --
> steve

Oh, sry, gFortran is the actual comiler
From: Alois Steindl on
Hello,
a debugger might be a great help in this situation.
If you are planning to dig deep into programming,
learning to use the available debuggers is a worthwhile option.

Another possible reason: Too small memory sizes, like stack size.
Can usually be corrected with ulimit.

Good luck
Alois
From: mecej4 on
Benjamin wrote:

>
> After compiling the whole codes without no errors, I'm getting into
> the trouble of "segmentation fault" when I try to run the executable
> file.
> It's a little bit annoying....
> Although I've known it's generated by several factors:
> # An array index is outside the declared range.
> # The name of an array index is misspelled.
> # The calling routine has a REAL argument, which the called routine
> has as INTEGER.
> # An array index is miscalculated.
> # The calling routine has fewer arguments than required.
> # A pointer is used before it has been defined.
> ....I can't find the fatal factor(s).
>
> But is there any software or package to check this progress?
> My OS is openSUSE 11.0, the compiler is SCons.

1. Compile with the checking options of your compiler set ON
(e.g., -C -traceback ... check your compiler options list see what to use)

AND/OR

2. Compile with -g, and use tools such as GDB and VALGRIND.

Once you establish that the seg-fault is traceable to your code, you may see
it as a good thing, if the alternative is to propagate erroneous results
throughout your program with no notification to you.

Compiling without errors merely establishes that those errors that are
detectable by static analysis of the code have been removed. By no means
does it follow that there are no more errors left in the code.

-- mecej4