delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/02/13:40:19

Date: Wed, 2 Feb 2000 18:09:44 +0100 (MET)
From: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
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: <Pine.UW2.3.95.1000202180736.19036C-100000@bryggen.bgnett.no>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019