- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort on Linux also supports -traceback.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page