Hello,
I have set PGI_TERM to be trace on my tcsh. But when my pgf90 program crashes with a floating point error (division by zero) it does not tell me the line number where that problem occurred. How do I turn that on ?
pgif90 version is 17.4 and OS is Ubuntu 16.04 LTS.
pgf90 -O0 -c -g -traceback -Ktrap=inv,denorm,divz,ovf,unf ${tool}.f
This is how I compiled it. But when I run it I get something like -
rror: floating point exception, integer divide by zero
rax 00007fea082c16b0, rbx 00007fea082c12c8, rcx 00007fea00b4ce68
rdx 00007fea00b89ef0, rsp 00007ffdf3611220, rbp 00007ffdf3611480
rsi 00007fea029578f8, rdi 00007fea02957ce0, r8 00007fea04725ad0
r9 00007fea064f38c8, r10 00007fea08284620, r11 00007fea082fe740
r12 00007fea082c1a98, r13 0000000000000009, r14 000000000000004c
r15 00007fea082c1320
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7fea0cf9a390]
/home/inv_cart() [0x40f886]
/home//inv_cart() [0x40e665]
/home/inv_cart() [0x40693e]
/home/nv_cart() [0x404664]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7fea0c3eb830]
/home/inv_cart() [0x404549]
Any suggestions ?
MS.
Hello,
I’m trying to get some legacy code to not crash and burn with the PGI compiler, and I came across a stack overflow post (edit: this one ) that recommended a so-called “maximum debug” collection of compiler options for gfortran:
-O2 -fimplicit-none -Wall -Wline-truncation -Wcharacter-truncation -Wsurprising -Waliasing -Wimplicit-interface -Wunused-parameter -fwhole-file -fcheck=all -fbacktrace
What are the PGI equivalents to most of these?
-O2: -O2
-fimplicit-none: -Mdclchk?
-Wall: …
I did take a look at this thread and I added the option -Meh_frame to the linker line which I presume is this
pgf90 -Meh_frame -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
But this just gives the same information. No line number yet.
tull
June 28, 2017, 3:44pm
3
Hello,
We recreated the issue with this
ubuntu1604% more trap.f90
program mike
real(8) x,y, z
x = -1.0d0
z = 123456789.0d0
y = x * 10.d0 * log10(x)
z= exp(z)
y=1.0d0 /(x + 1.0d0)
print *,'x & y & z= ', x, y, z
stop
end program mike
ubuntu1604% pgfortran -g -Ktrap=fp trap.f90 -Meh_frame
ubuntu1604% setenv PGI_TERM trace,debug
ubuntu1604% a.out
Error: floating point exception, integer divide by zero
PGI Debugger 17.4-0 x86-64 (Cluster, 256 Process)
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
Loading symbols from /home/tull/xfer/tprs/uf/metstudent/jun2817/a.out …
ERROR: CANNOT ATTACH TO PID 3028.
Attach fails: ubuntu1604:3028 (/home/tull/xfer/tprs/uf/metstudent/jun2817/a.out)
We have filed two TPRs
24455 - about not knowing the line number of the fp trap event.
24456 - about not knowing where the f90 source file is.
Sorry to ask a noob question - I just have to wait for a new release when this gets fixed ? Or will there be a patch that I can install over the existing install ?
Hello,
We recreated the issue with this
ubuntu1604% more trap.f90
program mike
real(8) x,y, z
x = -1.0d0
z = 123456789.0d0
y = x * 10.d0 * log10(x)
z= exp(z)
y=1.0d0 /(x + 1.0d0)
print *,'x & y & z= ', x, y, z
stop
end program mike
ubuntu1604% pgfortran -g -Ktrap=fp trap.f90 -Meh_frame
ubuntu1604% setenv PGI_TERM trace,debug
ubuntu1604% a.out
Error: floating point exception, integer divide by zero
PGI Debugger 17.4-0 x86-64 (Cluster, 256 Process)
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
Loading symbols from /home/tull/xfer/tprs/uf/metstudent/jun2817/a.out …
ERROR: CANNOT ATTACH TO PID 3028.
Attach fails: ubuntu1604:3028 (/home/tull/xfer/tprs/uf/metstudent/jun2817/a.out)
We have filed two TPRs
24455 - about not knowing the line number of the fp trap event.
24456 - about not knowing where the f90 source file is.
tull
June 28, 2017, 6:35pm
5
Releases come out 8-10 times a year. Next (17.7) is in July.
If you are using the Community Edition, the next version will not
be out until October.
Until it is fixed and in a release, the problem will remain.
Running the program in pgdbg, and setting break points, should
allow you to zero in on where the problem happens.
dave