- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following after compiling with 12.1.1 explodes at runtime with an access violation that seems unwarranted. 12.0.5 doesn't appear to have an issue.
[fortran]MODULE SomeTypesAndAFactoryForThoseTypes
IMPLICIT NONE
PRIVATE
!----
TYPE, ABSTRACT, PUBLIC :: ParentType
INTEGER :: a = 1 ! Note default initialization.
CONTAINS
PROCEDURE(parent_Proc), DEFERRED :: Proc
END TYPE ParentType
ABSTRACT INTERFACE
SUBROUTINE parent_Proc(obj)
IMPORT :: ParentType
IMPLICIT NONE
CLASS(ParentType), INTENT(OUT) :: obj
END SUBROUTINE parent_Proc
END INTERFACE
TYPE, PUBLIC, EXTENDS(ParentType) :: OneType
INTEGER :: b
CONTAINS
PROCEDURE :: Proc => one_Proc
END TYPE OneType
TYPE, PUBLIC, EXTENDS(ParentType) :: TwoType
REAL :: c
CONTAINS
PROCEDURE :: Proc => two_Proc
END TYPE TwoType
PUBLIC :: Factory
INTERFACE Factory
MODULE PROCEDURE Factory_
END INTERFACE Factory
CONTAINS
SUBROUTINE Factory_(str, obj)
CHARACTER(*), INTENT(IN) :: str
CLASS(ParentType), INTENT(OUT), ALLOCATABLE :: obj
!****
SELECT CASE (str)
CASE ('one')
ALLOCATE(OneType:: obj)
CASE ('two')
ALLOCATE(TwoType :: obj)
CASE DEFAULT
! Just leave unallocated
END SELECT
END SUBROUTINE Factory_
SUBROUTINE one_Proc(obj)
CLASS(OneType), INTENT(OUT) :: obj
!****
obj%a = 1
obj%b = 2
END SUBROUTINE one_Proc
SUBROUTINE two_Proc(obj)
CLASS(TwoType), INTENT(OUT) :: obj
!****
obj%a = 10
obj%c = 30.0
END SUBROUTINE two_Proc
END MODULE SomeTypesAndAFactoryForThoseTypes
PROGRAM DearIntelDevelopersForTwelvePointOneYouOweMeACaseOfBeer
USE SomeTypesAndAFactoryForThoseTypes
IMPLICIT NONE
CLASS(ParentType), ALLOCATABLE :: obj
!****
CALL Factory('one', obj)
IF (.NOT. ALLOCATED(obj)) STOP
CALL obj%Proc
END PROGRAM DearIntelDevelopersForTwelvePointOneYouOweMeACaseOfBeer
[/fortran] [plain]>ifort /check:all /warn:all /standard-semantics /traceback ItsFridayAndImThirsty.f90 Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.1.1.258 Build 20111011 Copyright (C) 1985-2011 Intel Corporation. All rights reserved. Microsoft Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. -out:ItsFridayAndImThirsty.exe -subsystem:console -incremental:no ItsFridayAndImThirsty.obj >ItsFridayAndImThirsty.exe forrtl: severe (157): Program Exception - access violation Image PC Routine Line Source ItsFridayAndImThi 008F13E5 _SOMETYPESANDAFAC 55 ItsFridayAndImThirsty.f90 ItsFridayAndImThi 008F10DA _MAIN__ 73 ItsFridayAndImThirsty.f90 ItsFridayAndImThi 0091F923 Unknown Unknown Unknown ItsFridayAndImThi 0090AF1D Unknown Unknown Unknown kernel32.dll 761AD309 Unknown Unknown Unknown ntdll.dll 76F716C3 Unknown Unknown Unknown ntdll.dll 76F71696 Unknown Unknown Unknown[/plain]
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I have passed this along to the developers. The issue ID is DPD200176585.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, fixing this properly required a complicated change that we don't want to put into a minor update. It is fixed for the next major release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I'm still thirsty, but have moved off beer and onto wine. Any thoughts as to when I might be able to download the next major release crack the screw top on the semillon that's hiding up the back of the fridge?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your wine will need to age some more months, but you'll be able to enjoy it this year.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page