Showing results for 
Search instead for 
Did you mean: 
New Contributor I

Segmentation fault when coarray attribute omitted for the dummy argument


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

    We'll take a look - thanks.

    We'll take a look - thanks.

    Retired 12/31/2016
    0 Kudos

    I reproduced all the various

    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