Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
21 Views

Bugreport: Fortran program with dynamic stride in array slicing crashes with ifort 17.0.0.109 in debug mode (both Win32 and x64)

Hello,

if I compile the following program as a Windows console project, it crashes with the error message shown below. In Release mode, it runs.

!  Console1.f90 
!
!  FUNCTIONS:
!  Console1 - Entry point of console application.
!

!****************************************************************************
!
!  PROGRAM: Console1
!
!  PURPOSE:  Entry point for the console application.
!
!****************************************************************************

    program Console1

    implicit none
    real(8) :: a(10)
    
    integer(4) i, j, k
    
    a = 1.0
    i = 1
    j = 10
    k = 2
    
    write (*,*) a(i:j:k)

    end program Console1

Here is the error message:

forrtl: severe (408): fort: (3): Subscript #1 of the array A has value -85899346
0 which is less than the lower bound of 1

Image              PC        Routine            Line        Source
libifcoremdd.dll   0F653D2B  Unknown               Unknown  Unknown
Console1.exe       012F112D  _MAIN__                    27  Console1.f90
Console1.exe       012F144F  Unknown               Unknown  Unknown
Console1.exe       012F3D89  Unknown               Unknown  Unknown
Console1.exe       012F3ECD  Unknown               Unknown  Unknown
kernel32.dll       75FB338A  Unknown               Unknown  Unknown
ntdll.dll          7734A242  Unknown               Unknown  Unknown
ntdll.dll          7734A215  Unknown               Unknown  Unknown

If I run the code in release mode, the output looks as expected:

>Console1.exe
   1.00000000000000        1.00000000000000        1.00000000000000
   1.00000000000000        1.00000000000000

If I use

    write (*,*) a(i:j:2)

then the program also works in release mode.

So I guess this is an error in ifort 17? (with ifort 14 and 16 it is working)

Thank you for your help

Joachim

The build log of the debug version:

Build Log  
     Build started: Project: Console1, Configuration: Debug|Win32 
 
Output  
    Compiling with Intel(R) Visual Fortran Compiler 17.0.0.109 [IA-32]...
ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Intel Fortran\Microsoft Files\VC\\bin" /Qm32 "C:\Users\hej\Documents\Visual Studio 2013\Projects\Console1\Console1\Console1.f90"
Linking...
Link /OUT:"Debug\Console1.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\Console1.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\hej\Documents\Visual Studio 2013\Projects\Console1\Console1\Debug\Console1.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\hej\Documents\Visual Studio 2013\Projects\Console1\Console1\Debug\Console1.lib" -qm32 "Debug\Console1.obj"
Embedding manifest...
mt.exe /nologo /outputresource:"C:\Users\hej\Documents\Visual Studio 2013\Projects\Console1\Console1\Debug\Console1.exe;#1" /manifest "Debug\Console1.exe.intermediate.manifest"

Console1 - 0 error(s), 0 warning(s)

 

 

0 Kudos
7 Replies
Highlighted
Beginner
21 Views

Sorry, it should of course read:

... then the program also works in releasedebug mode.

0 Kudos
Highlighted
21 Views

Thanks - I can reproduce this. It's just the bounds checking that is failing - the program is executing correctly. I'll send this on to the developers. Issue ID is DPD200414203. If you disable bounds checking, it runs ok.

0 Kudos
Highlighted
21 Views

This problem has been fixed. The fix might make it in to update 1 to Parallel Studio XE 2017, but if not, then update 2 for sure.

0 Kudos
Highlighted
Beginner
21 Views

Thank you for the update.

0 Kudos
Highlighted
Beginner
21 Views

I installed Parallel Studio XE 2017 Update 1 today, and it looks like this problem has not been fixed. Is this observation correct?

0 Kudos
Highlighted
21 Views

Indeed, it did not make the code cutoff for update 1, but should make update 2.

0 Kudos
Highlighted
Beginner
21 Views

The problem has been fixed with the release of ifort 17.0.2.187

0 Kudos