Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Can't generate core file on floating point exceptions (div by zero)

elazarus
Beginner
457 Views

Documentation claims setting environment variable (whose name I don't have with me) is sufficient to have core dumps generated on "serious" errors. I have set the environment variable, but I am not getting core dumps on zero divides. Is the environment variablelooked at at compile time or run time? It was not set when the main program was compiled.

0 Kudos
2 Replies
Kevin_D_Intel
Employee
457 Views

Perhaps you are suffering from the shell limit for core file size/coredumpsize. Depending on your working shell, look at the limits with:

ulimit a (for Bash/ksh) -OR- limit (for tcsh/csh)

If the core file size/coredumpsize limit is 0, then no core file will be created. Try setting it to unlimited with either:

ulimit c unlimited (for Bash/ksh) -OR- limit coredumpsize unlimited (for tcsh/csh)

What is the environment variable that you are referring to?

0 Kudos
Kevin_D_Intel
Employee
457 Views

It may be possible to locate the source of the divide by zero using the traceback fpe0 g options. Note that g implies O0, so you may need to also add O2 if a O{n} is not already explicitly asserted.

Here is a simple example:

$ ifort -V -g -traceback -fpe0 sample.f90

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20080930 Package ID: l_cprof_p_11.0.069

Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

Intel Fortran 11.0-1549

GNU ld version 2.16.91.0.5 20051219 (SUSE Linux)

$ ./a.out

forrtl: error (73): floating divide by zero

Image PC Routine Line Source

a.out 0000000000402B64 subby_ 8 sample.f90

a.out 0000000000402B37 MAIN__ 2 sample.f90

a.out 0000000000402AFC Unknown Unknown Unknown

libc.so.6 00002B18326A8154 Unknown Unknown Unknown

a.out 0000000000402A29 Unknown Unknown Unknown

Aborted

Sample.f90

=======

[cpp]      program sample
      call subby
      end

      subroutine subby
      a = 1.d0
      c = 0.d0
      d = a/c
      end
[/cpp]

0 Kudos
Reply