replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Stack overflow - relink program with bigger stack value
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 - relink program with bigger stack value

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



Joined: 02 Aug 2005
Posts: 320

PostPosted: Tue Nov 22, 2011 5:09 pm    Post subject: Stack overflow - relink program with bigger stack value Reply with quote

OK, so I'm getting the above error and have tried to increase the stack to no avail. I've tracked the crash to a call which never gets to the subroutine - the crash occurs when I try to "step into" the subroutine under the debugger. The subroutine has two integer arrays as arguments, one dimensioned (0:3), the other (4).

The "calling stack" when it crashes looks OK, arguments seem to match all the way "down the tree".

I have tried:

1 removing the arrays from the call and subroutine lines, just in case it didn't like the (0:3)
2 moving the call to another part of the calling routine
3 moving the subroutine from its natural home source file to the same source file as the call, because I couldn't think of what else to do!

What else can I try?

TIA

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 23, 2011 9:08 am    Post subject: Reply with quote

First two thoughts:

1) Does it depend on using /checkmate etc.

2) What happens if you remove the call. i.e. has the problem already occured before this point in the code.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 320

PostPosted: Wed Nov 23, 2011 9:57 am    Post subject: Reply with quote

Hi Paul,

I don''t use /checkmate, only /debug or /undef (or nothing) and the results are the same, either the crash message above when just running the app, or the equivalent (exception 0XC00000FD in "adjust stack") when under the debugger.

If I remove the call, execution continues normally (although the functionality normally provided by the subroutine means that the program won't progress much further!).

K
Back to top
View user's profile Send private message Visit poster's website
KennyT



Joined: 02 Aug 2005
Posts: 320

PostPosted: Wed Nov 23, 2011 11:00 am    Post subject: Reply with quote

OK, found it. In the subroutine I had a TYPE statement for an unused structure, CO:

TYPE (CONSL) :: CO

if I either comment it out or change it to:

TYPE (CONSL),POINTER :: CO

The crash does not occur!

What I don't understand is, if I'm not currently using "CO" in that subroutine, why does how it's defined make such a difference? What if I want to start using it soon (which his why the definition was in there in the first place!)?

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 23, 2011 11:04 am    Post subject: Reply with quote

The pointer only uses 4 bytes of memory whilst the other depends on the size of the structure. Maybe the structure is not defined correctly.
Back to top
View user's profile Send private message AIM Address
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