Date: Wed, 2 Feb 2000 18:09:44 +0100 (MET) From: Gisle Vanem To: djgpp AT delorie DOT com Subject: Re: page fault and prob. w/ free() In-Reply-To: <879l3i$m61$1@news.d.umn.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 2 Feb 2000 deisenzi AT d DOT umn DOT edu wrote: > I am causing a run-time error in the form of a page fault. I thought > a page fault was a miss on the cache so I am not sure how I'm causing > it but the offending line of code is... > free(data_buffer); > > where data_buffer has been declared as follows... > unsigned char *data_buffer; > > and allocated memory using malloc() before free is called. > > any suggestions of why free() wouldn't be working? It 99% certain that you overwrite some memory in front of 'data_buffer'. free/malloc uses an small area there for various "house-keeping". > > thanks, > Darren > Gisle V.