Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Cannot get traceback info

Glynn_H_
Débutant
885 Visites

I am building my FORTRAN code with the -g, -check bounds and -traceback compile flags (and the -g and -traceback link flags) but am getting a failure with an error saying just "segmentation fault". No further information is provided, making the cause of the problem very hard to trace.

Are there any other options/flags I could try?

0 Compliments
5 Réponses
Glynn_H_
Débutant
885 Visites

I should also have clarified that the failure is at runtime; the code builds OK.

0 Compliments
Kevin_D_Intel
Employé
885 Visites

If you have not already, you might review Determining Root Cause of Segmentation Faults SIGSEGV or SIGBUS errors

(Perhaps a moderator can move your thread to the Fortran Linux forum also)

0 Compliments
mecej4
Contributeur émérite III
885 Visites

One situation in which inserting traceback code in your EXE fails to pinpoint the location of the error in your source code is the following: your code calls a routine in a compiled library which does not contain traceback code in it. If your problem falls into this category, it may be worth the effort to examine in detail the arguments being passed to the library routine(s).

If you do not make library function calls as described above, you could consider inserting extra WRITE statements in your program to locate  the place in your code where the root cause of the error may lie.

0 Compliments
Izaak_Beekman
Nouveau contributeur II
885 Visites

Usually, when I have unexplained segfaults and I haven't indexed into an out of bounds array, or done something else dumb, it is because I am exhausting the stack. On linux you can try `ulimit -s unlimited` or on linux and Mac pass the -heap-arrays flag to ifort. (Mac can't completely unlimit the stack size, there is some maximum that the OS will allow.)

Also, you say you compile with '-g -check bounds -traceback' but that you link with '-g and -traceback,' I'm wondering why you don't also link with -check bounds? I don't know whether it will make a difference, but -check bounds might be linking against some additional runtime intel libraries, and it can't hurt to pass it to ifort when you link.

One last question: Is your code mixed language or just Fortran?

0 Compliments
Glynn_H_
Débutant
885 Visites

Thanks for the advice everybody. I recompiled with the -heap-arrays flag and it seems to have resolved the problem. 

0 Compliments
Répondre