- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to understand how finalizers work in Fortran.
I have written a minimal test program containing a derived type with just a final procedure and an allocatable component.
It appears that the finalizer is called more that once, and I don't understand why.
I noticed this behaviour only if the derived type contains an allocatable component, and if more than one object is instantiated from that class.
Here is the code :
module finalizer_module implicit none type :: obj real,allocatable :: var contains final :: clean end type contains subroutine clean(this) type(obj) :: this write(*,*) "in finalizer" end subroutine clean end module finalizer_module ! program test_finalizer use :: finalizer_module call sub contains subroutine sub type(obj) :: f1,f2 end subroutine sub end program test_finalizer
And here the output :
in finalizer in finalizer in finalizer
I think I should have only two "in finalizer", as I have two objects (f1,f2) that are destroyed at "end subroutine sub"?
NB:
$ ifort --version ifort (IFORT) 14.0.2 20140120
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At first glance this appears to be ether the same bug or a related one to the one reported in http://software.intel.com/en-us/forums/topic/487145 ; For now I'm going to assume it's the same but will add your test case to it - issue ID is DPD200249474.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At first glance this appears to be ether the same bug or a related one to the one reported in http://software.intel.com/en-us/forums/topic/487145 ; For now I'm going to assume it's the same but will add your test case to it - issue ID is DPD200249474.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I hadn't found this previous thread...
Is there a public website available to follow the evolution of ifort issues ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Simon wrote:
Ok, I hadn't found this previous thread...
Is there a public website available to follow the evolution of ifort issues ?
Yes, it'll be nice if such a site were available..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the site. Any developments are added to the forum threads where the issue was reported.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
What I think would be helpful would be to have a Sticky thread listing the Issue ID's, summary, status, what version fixed issue, and links back to the forum messages that relate to the issue. This would be immensely useful as a self-help tool.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim, the "summary" is perhaps the hardest part of that. I know from my many years of writing release notes that it is sometimes difficult if not impossible to come up with a concise summary of a particular problem. (Especially when the symptom is Internal Compiler Error.) Even if one could write a summary, it can mislead people into thinking they have the same problem and they won't report it. We'd much rather you report a duplicate than decide you don't need to report a problem. Often new reports of what looks like the identical problem are in fact something else entirely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Perhaps you and Intel staff can look at this site which lists all the open issues with gfortran. Something similar for Intel Fortran will be very helpful. As Jim suggests, one good add would be links to any forum topics that connect to the issues.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reported problem is fixed in 15.0.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page