Beta runtime libraries cause 14.0.3 program to crash

Beta runtime libraries cause 14.0.3 program to crash

I have an odd bug in a dynamically linked application.

When run from the command line prompt for 14.0.2 an executable, built with with 14.0.2 + VS2010 (but on a machine with the beta installed), works.

When run from the command line prompt for 15.0.0 beta update 2 the exact same executable (no recompilation) explodes.  The explosion happens inside the runtime, via for_alloc_copy.

That's not really supposed to happen... right?

MODULE m
  IMPLICIT NONE
  PRIVATE
  PUBLIC :: SolidType
  
  TYPE, PUBLIC, ABSTRACT :: Stream
  CONTAINS
    PROCEDURE(stream_WhoAmI), DEFERRED, NOPASS :: WhoAmI
  END TYPE Stream
  
  ABSTRACT INTERFACE
    SUBROUTINE stream_WhoAmI
      IMPLICIT NONE
    END SUBROUTINE stream_WhoAmI
  END INTERFACE
  
  TYPE, EXTENDS(Stream), PUBLIC :: SolidStream
  CONTAINS
    PROCEDURE, NOPASS :: WhoAmI => solid_WhoAmI
  END TYPE SolidStream
CONTAINS
  SUBROUTINE solid_WhoAmI
    PRINT "('I am a solid stream')"
  END SUBROUTINE solid_WhoAmI
  
  FUNCTION SolidType() RESULT(type)
    CLASS(Stream), ALLOCATABLE :: type
    ALLOCATE(SolidStream :: type)
  END FUNCTION SolidType
END MODULE m

PROGRAM p
  USE m
  IMPLICIT NONE
  CLASS(Stream), ALLOCATABLE :: type
  ALLOCATE(type, SOURCE=SolidType())
  CALL type%WhoAmI
END PROGRAM p

Compiling and running in one command prompt:

>ifort /MD /check:all /warn:all /standard-semantics "2014-06-25 runtime.f90" && "2014-06-25 runtime.exe"
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 14.0.3.202 Build 20140422
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2014-06-25 runtime.exe"
-subsystem:console
"2014-06-25 runtime.obj"
I am a solid stream

Running only (compiler stuff just for version) in the command prompt for the beta:

>"2014-06-25 runtime.exe"
forrtl: severe (157): Program Exception - access violation
Image              PC        Routine            Line        Source
libifcoremd.dll    1000E933  Unknown               Unknown  Unknown
libifcoremd.dll    1000E5C9  Unknown               Unknown  Unknown
2014-06-25 runtim  01141256  Unknown               Unknown  Unknown
2014-06-25 runtim  011423E2  Unknown               Unknown  Unknown
2014-06-25 runtim  0114151C  Unknown               Unknown  Unknown
kernel32.dll       7562338A  Unknown               Unknown  Unknown
ntdll.dll          77379F72  Unknown               Unknown  Unknown
ntdll.dll          77379F45  Unknown               Unknown  Unknown

>ifort
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 15.0.0.070 Beta Build 20140530
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

ifort: NOTE: The Beta evaluation period for this product ends on 25-sep-2014 UTC.
ifort: command line error: no files specified; for help type "ifort /help"

 

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Looks like data or code access violation.

By reading your description I was thinking about the situation when exported function by that dll was referenced when the dll was unloaded.

Hello Ian,

Thanks for reporting this.  Yes, I think this should be expected to work.  I can reproduce the same, by building with ifort-14.0.3 + VS2013 and running on a host with only ifort-15.0 beta installed.  As you may know, the crash occurs on the statement at line 37:

ALLOCATE(type, SOURCE=SolidType())

 

C:\ISN_Forums\U517418>U517418.exe
forrtl: severe (157): Program Exception - access violation
Image              PC        Routine            Line        Source
libifcoremd.dll    1000E933  Unknown               Unknown  Unknown
libifcoremd.dll    1000E5C9  Unknown               Unknown  Unknown
U517418.exe        00A91256  _MAIN__                    37  U517418.f90

 

I'll discuss with the developers and update this thread as I learn more.

Patrick

The different environments change the path for the run-time DLLs. When you use the 14.0.2 environment, you get the 14.0.2 DLLs.

Steve - Intel Developer Support

But doesn't this break backwards compatibility of the runtime?  I distribute something built with 14.0.2, end user then installs 15.0.x runtime, etc...
 

It is a bug if a new runtime breaks existing correct applications. (At least that is our philosophy.) What I was pointing out was that when you use the build environment command line scripts, PATH is set to point to that specific version's run-time DLLs, not the system-wide ones installed under Common Files. Patrick is reporting the bug to the developers.

Steve - Intel Developer Support

Effects IA-32/Intel64, Debug/Release.  Reported as defect DPD200358057.

Patrick

Leave a Comment

Please sign in to add a comment. Not a member? Join today