Segfault for type bound procedure

Environment: NVHPC 20.7 and NVHPC 20.9 on a Manjaro Linux:

nvfortran 20.9-0 LLVM 64-bit target on x86-64 Linux -tp sandybridge 
NVIDIA Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION.  All rights reserved.

Minimal working example: (1.1 KB)

I tried to make one of my Fortran projects compatible with NVHPC/PGI and encountered a strange segfault for a recursive invocation of type bound procedure, involving abstract derived types. I created a hopefully minimal example of the issue (still 200 lines).

The program in mwe.f90 compiles with both NVHPC 20.7 and NVHPC 20.9 using

nvfortran mwe.f90 -g -O0 -traceback && ./a.out

but the resulting binary always segfaults for the invocation of a type bound procedure. I wasn’t able to get more information on this issue by running in gdb so far.

The same example works with GCC, Intel and NAG compilers without issues.

Any help with this issue is appreciated.

Thanks for the report and the great example!

I was able to reproduce the issue here and do agree that it’s compiler issue. As such, I’ve created a problem report (TPR #29300) and sent it to engineering for further evaluation.

Best Regards,

1 Like