Segmentation fault with PACK function since pgi/12.X

Hello ( ;-)Again me )

Segmentation fault with basic use of PACK function since pgi/12.X

Sample “test_pack” compile with pgi/11.10 ( or ifort or gfortran) OK

test_pack
IINDEX= 1 2 3
IJINDEX= 1 2 3

Now compiled with pgi/12.5 or over

test_pack
Segmentation fault

Here is the compilation line

pgf90 -g test_pack.f90 -o test_pack

And the test_pack source :

PROGRAM TEST_PACK

  IMPLICIT NONE

  INTEGER, PARAMETER                  :: NI=3
  INTEGER, ALLOCATABLE, DIMENSION(:)  :: IINDEX,IJINDEX
  LOGICAL, ALLOCATABLE, DIMENSION(:)  :: GTRIG

  INTEGER                             :: I

  ALLOCATE (IINDEX(NI),IJINDEX(NI),GTRIG(NI))
 
  DO I=1,NI
    IINDEX(I) = I
    GTRIG(I)  = .TRUE.
  END DO

  IJINDEX(:) = PACK( IINDEX(:), MASK=GTRIG(:) )

  print*,"  IINDEX=",IINDEX(:)
  print*," IJINDEX=",IJINDEX(:)

END PROGRAM TEST_PACK

A+
Juan

Thanks Jaun,

I submitted TPR#18937 for this error. Interestingly the error does not occur in our internal development compiler. I don’t see other similar reports but our engineers might have already found this error or it was fixed as a side effect of another issue. This means that we should be able to get the fix into the next release.

  • Mat

Hello Mat .

In the original code I don’t alway have the seg fault …
… but must of the time the resulting array IJINDEX is completely wrong …
… and the original array IINDEX is arise with wrong value …
even if it only an input tab ?

A+

Juan

Can you send PGI Customer Support (trs@pgroup.com) the full source? I’d rather us have the full source just in case there are multiple issues here.

  • Mat

Hello Mat …

The original code is 1 million fortran lines , more than 4000 fortran files …
makefiles + 10 tests case ( and need a license agreement … )

but I could put it in a tarball some where …

A+

Juan

Hi Juan,

and need a license agreement …

The size doesn’t bother me, I just can’t get lawyers involved. If the license is just a click-through agreement that I wont do anything other use it internally for investigating this issue, then sure. But if I have to sign something or get and NDA, it’s best if I just work with the simple example.

  • Mat

Hello Mat .

Waiting for a bugfix on the PACK problem which impact a lot of routines/lines in my code …

egrep “= *PACK *(” *.f90 | wc -l
109

… as I’ve seen in an other post it was an optimization made on the pgi/12.5
… perhaps do you have an ‘obscure’ option to inhibit this optimization …

A+

Juan

PS: The code is under License agreement for Research purpose ( not easy/planned to distribute for debugging purpose … )

Hi Juan,

The fix for the PACK problem, TPR#18937, is scheduled for release 12.10 due out on or around October 12th.

as I’ve seen in an other post it was an optimization made on the pgi/12.5

Your issue began failing in the 12.1 release and is unrelated to this new optimization.

  • Mat

Ok , thank you Mat .

I will wait for the next release .

A+

Juan

This has been fixed as of 12.10 release.

thanks,
dave