Cannot get traceback info

Cannot get traceback info

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 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

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)

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.

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?

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today