From owner-freebsd-current Mon Jan 22 09:23:14 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA28755 for current-outgoing; Mon, 22 Jan 1996 09:23:14 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA28738 for ; Mon, 22 Jan 1996 09:23:11 -0800 (PST) Received: (from jdp@localhost) by austin.polstra.com (8.6.12/8.6.12) id JAA15652; Mon, 22 Jan 1996 09:22:03 -0800 Date: Mon, 22 Jan 1996 09:22:03 -0800 From: John Polstra Message-Id: <199601221722.JAA15652@austin.polstra.com> To: jmz@cabri.obs-besancon.fr Subject: Re: c++ and malloc Newsgroups: polstra.freebsd.current In-Reply-To: <9601210225.AA20119@cabri.obs-besancon.fr> Organization: Polstra & Co., Seattle, WA Cc: freebsd-current@freebsd.org Sender: owner-current@freebsd.org Precedence: bulk In article <9601210225.AA20119@cabri.obs-besancon.fr> you write: > On a current system, c++ programs generate a lot of warnings. Here is > a simple example: > $ cat a.cc > #include > ofstream x; main () {} > $ c++ a.cc > $ a.out > Malloc warning: free(): already free chunk. > Malloc warning: free(): already free chunk. > Malloc warning: free(): already free chunk. This might possibly be caused by a library problem that I caused with a change I made to /usr/share/mk/bsd.lib.mk. Check that file, and see whether you have revision 1.28. That is the bad version. If you have it, you should get the newest version (1.29), or revert to the preceding version (1.27), or just apply this patch: ------------------------------------------------------------------------------- Index: src/share/mk/bsd.lib.mk diff -c src/share/mk/bsd.lib.mk:1.28 src/share/mk/bsd.lib.mk:1.29 *** src/share/mk/bsd.lib.mk:1.28 Tue Jan 16 16:03:08 1996 --- src/share/mk/bsd.lib.mk Sun Jan 21 09:26:25 1996 *************** *** 1,5 **** # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 ! # $Id: bsd.lib.mk,v 1.28 1996/01/17 00:03:08 jdp Exp $ # .if exists(${.CURDIR}/../Makefile.inc) --- 1,5 ---- # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 ! # $Id: bsd.lib.mk,v 1.29 1996/01/21 17:26:25 jdp Exp $ # .if exists(${.CURDIR}/../Makefile.inc) *************** *** 187,193 **** .endif .if !defined(NOPIC) ! .if !make(clean) && !make(cleandir) SOBJS+= ${DESTDIR}/usr/lib/c++rt0.o .endif --- 187,193 ---- .endif .if !defined(NOPIC) ! .if defined(CPLUSPLUSLIB) && !make(clean) && !make(cleandir) SOBJS+= ${DESTDIR}/usr/lib/c++rt0.o .endif ------------------------------------------------------------------------------- Then, rebuild all of your shared libraries. You don't have to recompile them; just redo the final "ld" steps that build the libraries. I don't know whether this is the cause of your problem or not; but it might be. -- John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth