How to print a human-readable backtrace with nvfortran
when an exception occurs?
First of all, let me acknowledge that this question is better asked on the NVIDIA Developer Forum. However, I cannot log in the forum because the verification email takes an eternity to arrive. So I try here in case someone knows the answer.
Here is a minimal example.
! test.f90
program test
implicit none
real :: a
a = tiny(a)
write (*, *) 1.0 / (a**2)
end program test
According to the nvfortran
manual, I do the following.
$ uname -a && nvfortran --version
Linux 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
nvfortran 22.11-0 64-bit target on x86-64 Linux -tp zen2
NVIDIA Compilers and Tools
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
$ export NVCOMPILER_TERM=trace && nvfortran -g -Kieee -Ktrap=divz test.f90 && ./a.out
Error: floating point exception, floating point divide by zero
rax 0x0000000000000000, rbx 0x00007fff3100e178, rcx 0x0000000000000000
rdx 0x0000000000000000, rsp 0x00007fff3100e030, rbp 0x00007fff3100e040
rsi 0x00007fb93c4fbf50, rdi 0x0000000000000006, r8 0x0000000000004240
r9 0x0000000000004100, r10 0x00007fb93be156d0, r11 0x00007fb93bee3640
r12 0x00007fff3100e178, r13 0x0000000000401200, r14 0x0000000000403d98
r15 0x00007fb93c573040
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7fb93a41a520]
./a.out() [0x401233]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fb93a401d90]
/usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fb93a401e40]
./a.out() [0x401125]
Am I supposed to read and understand the above-printed backtrace or did I overlook something?
Thanks.