delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/18/17:30:38

Message-ID: <35D9EFC5.B567651D@sympatico.ca>
From: Mike Stoddart <stodge AT sympatico DOT ca>
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: tracking down runtime error
References: <m0z8qdr-000S4AC AT inti DOT gov DOT ar>
Lines: 80
Date: Tue, 18 Aug 1998 21:19:50 GMT
NNTP-Posting-Host: 206.47.27.130
NNTP-Posting-Date: Tue, 18 Aug 1998 17:19:50 EDT
Organization: Bell Solutions
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

are you sure that the last node in the linked list has its "next" variable set
to null?

Salvador Eduardo Tropea (SET) wrote:

> "John Spence" <jspence AT lynx DOT net DOT au> wrote:
>
> > Using the following code to display the contents of a linked list with
> > DJGPP  (gcc2721b)
> >
> > void traverse(NODEPTR start)
> > {
> >   while(start)
> >   {
> >     printf("%d\n", start->number);
> >     start = start->next;
> >   }
> > }
> >
> > I get the error which follows during runtime.  I can run this program
> > without a problem under Linux with gcc and DOS with Turbo C so I am
> > 99% confident that this is not a problem with my code.
> >
> > Cany anyone help me pinpoint the cause of this error with DJGPP/gcc
> > (dos) or refer me to a doc that will.
> >
> >
> > The values that should have been displayed are 5, 4, 3, 700, 900, 100
>
> As you don't provide the program we can only make a wild guess.
>
> > ====== start of program output ==================
> > 5
> > 4
> > 3
> > 700
> > 134744064
>
> Here the program is out-of-control, I guess you are just corrupting the heap
> and overwriting the node that contains 900, as the whole node is corrupted
> the pointer is crap and when you try to use it:
>
> > Exiting due to signal SIGSEGV
> > General Protection Fault at eip=000016ab
> > eax=08080808 ebx=0004f120 ecx=00000000 edx=08080808 esi=00000054
> > edi=0000dac0
> > ebp=0004da7c esp=0004da7c program=D:\UNITEMP\C\PRAC3A.EXE
> > cs: sel=00af  base=82cc9000  limit=0006ffff
> > ds: sel=00b7  base=82cc9000  limit=0006ffff
> > es: sel=00b7  base=82cc9000  limit=0006ffff
> > fs: sel=0087  base=0000af90  limit=0000ffff
> > gs: sel=00c7  base=00000000  limit=ffffffff
> > ss: sel=00b7  base=82cc9000  limit=0006ffff
> >
> > Call frame traceback EIPs:
> >   0x000016ab
> >   0x00001619
> >   0x00001c5e
>
> Run symify to make it better ;-)
>
> So: try to isolate what part of your code makes it. Just cut all the code
> that could make it and try again. The process is tedious but works. Do it
> like a binary search, I mean, cut all the code if works enable half if fails
> restrict the search to this half, etc
>
> SET
> ------------------------------------ 0 --------------------------------
> Visit my home page: http://set-soft.home.ml.org/
> or
> http://www.geocities.com/SiliconValley/Vista/6552/
> Salvador Eduardo Tropea (SET). (Electronics Engineer)
> Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
> ICQ: 2951574
> Address: Curapaligue 2124, Caseros, 3 de Febrero
> Buenos Aires, (1678), ARGENTINA
> TE: +(541) 759 0013



)25$2D1)4B4O:6YC;'5D93LE1$I$25(E+VQA;F<O;V)J8PT*#0I;9V-C70T*
M0T]-4$E,15)?4$%42#TE+SX[0T]-4$E,15)?4$%42"4E1$I$25(E+V)I;@T*
M3$E"4D%265]0051(/24O/CM,24)205)97U!!5$@E)41*1$E2)2]L:6([)41*
M1$E2)2]C;VYT<FEB+V=R>#(P+VQI8 AT T*#0I;:6YF;UT-"DE.1D]0051(/24O
M/CM)3D9/4$%42"4E1$I$25(E+VEN9F\[)41*1$E2)2]G;G4O96UA8W,O:6YF
M;PT*24Y&3U]#3TQ/4E,],'@Q9BXP>#,Q#0H-"EME;6%C<UT-"DE.1D]0051(
M/24O/CM)3D9/4$%42"4E1$I$25(E+VEN9F\[)41*1$E2)2]G;G4O96UA8W,O
M:6YF;PT*#0I;;&5S<UT-"DQ%4U-"24Y&350]*FL\)5@^#0I,15-30TA!4D1%
M1CTX8F-C8V)C8S$R8F,U8CDU+F(Q,C<N8 AT T*3$534STE3$534R4@+6 AT U)'DU
M)$1D,BXP)$1U,30N,"1$<S0N-R1$:SDN,"0-"@T*6VQO8V%T95T-"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