Fixes are available
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
LI76637
Reported component name
XL FORTRAN LINU
Reported component ID
5724X1600
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2012-02-06
Closed date
2012-02-06
Last modified date
2012-02-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 LINU
Fixed component ID
5724X1600
Applicable component levels
RD10 PSN IV06767
UP06/09/13
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAT4T","label":"XL Fortran for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D10","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
17 October 2021