I have a piece of code that is giving my a Segmenation Fault that I cannot track down. When I run in the gdb debugger and do a backtrace after the segfault I get:
#0 0x4014f1a6 in __utl_i_div64 () from /usr/pgi_old/linux86/5.2/lib/libpgc.so
#1 0x0807a03b in __hpf_i64toax ()
#2 0x0808c574 in conv_int8 ()
#3 0x0808c39a in __hpfio_fmt_i8 ()
#4 0x0808ba06 in __hpfio_default_convert ()
#5 0x08075798 in _f90io_ldw ()
#6 0x08075999 in pgf90io_ldw ()
#7 0x0804bf3a in clustering_module_kfof () at clustering.f:227
So the actual error is occurring in libpgc.so. I can’t find any documentation or any way to track this down further. Compiling with ‘-Mbounds’ gives me nothing. I will not be surprised if the error is resulting from some bug in my code, but since the actual segfault is in a PGI library, I don’t know how to proceed with debugging.
The ‘kfof’ subroutine is a recursive routine in a module called ‘clustering_module’ found in the source file ‘clustering.f’. By the time in the code that it segfaults, it has already successfully called kfof recursively hundreds of thousands of times. In fact, given a slightly different data set to process, this code successfully runs with over over 8M calls to this routine.
This code was compiled using pgf90 5.2-2 on a machine running Suse Linux - 18.104.22.168-suse91-i4smp
If anyone can help, I would be extremely appreciative.