- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code crashes with segmentation fault on `deallocate(copy)`:
module mytype_mod
  implicit none
  
  type :: mytype
    integer :: val
  contains
    final :: finalize_mytype
  end type
contains
  subroutine finalize_mytype(this)
    type(mytype), intent(inout) :: this
  end subroutine
end module
program test_prg
  use mytype_mod
  implicit none
  call test()
contains
  subroutine test()
    type(mytype), pointer :: main(:), copy(:)
    allocate(main(3))
    allocate(copy, source = main)
    deallocate(copy)
  end subroutine
end programIf I make the final procedure `elemental`, then it works. This also seems to have something to do with `source` and `pointer` attributes since I couldn't reproduce the crash without them. To the best of my knowledge, this code should be valid. Tested with ifort 19.0.3.199.
Link Copied
		2 Replies
	
		
		
			
			
			
					
	
			- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like a compiler bug to me.
If you're able to, please submit a support request at Intel OSC: https://supporttickets.intel.com/?lang=en-US
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
 
					
				
				
			
		
					
					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