My code can be executed and I extract the desired results, but after
printing the results , that gives me "Segmentation fault" error and it
is very strange for me why I get this message although I checked all
of the arrays and didn't find any mistake and also can get the correct
result.
Is there anyone can give me a hint to find the bug?
Thanks in advance,
F.M
It's usually not possible to find a bug without seeing the code.
Where's the code?
After doing the calculations correctly you might be trying to print an
array outside of its bounds. That would certainly trigger your seg
fault.
agt
--
Freedom - no pane, all gaiGN!
Code Art Now
http://codeartnow.com
Email: a...@codeartnow.com
> Dear all ;
>
> My code can be executed and I extract the desired results, but after
> printing the results , that gives me "Segmentation fault" error and it
> is very strange for me why I get this message although
> I checked all of the arrays
Three points:
1. Show the problem. Since you have a problem it is self evident that
your description is surely going to be wrong (as in - if you could
give a correct description then you would have solved the problem!).
2. "I checked" is not of any use unless it means that you used the
compilers subscript checking to do it for you. See 1 above. But
the subscript checking is easily fooled by "(*)" declarations so
those need to be avoided. See 3 below and use assumed shape "(:)"
declarations in all subroutines and functions.
3. Using the full F90 (ie. F90/95/2003/200x) safety checking of every
subroutine or function in a module to have its call checked against
the definition will catch the other standard causes of this type of
error.
It is possible that you can go outside the array early
in the program, get the right answer, and the
Segmentation Fault comes later. Specifically, it can
come when memory allocation/deallocation is done, often
much later than the cause.
Turn on bounds checking throughout.
-- glen
Try turning on subscript bounds checking.
Also, turn on string bounds checking.