From: winalski@adserv.enet.dec.com (Paul S. Winalski)
Subject: Re: VMS free() broken -- the saga continues
Date: Fri, 25 Sep 1992 16:59:37 GMT [thread overview]
Message-ID: <1992Sep25.165937.29035@nntpd2.cxo.dec.com> (raw)
In-Reply-To: hansg.717412853@risken
In article <hansg.717412853@risken>,
hansg@risken.vd.volvo.se (Hans Granqvist) writes:
|>
|>Has anyone encountered this problem?
|>A malloc() succeeding another malloc() returns a pointer to an area
|>OVERLAYING the previous, and no free() has been made between them, i.e.,
|>
|>a = malloc(100);
|>...
|>b = malloc(100);
|>
|>where a may turn out address 10000 and b address 10070 (construed
|>addresses here!)
|>
|>Is th is behaviour at all legal in any way? Does VMS malloc sometimes
|>return some sort of "shared memory" or what IN THE NAME OF KEN OLSEN is
|>this?
Indeed what you describe is not supposed to happen. There is a bug somewhere,
but it's 99.999% likely that it's in your code, not in malloc(). If your
program writes on top of the data structures that malloc() uses to keep track
of its free memory pools, things like this can happen. Look for arrays out
of bounds, cases of allocating less memory than you actually are using (for
example, if you're going to strcpy() a 100 byte string, the destination must
be 101 bytes long), passing pointers to variables of storage class auto out
of the routine where they're declared, bad pointer arithmetic, etc.
--PSW
next prev parent reply other threads:[~1992-09-25 16:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-09-25 9:20 VMS free() broken -- the saga continues Hans Granqvist
1992-09-25 15:23 ` Jeff Diewald
1992-09-25 20:28 ` Charles M Richmond
1992-09-25 16:22 ` Paul S. Winalski
1992-09-25 16:59 ` Paul S. Winalski [this message]
1992-09-28 16:06 ` jmeinke
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox