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

segmentation fault

zengsong79
Beginner
246 Views
Hi, all
My Fortran program has a "segmentation fault" now. I do not have a clue where it happens. I use Visual Fortran and also have ifort compiler on the Linux cluster. Does anyone know how to track which line has the problem with the available debugging function? Any short reference will be very helpful. All your help will be highly appreciated.

Qing
0 Kudos
2 Replies
TimP
Honored Contributor III
245 Views
Any basic introduction to the debugger of your choice should cover this in the first 2 paragraphs. For example,
ifort -g -O -check yourapplication.f
idb yourapplication
r
The worst that can happen is that you must find the line number where it seg faults, start idb over again, and set a break point somewhat ahead of the failure, so you can examine values up to the failure.
I specified -O in the compilation, because by default the -g option sets -O0. You might try first with -O0, as it will be easier to trace execution. I suggest -check as such problems often are caught by the aggressive checking.
If you are lucky, with Windows ifort you might be able to find the failure line simply by adding /traceback /check to your compile options, running even without debugger.
0 Kudos
Steven_L_Intel1
Employee
245 Views
ifort on Linux also supports -traceback.
0 Kudos
Reply