From: invalid AT erehwon DOT invalid (Graaagh the Mighty) Newsgroups: comp.os.msdos.djgpp Subject: Re: Peculiar behavior of program. Organization: Low Charisma Anonymous Message-ID: <3b3b45b2.211225390@news.primus.ca> References: <3b37e2d6 DOT 287121289 AT news DOT primus DOT ca> <3B38EF9E DOT 4FA60697 AT phekda DOT freeserve DOT co DOT uk> X-Newsreader: Forte Free Agent 1.11/32.235 Lines: 40 Date: Thu, 28 Jun 2001 14:58:33 GMT NNTP-Posting-Host: 207.176.153.107 X-Complaints-To: news AT primus DOT ca X-Trace: news2.tor.primus.ca 993740362 207.176.153.107 (Thu, 28 Jun 2001 10:59:22 EDT) NNTP-Posting-Date: Thu, 28 Jun 2001 10:59:22 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 26 Jun 2001 21:25:02 +0100, Richard Dawe sat on a tribble, which squeaked: >Hello. > >Graaagh the Mighty wrote: >> > That would require to use a separate selector for the stack (because >> > the stack is expand-down, and so needs a special segment setup for >> > detecting stack overflows). This is possible, but has a serious >> > problem: you cannot use -fomit-stack-pointer, because the EBP register >> > will trigger a GPF if loaded with a value larger than the stack size. >> >> That suggests to make such a scheme be used when code is compiled with >> -g and not -fomit-frame-pointer. If stack smashage is suspected, the >> programmer can just use -g and disable -fomit-frame-pointer. >[snip] >> When it's debugged, they can turn the optimization back on for making >> the production code. > >So you want different behaviour when compiled with -g and without? Of course not. Not in the sense of changing the semantics of a correct program. But the semantics of an incorrect program are undefined anyway, and plenty of Scroedinbugs disappear when the debugger is used anyway. Here I'm looking for the use of debugging to actually make the bugs easier to detect, which sure seems sensible given that we are, after all, talking about debugging. >Have you tried putting a limit on the recursion in your program, to see >whether that stops the stack overflow? Maybe that would at least help you >debug? I haven't gotten around to it yet: I've been too busy with Usenet lately. It seems every time I log on there's a zillion followups to my postings, and most of them demand some kind of a response... -- Bill Gates: "No computer will ever need more than 640K of RAM." -- 1980 "There's nobody getting rich writing software that I know of." -- 1980 "This antitrust thing will blow over." -- 1998 Combine neo, an underscore, and one thousand sixty-one to make my hotmail addy.