IBM Support

LI76092: INCORRECT INVOCATION OF USER PROCEDURES

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • For some reason,
    allocate (constructor%obj, source=object)
    
    is invoking the user defined final procedure. As you can see
    from the 'actual output' section below the executable is calling
    the final procedure during the allocation process.
    
    ===== TESTCASE:
    $ 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
    $
    
    
    
    ===== ACTUAL OUTPUT:
    $ ./a.out
     constructor start
     finalize_ref_counter start
     I could deallocate here
     finalize_ref_counter ends
     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
    $
    
    ===== EXPECTED OUTPUT:
    $./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
    $
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users having a REAL type namelist item that does not have
    enough corresponding values in the input
    and the name of the next item starts with 'i' or 'n' maybe
    affected by this issue
    
    PROBLEM DESCRIPTION:
    When a REAL type namelist item does not have enough
    corresponding values in the input and the name of the next item
    starts with 'i' or 'n',
    the runtime fails to read the rest items in the namelist group
    correctly.
    

Problem conclusion

  • This problem affects namelist input.  Fixed by correcting the
    state machine.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76092

  • 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

    2011-04-27

  • Closed date

    2011-04-27

  • Last modified date

    2011-04-27

  • APAR is sysrouted FROM one or more of the following:

    IZ94263

  • APAR is sysrouted TO one or more of the following:

    024AC6Ÿ

Fix information

  • Fixed component name

    XL FORTRAN LINU

  • Fixed component ID

    5724X1600

Applicable component levels

[{"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