Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!mcvax!ukc!hrc63!miduet!steve From: steve@miduet.UUCP Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: RCHECK bug in malloc Message-ID: <180@miduet.gec-mi-at.co.uk> Date: Mon, 14-Jul-86 14:17:32 EDT Article-I.D.: miduet.180 Posted: Mon Jul 14 14:17:32 1986 Date-Received: Thu, 17-Jul-86 06:56:26 EDT Organization: Marconi Instruments Ltd., St. Albans, Herts, UK Lines: 33 Xref: utcs net.bugs.4bsd:2142 net.unix-wizards:18195 [Probably old hat, this, but anyway....] A colleague of mine unearthed this bug in 4.2 malloc.c when it was compiled with range checking (RCHECK) included. This manifested itself by returning errors whenever 'realloc' was used. A diff follows. ----------------------------------------------------------------- |Steve Lademann |Phone: 44 727 59292 x326 | |Marconi Instruments Ltd|UUCP : ...mcvax!ukc!hrc63!miduet!steve | |St. Albans AL4 0JN |NRS : steve@uk.co.gec-mi-at | |Herts. UK | | ----------------------------------------------------------------- |"The views expressed herein do not necessarily reflect"| _____ | |"those of my employer, and may not even reflect my own"| ( ) | ----------------------------------------------------------------- 16a17,20 > /* > * Modified By Tim Yates to fix bug when using RCHECK > */ > 263a268,278 > /* modified by Tim Yates */ > /* correct the position of the magic number and the > * real size of the block */ > #ifdef RCHECK > { > nbytes += sizeof(union overhead) + RSLOP; > nbytes = (nbytes + 3) &~ 3; > op->ov_size = nbytes - 1; > *((u_int *)((caddr_t)op + nbytes - RSLOP)) = RMAGIC; > } > #endif RCHECK