1

The project written in Fortran runs in different machine fine, but when taken to some other Linux machines it does not. It says segmentation fault on one of them, and on the other it says segmentation fault (core dumped). I did gdb of my program, it is very surprising that it points the segfault to the first line in the program where it should print value of a variable kept in module.

I am compiling all of them as follows:

gfortran -mcmodel=large -fPIC -fopenmp -lgfortran ...

Do you know why this might be the case? The gfortran version is 4.7.2 on Ubuntu 12.10.

3
  • 1
    First enable runtime checks -g -fcheck=all -fbacktrace . Try to run. Then try to run inside gdb. Return here with results. It may be caused by wrong indexes, undefined pointers or other stuff... Commented Dec 19, 2012 at 14:22
  • @VladimirF I did with those flags set, gdb still points to the same print statement... Commented Dec 19, 2012 at 18:07
  • But the point is which one? Show the code. Commented Dec 20, 2012 at 8:10

1 Answer 1

1

Perhaps you need to increase the stack size on those machines. There are answers on this subject on Stackoverflow. Check ulimit.

Sign up to request clarification or add additional context in comments.

1 Comment

@torem: Try ulimit -s. If that is not unlimited, set the stack segment size with" ulimit -s unlimited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.