Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
13 Views

Segmentation fault when coarray attribute omitted for the dummy argument

Hi,

The following code gives a segmentation fault.

This error is triggered when I call a procedure (ProceVersion2) passing a coarray actual argument but the associated dummy argument has NOT the coarray attribute.

If the same procedure is written with the coarray attribute for the dummy argument (ProceVersion1), then there is no error.

Surprisingly, if both procedures are called, there is also no error.

Also, if the allocatable attribute is removed, there is no error

Thanks for looking at this issue.

Program Main
  integer ,allocatable ,codimension[:]  ::    coVar
!   integer  ,codimension
  •   ::    coVar allocate( coVar
  • ) ! call ProceVersion1( coVar ) call ProceVersion2( coVar ) contains Subroutine ProceVersion1( Variable ) class(*) ,intent(in) :: Variable
  • write(6,"(4x,'[ProceVersion1]: Entering')") select type (Variable) type is (integer); write(6,"(4x,'[ProceVersion1]: integer')") class default; write(6,"(4x,'[ProceVersion1]: other')") end select End Subroutine Subroutine ProceVersion2( Variable ) class(*) ,intent(in) :: Variable write(6,"(4x,'[ProceVersion2]: Entering')") select type (Variable) type is (integer); write(6,"(4x,'[ProceVersion2]: integer')") class default; write(6,"(4x,'[ProceVersion2]: other')") end select End Subroutine End Program ! export FOR_COARRAY_NUM_IMAGES=1; ifort -coarray -coarray-num-images=1 -O0 -pg -warn all -traceback main.f90; ./a.out
  •  

    0 Kudos
    2 Replies
    Highlighted
    13 Views

    We'll take a look - thanks.

    0 Kudos
    Highlighted
    Employee
    13 Views

    I reproduced all the various results you noted using our latest 17.0 Update 1 release and escalated this to Development. Thank you for the nice test case.

    (Internal tracking id: DPD200416816)

    0 Kudos