From: byrne AT katie DOT vnet DOT net (Paul Byrne) Newsgroups: comp.os.msdos.djgpp Subject: Re: a rather strange error with global variables... Organization: Vnet Internet Access, Inc. - Charlotte, NC. (704) 374-0779 Lines: 27 Message-ID: <70mqdm$j5g$1@katie.vnet.net> References: <70k64a$gu$1 AT katie DOT vnet DOT net> <362E3F97 DOT 6B4816B1 AT alcyone DOT com> Date: 22 Oct 1998 04:29:42 -0400 NNTP-Posting-Host: 166.82.1.7 X-Trace: ralph.vnet.net 909044985 166.82.1.7 (Thu, 22 Oct 1998 04:29:45 EDT) NNTP-Posting-Date: Thu, 22 Oct 1998 04:29:45 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com >Paul Byrne wrote: > >> I've been getting some unusual errors with a program I'm writing. I >> was >> writing temporary code to help test some new classes. I included the >> following global variables ... >> and everything worked fine. However, simply changing the order ... >> causes problems. Everything compiles fine. Running produces a >> SIGSEGV. > >You're going to have to give us more information. Where is it crashing? >Have you debugged it? > >Likely you're overrunning a buffer, which, with the previous order, just >happens to allow the pointer to hit the next buffer, and so doesn't >cause a crash in one order, but does cause one in another. I'm definitely going to have to stop coding late at night... :) The error turned out to be in the class I was trying to test. A rather silly error was causing it to recurse indefinitely while working its way through memory from where it was supposed to be into my global arrays. With the variables in one order, it was running into values which halted the recursion. In the other case it simply ran out of stack space. Thanks to all those that helped! -paul