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

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

siyuliben
Beginner
3,194 Views

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 Kudos
6 Replies
siyuliben
Beginner
3,190 Views

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

0 Kudos
Arjen_Markus
Honored Contributor I
3,154 Views

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).

0 Kudos
siyuliben
Beginner
3,139 Views

Hi,

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

0 Kudos
Arjen_Markus
Honored Contributor I
3,126 Views

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

0 Kudos
Bernard
Valued Contributor I
3,102 Views

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.

0 Kudos
jimdempseyatthecove
Honored Contributor III
3,071 Views

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

0 Kudos
Reply