From: "Lars O. Hansen" Newsgroups: comp.os.msdos.djgpp Subject: Re: problem with malloc and free Date: Sun, 15 Dec 2002 08:46:15 +0100 Organization: 1&1 Internet AG Lines: 39 Message-ID: References: <000001c2a37a$59f41060$186a10ac AT citechbd DOT com> <3277-Sun15Dec2002000831+0200-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: p508380f8.dip0.t-ipconnect.de X-Trace: news.online.de 1039938376 21709 80.131.128.248 (15 Dec 2002 07:46:16 GMT) X-Complaints-To: abuse AT online DOT de NNTP-Posting-Date: 15 Dec 2002 07:46:16 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > > Crashes inside `free' or `malloc' usually mean that your program > > overwrites buffers allocated with `malloc' and thus destroys hidden > > data about the heap stored by `malloc' at both ends of the buffer it > > allocates. > > > > So you need to look for such bugs in your program. > > in fact, they are pretty easy to locate. see my earlier response to the > OP. ok, hopefully this is it. *thanks*. ... Yes it might have been this. :-) So, I did sth. like int *a=malloc(sizeof(int)*360); then I can access the 360th int element by a[359] ? I thought [359] with non-ststic arrays addresses the 360th byte in C. (it's always taking long for me to adapt again... (I might have done this mistake not the first time...)) A question (to Eli): after i corrected that mistake and compiled for the first time and run the program, it crashed again. then i compiled again and it didn't crash. then I compiled many more times to make sure and it didn't crash. I am working in A DOS box under Win 98. Could there be some sort of caching "issue" which makes djgpp use the not just saved file or WIndows to execute the not new compiled version but the old one ? Lars