forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Stack overflow with /CHECKMATE

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
sigment



Joined: 17 Dec 2007
Posts: 9

PostPosted: Sun Jan 13, 2008 9:10 am    Post subject: Stack overflow with /CHECKMATE Reply with quote

Hi,

I'm trying to see if I can use the great-sounding FTN95 /CHECKMATE dynamic testing support with a mid-size (55K LOC) legacy Fortran 77 application but with no luck so far. No matter how large I seem to make the stack I still get a stack overflow, and increasing the stack gives very long startup times.

My current build BAT file includes this:

ftn95 /NO_BANNER /132 /ALT_KINDS /COLOUR /ERROR_NUMBERS /NO_OBSOLETE /P6 /SAVE /FULL_DEBUG /CHECKMATE %F95Source% %2 %3 %4

slink %F95Object% -stack:0x25600000,0x16000

As you can see the stack size I'm trying now is quite large. The Intel Visual Fortran debug build uses <30MB peak in a run. Removing /CHECKMATE and even /FULL_DEBUG doesn't seem to help and the memory use was over 300MB when it ran out of stack.

The program has almost 200 COMMON blocks that are declared in the MAIN, some of which are initialized in BLOCK DATA units. I assume that it is the initialization of all the globals that is giving the long startup times. Maybe there is some way to restructure the code to reduce the stack needed and the startup time. Or maybe there is a known problem with FTN95 causing this?

Thanks!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7928
Location: Salford, UK

PostPosted: Sun Jan 13, 2008 5:40 pm    Post subject: Reply with quote

Are you sure that you need the /SAVE command line option.
This could bump up the memory requirements dramatically.
If you need to SAVE some local variables and arrays then do this in context using a Fortran SAVE command locally.

(For information about the effect of the Fortran SAVE command, see a standard Fortran text book.)
Back to top
View user's profile Send private message AIM Address
sigment



Joined: 17 Dec 2007
Posts: 9

PostPosted: Sun Jan 13, 2008 7:32 pm    Post subject: Reply with quote

Paul, thanks for the quick response. Right now /SAVE is required but I agree that using explicit SAVE declarations in the code is preferred and I plan to migrate the code to that over time (I didn't author this code).

Unfortunately, removing /SAVE as well as /FULL_DEBUG and /CHECKMATE doesn't help anyway: it goes up to 300+MB and then I get a stack overflow error. Can you think of anything else that could be causing this?

Thanks.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7928
Location: Salford, UK

PostPosted: Mon Jan 14, 2008 8:53 am    Post subject: Reply with quote

It is possible that the "virtual common" command in SLINK may help.
Back to top
View user's profile Send private message AIM Address
sigment



Joined: 17 Dec 2007
Posts: 9

PostPosted: Mon Jan 14, 2008 10:01 am    Post subject: Reply with quote

Thanks, but it seems as though virtual common wouldn't be compatible with /CHECKMATE since I assume you have to initialize all COMMON variables in order to detect use of them when uninitialized. And my whole reason for trying FTN95 is for /CHECKMATE. Am I wrong about this?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7928
Location: Salford, UK

PostPosted: Mon Jan 14, 2008 2:07 pm    Post subject: Reply with quote

As far as I can tell you should have no problem even if you are using a BLOCK DATA program unit. As far as the linker is concerned, all data is uninitialised.
Back to top
View user's profile Send private message AIM Address
sigment



Joined: 17 Dec 2007
Posts: 9

PostPosted: Mon Jan 14, 2008 8:07 pm    Post subject: Reply with quote

Thanks Paul. With -VC it now runs with /CHECKMATE and /FULL_DEBUG with modest memory use! I'll give it a workout next week and see how it does.

Thanks for all the help.
Back to top
View user's profile Send private message
sigment



Joined: 17 Dec 2007
Posts: 9

PostPosted: Fri Jan 25, 2008 5:35 am    Post subject: Reply with quote

Well I spoke too soon. After making a few minor changes to the app the stack overflow is back, despite using -vc with slink and no matter how large I make the stack.

I wanted to purchase a FTN95 license and use it for its testing support but unless this is really fixable I'm going to have to go another route. I'd be happy to try a patched version and to work with support to find a fix.

Anyone have any ideas?

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group