Subj : RE: Re: Possible FP87/EMU Problem? To : borland.public.cpp.borlandcpp From : kc Date : Wed Jan 14 2004 05:35 am I am working in a C & assembly enviromment. In this case can you let me know how can I check the size of stack so that I would not run into stack overflow situation. kc >"Wayne A. King" wrote in message >news:3ad23dde.4789130@newsgroups.borland.com... >> >> Are you building with the option to check for stack overflow enabled? >> Have you tried increasing the stack size via the _stklen variable? >> (Assuming it’s a DOS application.) >> > >We have the option checked for stack overflow. We never receive a stack >overflow error. I am going to put in some code to examine the stack area to >see how much we’re typically using. We have not increased the stack size >with the _stklen variable yet. > >That raises a question. How can you change the stack size at run time with >the _stklen variable, when it would seem that the compiler really needs to >know this during the link (i.e. it reserves a certain amount of area for the >stack). > >Yes, it is a DOS application. In fact it’s a real-time application that >communicates with a custom serial I/O board. It’s impossible to run with any >sort of debugger, given the nature of the hardware and software. And due to >the way the problem manifests itself, it’s been difficult to insert any >helpful code, since the simple insertion of a line of code often makes the >problem disappear. > >Get this - if I insert an empty 75 character array at the very end of our >software (it gets inserted by the linker at the end of bss, just prior to >the stack) the software appears to work fine. If I make it a 1 character >array, the software breaks. But if I make it a 1000 (or 2000, or 4096, or >almost anything else) character array, the software breaks too. Fooling the >linker into moving the stack around changes the problem, but it’s not >necessarily better when you move the stack a longer distance from our >application. > >We are certainly concerned about stack overflow, although it didn’t seem >likely since it seems it would have been caught due to the run-time stack >checking being enabled. I’ll be looking into that more tomorrow. We’re >running out of ideas, however. > >Thanks... > >Andy Johnson > > > > > Message sent from http://www.aewnet.com .