Cannot get traceback info

Cannot get traceback info

Ritratto di Glynn H.

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?

6 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Glynn H.

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

Ritratto di Kevin Davis (Intel)

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)

Ritratto di mecej4

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.

Ritratto di Izaak Beekman

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?

-Zaak
Ritratto di Glynn H.

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

Accedere per lasciare un commento.