- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I am dealing witha subtle bug in a code I am developing with Intel fortran on Linux. I am receiving a segmentation fault on a write(*,*) statement. This statement is the first line of a subroutine. I know that the memory issue is probably not there. In fact when I remove that write statement or do not call that subroutine everything seems fine. The problem could be anywhere in the code, but how to pin it down? I tried with the -CB option on all the executables when compiling but nothing is noticed by ifort. Also, I cannot gather extra information from the debugger idb. Any hints much appreciated!
Cheers
AB
I am dealing witha subtle bug in a code I am developing with Intel fortran on Linux. I am receiving a segmentation fault on a write(*,*) statement. This statement is the first line of a subroutine. I know that the memory issue is probably not there. In fact when I remove that write statement or do not call that subroutine everything seems fine. The problem could be anywhere in the code, but how to pin it down? I tried with the -CB option on all the executables when compiling but nothing is noticed by ifort. Also, I cannot gather extra information from the debugger idb. Any hints much appreciated!
Cheers
AB
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure that the subroutine is called correctly (correct number/shape of arguments)? If it's not in a module, try compiling with
-gen-interfaces -warn interfaces
to make sure the routine is called as expected.
Generally seg. faults at really strange lines inside of subroutines indicate it's not being called correctly by passing arrays that are the wrong size/shape or the wrong number of arguments.
Tim
-gen-interfaces -warn interfaces
to make sure the routine is called as expected.
Generally seg. faults at really strange lines inside of subroutines indicate it's not being called correctly by passing arrays that are the wrong size/shape or the wrong number of arguments.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's possible to overflow stack upon entry to a subroutine, particularly if arrays are going on stack (recursive/auto/parallel compatible mode). I don't see how you can "know" that it's probably not a memory issue, without investigating. Did you check the specific writeup on the subject at the top of the forum?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi tim18, if you read my post I didn't say that. I just said that maybe the meory problem is not in the subroutine but somewhere else.
I did compile with -gen interface -warn interface, always do...
I did compile with -gen interface -warn interface, always do...
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