- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
When one of my library project is set as Release, error shows:
"cannot allocate memory for the file buffer-out of memory, unit 12, fort.88".
But when I set it to Debug mode, it can be run.
That part of generating "fort.88" is a system call to run a *.exe which was generated by CVF.
Does this matter? or any suggestion?
ps. I use IVF11.0.66
Mike
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DId you check whether increasing the stack allocation in the .exe, by /link /stack:nnnnnnn option or by editbin, will resolve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing a test case all I can do is guess, and what I would guess is that your program is corrupting memory somewhere. The "where" would naturally differ between an unoptimized and optimized version due to data layout and instruction differences. I don't even know what operation your program is doing to trigger this error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing a test case all I can do is guess, and what I would guess is that your program is corrupting memory somewhere. The "where" would naturally differ between an unoptimized and optimized version due to data layout and instruction differences. I don't even know what operation your program is doing to trigger this error.
Now, the memory allocation error is disappeared.
I missed settings for Release: Fortran-> Additional Include Directories and Linker->Additional Dependencies.
I also missed settings fortran->Compatibility->Powerstation i/o format (yes), since I use unformatted i/o.
After I set these as Release for my two static libraries and also main project, I rebuild and rerun it, errors are :
end-of-file during read, ........fort.88
If I set two static libraries as Release and set Debug for main project, it can work well.
I have tried the all cases :
MyLibrary Main RunningWell?
Debug Debug Yes
Debug Release fail
Release Debug Yes
Release Release Fail
In other words, main project needs to be set as Debug. But why? I mean the fort.88, failed to be read and thus having the "end-of-file error during read " error message, is read by some subroutine of MyLibrary project. Isn't this error message nothing with MainProject?
As I said I set fortran->Compatibility->Powerstation i/o format (yes), since I use unformatted i/o. In that subroutine, it is like:
subroutine ReadMyOutput(io_unit,fn_MyOutput,....)
.....
read(io_unit)ref
if(present(sdtr))then
read(io_unit)sdtr
read(io_unit,end=1)piz
end if
1 return
end subroutine ReadMyOutput
The calling program is
open(io_unit,file=trim(fn_MyOutput),status='old',action='read',form='unformatted')
I remember, I do usually have some end-of-file reading error when I have the unformatted-read.
Besides, in CVF I need to set fortran->Compatibility->Powerstation i/o format (yes). Sometimes, I forgot to set this and spend hours to debug.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid I still don't follow this. Are you reading files that were written by Microsoft Fortran PowerStation? That's the only time you should be setting that PowerStation I/O compatibility option.
I could see that if you set this and read a non-FPS file, or didn't set it and did read a FPS file, that you could get memory errors as the run-time library would misinterpret record lengths.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid I still don't follow this. Are you reading files that were written by Microsoft Fortran PowerStation? That's the only time you should be setting that PowerStation I/O compatibility option.
I could see that if you set this and read a non-FPS file, or didn't set it and did read a FPS file, that you could get memory errors as the run-time library would misinterpret record lengths.
I did have some old *.exe compiled by PowerStation. After recompiling by IVF and setting PowerStation i/o format into Default(no), there is no error message now. The problem I had before is due to the unconsistency you mentioned.
Thank you for the help.
Mike
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page