Bug of nvfortran 24.3-0: "fort1 TERMINATED by signal 11"

Hi,

This is a bug of nvfortran 24.3-0.

To reproduce it, run

git clone https://github.com/libprima/prima.git && cd prima/fortran/common && git checkout d86b5b29e12c81e5c52ddf2f5dfe20bac5725953 && nvfortran -c consts.F90

You will get

Cloning into 'prima'...
remote: Enumerating objects: 50310, done.
remote: Counting objects: 100% (1206/1206), done.
remote: Compressing objects: 100% (386/386), done.
remote: Total 50310 (delta 908), reused 1079 (delta 794), pack-reused 49104
Receiving objects: 100% (50310/50310), 20.58 MiB | 2.79 MiB/s, done.
Resolving deltas: 100% (40479/40479), done.
Note: switching to 'd86b5b29e12c81e5c52ddf2f5dfe20bac5725953'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at d86b5b29 240410.005928.HKT revise cmake.yml

nvfortran-Fatal-/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/compilers/bin/tools/fort1 TERMINATED by signal 11

Note:

  1. As in the last line of log above, the error is
    “nvfortran-Fatal-/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/compilers/bin/tools/fort1 TERMINATED by signal 11”, which seems to be an ICE.

  2. The code that reproduces the bug is publicly available on GitHub. (N.B.: Not the latest commit, but commit d86b5b29e12c81e5c52ddf2f5dfe20bac5725953).

  3. You can also download fortran/common/consts.F90 from the above address and trigger the bug by

nvfortran -c consts.F90
  1. The following line (Line 161) of the above code causes the error.
real(RP), parameter :: TINYCV = TEN**max(-60.0, -real(MAXPOW10))

Thank you for taking a look.

Thanks zaikunzhang,

I filed a problem report, TPR #35501, and sent it to engineering for investigation.

I did find that I can work around the error by using integers instead of reals as max’s arguments.

real(8), parameter :: TINYCV = TEN**max(-60, -MAXPOW10)

-Mat

Thank you Mat.

You are right. Indeed, I changed from integer exponent to real to circumvent another bug from another compiler, and then I found this one. See

https://github.com/libprima/prima/blob/285d2b1583d0cddbe58b66704bcb55d36079ea77/fortran/common/consts.F90#L158-L165

https://fortran-lang.discourse.group/t/flang-new-19-0-warning-overflow-on-power-with-integer-exponent/7801/3

For the flang warning, either add the “-r8” flag to change the default kind of reals to “8”, or set 10.0 to 10.0_8. The overflow is with the single precision real.

The flang warning has been confirmed as a bug:

https://github.com/llvm/llvm-project/issues/88151#issuecomment-2045874182

I use single precision on purpose. Thank you.

Sounds good, looks like Peter, our lead flang developer, is on it.

FYI, we’re one of the primary contributors to new flang which, once feature complete, will likely replace our nvfortran. So flang issues are of interest to us as well.

1 Like

FYI, we’re one of the primary contributors to new flang which, once feature complete, will likely replace our nvfortran. So flang issues are of interest to us as well.

Thank you for letting me know.

Indeed, I spotted a new bug in flang-new yesterday. See

Are you interested if I inform you about future bugs I spot in flang-new? If yes, what should I do? Should I creat a post here on this forum?

Thanks.

Are you interested if I inform you about future bugs I spot in flang-new?

It’s best to keep sending issues to them directly since it’s a community project and we’re not the only contributor.

I can help as well, but they are usually responsive.