[Pw_forum] segmentation fault -stack -gfortran (ambavale sagar)

Paolo Giannozzi giannozz at democritos.it
Sun Jul 6 22:07:14 CEST 2008


On Jul 6, 2008, at 24:37 , Cesar R.S. da Silva wrote:

> Some time ago I posted a suggestion for a small improvement in  
> stack.c that
> would prevent the segmentation fault error in many situations.
>
> At the time, my suggestion was dismissed as irrelevant as the only  
> effect
> of the sloppy code should be the generation of an annoying message.  
> For
> the record, the only thing I agree is that the message is really  
> annoying.
>
> The code in v4.x tries to set the stack as unlimited, if it fails  
> it tries
> to set to 1.0 GB. However, some systems have a maximum limit for the
> stack. 1.0 GB is a lot of stack, and is also very likely to exceed the
> maximum limit. So, the code is still as sloppy as it was before the  
> last
> revisions.
>
> My fix is to set the stack to the maximum allowed by the system, if
> unlimited fails. It is eventually still insufficient but, as far as I
> know, there is nothing better to do within user level programming to
> further increase the stack. If setting to the maximum allowed is not
> enough, You can, at compile time, make espresso to allocate local  
> vars in
> the heap. This  can cause the heap to become fragmented, but is not  
> as bad
> as not running at all.
>
> If there is a lesson to be taken, it is: Never use a sloppy code  
> unless
> the fix us unfeasible, no matter how inconsequential it seems to be.

I have no evidence that the "sloppy code", as you call it, causes
any trouble on any machine.
---
Paolo Giannozzi, Dept of Physics, University of Udine
via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222






More information about the users mailing list