Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29343 討論

forrtl: severe (174): SIGSEGV, segmentation fault occurred

siyuliben
初學者
6,117 檢視

Hi,

I received the following error message when I run my complied file (I used '-g -traceback' to find exactly where the problem is

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
nopar 0000000000ED5149 Unknown Unknown Unknown
nopar 0000000000ED3AC0 Unknown Unknown Unknown
nopar 0000000000E81E72 Unknown Unknown Unknown
nopar 0000000000E35763 Unknown Unknown Unknown
nopar 0000000000E3B82B Unknown Unknown Unknown
libpthread.so.0 000014712C904630 Unknown Unknown Unknown
nopar 0000000000CDC0FB varset2_hru_ 209 varset2_hru.f
nopar 0000000000CAF975 subbasin_ 240 subbasin.f
nopar 00000000004B1AA8 command_ 133 command.f
nopar 0000000000C5B8C4 simulate_ 242 simulate.f
nopar 0000000000526D50 swat_main_ 115 main.f
nopar 0000000000C75539 MAIN__ 15 smrt_main.f
nopar 0000000000402D76 Unknown Unknown Unknown
libc.so.6 000014712C345555 Unknown Unknown Unknown
nopar 0000000000402C69 Unknown Unknown Unknown

 

I attached the source code where it showed problems, and variables are listed below.

     real, dimension (:), allocatable :: hhqday

     real, dimension (:,:), allocatable :: hhqday_hru

     allocate (hhqday(nstep))

     allocate (hhqday_hru(mhru,nstep))

 

I tried Line 210 to 214 to represent what I want, but the same error occurred.

I found that Line 305 is also having similar problems too.

What I want to do is just save the values from one variable to another variable with different dimensions.

 

Can anyone help me with this? Thank you very much.

 

Siyu

0 積分
6 回應
siyuliben
初學者
6,113 檢視

P.S. I run the program in a Linux system, and I used 'limit' to check the memory, the 'stacksize' is unlimited.

Arjen_Markus
榮譽貢獻者 II
6,077 檢視

One thing that comes to mind: is the value of j within the range 1:mhru? You can compile the source code with the option to check the array bounds, -check bounds (or even -check all).

siyuliben
初學者
6,062 檢視

Hi,

Thank you, I used -check bounds to compile the source code, j is within the range of 1:mhru.

Arjen_Markus
榮譽貢獻者 II
6,049 檢視

Okay, an alternative approach: run it in the debugger. That should be able to tell you more about what is going wrong.

Bernard
傑出貢獻者 I
6,025 檢視

Just as @Arjen_Markus  said -- please run your program under gdb in order to obtain the exact location of the faulting IP.

The attached 'traceback' out is not very informative.

jimdempseyatthecove
榮譽貢獻者 III
5,994 檢視

The vast majority of the variables listed in your attached file are IMPLICIT variables and/or declared/defined in module parm.

The first step in resolving any problems would be to insert IMPLICIT NONE at the beginning of the subroutine, and then sort out issues with potential undeclared variables. This may be due to typographical errors.

 

Jim Dempsey

回覆