From owner-freebsd-hackers Wed Apr 3 02:27:14 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA00747 for hackers-outgoing; Wed, 3 Apr 1996 02:27:14 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id CAA00703 for ; Wed, 3 Apr 1996 02:27:09 -0800 (PST) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by who.cdrom.com (8.6.12/8.6.11) with ESMTP id BAA25414 for ; Wed, 3 Apr 1996 01:47:57 -0800 Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA01484; Wed, 3 Apr 1996 11:34:52 +0200 From: Luigi Rizzo Message-Id: <199604030934.LAA01484@labinfo.iet.unipi.it> Subject: Re: phkmalloc and buggy sw... To: cracauer@wavehh.hanse.de Date: Wed, 3 Apr 1996 11:34:51 +0200 (MET DST) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <9604030928.AA14346@wavehh.hanse.de> from "Martin Cracauer" at Apr 3, 96 11:28:07 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >It happened to me twice now... I have some software which intermixes > >printf() and putchar(), and since the switch to phkmalloc it coredumps > >at times on the putchar() call. > > >Just for the records... I can't tell if there is something terribly > >wrong in my program or it is putchar which must be fixed. I solve the > >problem by replacing putchar('\n') with printf("\n"), and it doesn't > >coredump anymore. > > I'm running a NetBSD-1.1B/i386 with phkmalloc and would really > appreciate it when you could send me a test program that fails on your > machine. Looks like a bug in libc for me, not in phkmalloc. I would be I am afraid I have not saved the buggy program (it was the driver for a PIC programmer, I needed it working and was in a hurry), and I am unable to reproduce the problem now. The coredump was down in __vprintf... or something like this, from memory. Poul also suggests that it is a bug in libc, I tend to agree with this. I'll try to do my best to reproduce the bug, I believe it was related to the use of printf/putchar/puts. > interested to see how the normal malloc could get around without > dumping core. It's probably because the normal malloc locates the memory block descriptors farther away from the data block. Thus, small overflows (say a few bytes beyond the allocated area) are not noticed, as opposed to the case of phkmalloc which probably does more strict consistency checks. Hope this helps Luigi ==================================================================== Luigi Rizzo Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it Universita' di Pisa tel: +39-50-568533 via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 http://www.iet.unipi.it/~luigi/ ====================================================================