segmentation error: SIGSEGV  
Author Message
snfinder@naver.com





PostPosted: 2006-9-25 13:55:29 Top

fortran, segmentation error: SIGSEGV I coded some integral cos(t^2) in [0,1] using trapzd.f90 subroutine.

It is compiled well, but segmentation error occurs when execute it.
Following text is output of idb.

error message:
******************** XXXXXXX ****************************
3 4 0.2173511732
4 8 1.0691014455
5 16 1.5692780733
6 32 0.1210473473
7 64 0.0412630614
8 128 0.0943264767
9 256 0.1164983573
10 512 0.1266963443
11 1024 0.1315937138
12 2048 0.1339942939
13 4096 0.1351828314
14 8192 0.1357742005
15 16384 0.1360691527
16 32768 0.1362163957
17 65536 0.1362902634
18 131072 0.1363288458
19 262144 0.1363479746
20 524288 0.1362782141

Program received signal SIGSEGV
trapzd (func=(function [0x0000000000000000]), a=6.95319085207303e-310,
b=<no value>, s=<no value>, n=<no value>) at trapzd.f90:22
22 fsum=sum(func(arth(a+0.5_dp*del,del,it)))

n=20 is critical point. It stop if n >20.

How can I fix it? I want to run to much large n.

I work on FC5 linux (64bit), intel xeon dual cpu machine using
ifort(intel fortran compiler 9.1)

Help me experts~~~

 
Joost





PostPosted: 2006-9-25 14:13:00 Top

fortran >> segmentation error: SIGSEGV
snfinder@naver.com wrote:

> 20 524288 0.1362782141
>
> Program received signal SIGSEGV
> trapzd (func=(function [0x0000000000000000]), a=6.95319085207303e-310,
> b=<no value>, s=<no value>, n=<no value>) at trapzd.f90:22
> 22 fsum=sum(func(arth(a+0.5_dp*del,del,it)))
>
> n=20 is critical point. It stop if n >20.
>
> How can I fix it? I want to run to much large n.
>
> I work on FC5 linux (64bit), intel xeon dual cpu machine using
> ifort(intel fortran compiler 9.1)

try setting the stack space much larger. depending on your shell
ulimit -s 128000
or something like this. You need to do that, basically, every time
before you run your application. Or you allocate explicitly a temporary
array for the argument in sum (just guessing).

Joost

 
snfinder@naver.com





PostPosted: 2006-9-25 15:33:00 Top

fortran >> segmentation error: SIGSEGV Thank you Joost ^^

But I can't understand your saying. I'm not good at fortran and linux.
Can you explain it more details?

You mean it is not wrong of my code but shell setting problem?

PDS (-:

 
 
Joost





PostPosted: 2006-9-25 15:42:00 Top

fortran >> segmentation error: SIGSEGV
> You mean it is not wrong of my code but shell setting problem?

it is not necessarily a problem of your code. Ifort tends to generate
large temporary arrays on stack which causes programs to crash like
this if the default size the shell allows is not large enough. So, the
first thing to try is to increase the limit that your shell uses as a
default. If you use bash it will be
ulimit -s 128000
if you use tcsh
unlimit
or something similar.
echo $SHELL
will tell you what you use. It is also described in the documentation
that comes with ifort, but I forgot where.

Joost

 
 
snfinder@naver.com





PostPosted: 2006-9-25 15:56:00 Top

fortran >> segmentation error: SIGSEGV
> ulimit -s 128000

^^ Thanks again Joost
Ah~ Ifort was a problem...
By the way, does the stack limit value 128000 has a some meaning?
It just a few more progress after I execute that command.

I want more steps. Is is okay seting more number?

Umm... is this command safe?
I'm curious what effects the system will be affected.


PDS

 
 
Joost





PostPosted: 2006-9-25 16:04:00 Top

fortran >> segmentation error: SIGSEGV
snfinder@naver.com wrote:
> > ulimit -s 128000
>
> ^^ Thanks again Joost
> Ah~ Ifort was a problem...
> By the way, does the stack limit value 128000 has a some meaning?
> It just a few more progress after I execute that command.
>
> I want more steps. Is is okay seting more number?
>
> Umm... is this command safe?
> I'm curious what effects the system will be affected.

the command sets the stack size to 128Mb. If you set it to a somewhat
larger number it will go somewhat further, up to the point where you
run out of memory. Now, if you're simply doing some integration, there
is really no point to have the code generate such huge temporaries, and
I would suggest you write the DO loop that is equivalent to the 'SUM'
that is causing the problems.

Joost

 
 
Kamaraju Kusumanchi





PostPosted: 2006-9-26 7:00:00 Top

fortran >> segmentation error: SIGSEGV Joost wrote:
> ulimit -s 128000

If you are worried about what number to set it from, just use

ulimit -a unlimited

and leave the rest of the details to the OS and hardware! This is what I do!

raju

--
http://kamaraju.googlepages.com/cornell-bazaar
http://groups.google.com/group/cornell-bazaar/about