- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a very large fortran program. In the debug build the program works ok. In the release version the program stops between two inocuous wtite statemends with a returned code of -7. The program has suffered from zero indexed arrays but with the checke on in debug mode - they seem to be resolved . Has anyone any idea how to stop the release version stopping. There must be some corruption somewhere but how do you set about finding it when the debug version works OK.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>program stops between two inocuous wtite statemends with a returned code of -7
I'm afraid that this return code means nothing without more explanation. If it is based on internal checks in your code, you will have to look at the various ways in which that code can be triggered.
A program working with no apparent errors in debug mode and errors in release mode is most often a program with errors. It often happens that an error stays dormant until it becomes noticed when the program is run with new input.
Pinpointing the bug may be facilitated by ascertaining INTENT for subprogram arguments and specifying INTENT(IN) or INTENT(OUT), as appropriate. Sometimes a programmer writes a subprogram with certain INTENTs in mind but a later modification (perhaps by another programmer) may violate the INTENT assumed.
I'm afraid this is a time-consuming task, but with large programs such errors are not easily detected if tight control is not exercised when the first writing of code is done.
I'm afraid that this return code means nothing without more explanation. If it is based on internal checks in your code, you will have to look at the various ways in which that code can be triggered.
A program working with no apparent errors in debug mode and errors in release mode is most often a program with errors. It often happens that an error stays dormant until it becomes noticed when the program is run with new input.
Pinpointing the bug may be facilitated by ascertaining INTENT for subprogram arguments and specifying INTENT(IN) or INTENT(OUT), as appropriate. Sometimes a programmer writes a subprogram with certain INTENTs in mind but a later modification (perhaps by another programmer) may violate the INTENT assumed.
I'm afraid this is a time-consuming task, but with large programs such errors are not easily detected if tight control is not exercised when the first writing of code is done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks thats what i suspected - I have tried setting all the debug checks in but to no avail -
steve
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is new input - but not sure why debug version does not flag the error and just gives a successful run - whereas the release version just crashes out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like uninitialised variables could be a cause. IMPLICIT NONE is your friend here. try it and see.
Post some code that shows the problem and give the full error message
Post some code that shows the problem and give the full error message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Managed to find - The program has hundreds of subroutines and when compiling i overlooked a warning that the number of arguments of a subroutine called in one place was different from another place, this was the reason the release version crashed - whereas it was not picked up surprisingly on in the debug version
The program gave a problem on 18 out of 6000 cases - hopefully now resolved
The program gave a problem on 18 out of 6000 cases - hopefully now resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Fortran compiler has options to generate interfaces to subprograms and to check that the interfaces are followed correctly in calls. Not only the number of arguments but their types are checked and, furthermore, if you specify, INTENT.
You may wish to try the compiler with these options turned on on your code.
You may wish to try the compiler with these options turned on on your code.

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