Fixes are available
January 2012 PTF for XL Fortran for AIX, V13.1
April 2012 PTF for XL Fortran for AIX, V13.1
July 2012 PTF for XL Fortran for AIX, V13.1
October 2012 PTF for XL Fortran for AIX, V13.1
February 2013 PTF for XL Fortran for AIX, V13.1
May 2013 PTF for XL Fortran for AIX, V13.1
XL Fortran for AIX Fix Pack 15 (August 2013 PTF) for 13.1
XL Fortran for AIX Fix Pack 16 (November 2013 PTF) for 13.1
XL Fortran for AIX Fix Pack 17 (February 2014 PTF) for 13.1
XL Fortran for AIX Fix Pack 21 (April 2015 PTF) for 13.1
XL Fortran for AIX Fix Pack 22 (September 2015 PTF) for 13.1
XL Fortran for AIX Fix Pack 23 (March 2016 PTF) for 13.1
XL Fortran for AIX Fix Pack 24 (September 2016 PTF) for 13.1
APAR status
Closed as program error.
Error description
Consider the following test case that demonstrates the problem: ===== TEST CASE: $ cat test.F90 module hermetic_module implicit none private public :: hermetic type,abstract::hermetic end type end module module ref_counter_module use hermetic_module, only: hermetic private public :: ref_counter type,extends(hermetic):: ref_counter private class(hermetic),pointer :: obj => null() contains procedure :: assign generic :: assignment(=) => assign final :: finalize_ref_counter end type interface ref_counter module procedure constructor end interface contains subroutine assign (lhs, rhs) class (ref_counter), intent(inout) :: lhs class (ref_counter), intent(in) :: rhs print *,'assign' lhs%obj => rhs%obj print *,'rhs:',associated(lhs%obj),associated(rhs%obj) end subroutine function constructor (object) class(hermetic), intent(in) :: object type(ref_counter), allocatable :: constructor print *,'constructor start' allocate (constructor) allocate (constructor%obj, source=object) print *,'constructor:',associated(constructor%obj) end function subroutine finalize_ref_counter(this) type(ref_counter), intent(inout) :: this print *,'finalize_ref_counter start' print *,'I could deallocate here' print *,'finalize_ref_counter ends' end subroutine end module module universal_module use hermetic_module ,only : hermetic use ref_counter_module, only : ref_counter implicit none type ,abstract ,extends(hermetic) :: universal private type(ref_counter) :: counter contains procedure,non_overridable:: register_self end type contains subroutine register_self(this) class(universal) ,intent(inout) :: this this%counter=ref_counter(this) end subroutine end module module map_module use universal_module, only: universal implicit none private public :: map type, extends(universal) :: map integer::id end type interface map module procedure new_map end interface contains type(map) function new_map() new_map%id=1 call new_map%register_self() end function end module program main use map_module, only: map type(map):: m m=map() end Compile the test case with the version of XL Fortran for AIX, V13.1 compiler, released before the November 2011 PTF update: xlf2003 test.F90 Run the executable program: ./a.out constructor start constructor: T assign rhs: T T finalize_ref_counter start I could deallocate here finalize_ref_counter ends assign rhs: T T finalize_ref_counter start I could deallocate here finalize_ref_counter ends Recompile the test case with the November 2011 PTF for XL Fortran for AIX, V13.1: xlf2003 test.F90 Run executable: ./a.out constructor start constructor: T assign rhs: T T finalize_ref_counter start I could deallocate here finalize_ref_counter ends finalize_ref_counter start <--- previously missed I could deallocate here <--- finalization finalize_ref_counter ends <--- in test case assign rhs: T T finalize_ref_counter start I could deallocate here finalize_ref_counter ends
Local fix
N/A
Problem summary
The compiler misses a case to finalize an object whose type is a derived type that has a component whose type has user defined finalization routine.
Problem conclusion
The problem had been fixed.
Temporary fix
Comments
APAR Information
APAR number
IV06767
Reported component name
XL FORTRAN FOR
Reported component ID
5724X1500
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-08-23
Closed date
2011-11-02
Last modified date
2011-12-06
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL FORTRAN FOR
Fixed component ID
5724X1500
Applicable component levels
RD10 PSY U848520
UP A
Document Information
Modified date:
06 December 2011