Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26736 Discussions

Segmentation fault when coarray attribute omitted for the dummy argument

FlyingHermes
New Contributor I
106 Views

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
    Steven_L_Intel1
    Employee
    106 Views

    We'll take a look - thanks.

    Kevin_D_Intel
    Employee
    106 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)

    Reply