- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am debugging a console application.
I have the Fortran/Run time/Check array bounds and strings turned ON.
I have the Fortran/Run time/Generate Tracebacks turned ON.
In the debugger, the code breaks and I get a message that array bounds have been overstepped, but I don't get the line number and name of offending routine.
Is there something else that should be turned on?
Thanks,
Brian
Austin, TX
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have DEBUG turned on in the linker?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look for the console window, which is probably hiding "behind" the debugger window. Although, as Linda suggests, if you're running in the debugger, click Break when the message appears and you'll be taken to the line where the error occurred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think so.
Generate Debug Info is Yes
Generate Program Database File is set to a pdb file
Generate Map file is NO
Map Exports is NO
Debuggable Assembly is NO Debuggable attr. emmitted
Is there an easy way to paste into a forum post a screen capture image?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right click on consol window title bar. Select "Select All" and press Enter to copy all of console windoe to paste buffer, or Select "Mark", mark with mouse, press Enter to copy to selected text paste buffer. Then in the forum edit box for messages:
{left square bracket}bash{right square bracket}
(Ctrl-V to paste)
{left square bracket}/bash{right square bracket}
You can try {left square bracket}plain{right square bracket}
(paste)
{left square bracket}/plain{right square bracket}
but that may use variable pitch font. bash is fixed pitch.
When pasting one of the supported language code snips use those.
Only use screen shots when no other option is available.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am running in the VS2012 debugger.
When the code runs VS displays a message "mycode.exe has triggered a breakpoint.
In the console window I see the message about the array bounds problem that names the offending array but not the routine and line number.
I pressed control-break on the keyboard but that didn't do anything.
Thanks,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was trying paste in a screen capture of part of the Project Options/Linker/Debugging window. Since I couldn't do that, I typed some of the setting directly into the post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The message box should also have information as to what to press to enter debugging. (usually Continue)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I clicked the "break" button, and that brings on a "no source available" window and I can't find the line of my program where the break occured. That is the heart of my problem. If instead click "continue" this stops the debugger and closes the console window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, look for the console window in your taskbar tray. This will have both the error message and the traceback. It sounds to me as if you enabled bounds checking and traceback for a Release configuration - is that true? You'll also need to make sure that Linker > Enable Incremental Linking is set to "No".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
forrtl: severe (408): fort: (3): Subscript #1 of the array PM_RATIO has value -1 which is less than the lower bound of 0
Other than the program's own writing to the console window, the above is what shows up. There is nothing else. If I can't get the traceback info, my only recourse is to go digging through mountains of code looking for the place where that particular array is going out of bounds. After this one there's likely to be more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are in a release configuration, you also have to turn on debugging in the Linker section. As I indicated before.
Not sure how it is in VS2012 - Properties - Linker - Debug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I forgot to say that, yes, I am debugging with the debug configuration as the "active" configuration. This is VS2012 and IVF Composer XE 2013.
I should point out that after I execute the code enough times, I suspect that VS may become unstable such that it won't build the project after I make a code change. Restarting VS gets it working again.
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are times when all I get is the following in the console window:
forrtl: severe (179): Cannot allocate array - overflow on array size calculation . Image PC Routine Line Source libifcoremdd.dll 002AFA8A Unknown Unknown Unknown
This doesn't give me much to go on. This ought to be from doing an ALLOCATE with invalid sizes. How do I get Intel Fortran to tell me where the problem is occurring?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, two suggestions. When you get the "break", can you check the CallStack window? The actual "breakpoint" is happening in the Fortran run-time code, but that, of course, is called from your code. Can you see any of your routines in the call stack?
The other suggestion is slightly off-the-wall, but is there *any* chance that you have the environment variable FOR_DISABLE_STACK_TRACE set? That does just what it sounds like, and disables the lengthy stack trace.
--Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the call stack window I see the normal stuff until the break happens, then all that is there is:
> libifcoremdd.dll!<Unknown function> Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for libifcoremdd.dll]
libifcoremdd.dll!<Unknown function> Unknown
libifcoremdd.dll!<Unknown function> Unknown
How do I check the environment variable? I opend a command promptt window and typed SET and I see several Intel Fortran items and several IMSL items, but not the one you named.
Something must be really messed up. It shouldn't be so hard to get the fortran program to tell me what line is causing the error. Is there anything else that might need to be turned ON or turned OFF to get this? Is this a Visual Studio problem or an Intel Fortran problem? I have no clue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It could be that your program has corrupted the stack - this could trigger such errors and also interfere with traceback. Try a simple program in a new project that deliberately gets an array bounds error and you'll see what it should look like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Writing outside the bounds of an array, mismatched routine arguments, incorrect use of pointers, calling STDCALL routines with the C convention and vice-versa. Have you tried turning on the Run-time > Check stack frame option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page