From owner-freebsd-ports Mon Aug 26 4:57:13 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 120A637B400; Mon, 26 Aug 2002 04:57:09 -0700 (PDT) Received: from mx1.eskimo.com (mx1.eskimo.com [204.122.16.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABF5243E6A; Mon, 26 Aug 2002 04:57:08 -0700 (PDT) (envelope-from ripper@eskimo.com) Received: from eskimo.com (ripper@eskimo.com [204.122.16.13]) by mx1.eskimo.com (8.9.1a/8.8.8) with ESMTP id EAA00575; Mon, 26 Aug 2002 04:57:01 -0700 Received: (from ripper@localhost) by eskimo.com (8.9.1a/8.9.1) id EAA26501; Mon, 26 Aug 2002 04:57:02 -0700 (PDT) Date: Mon, 26 Aug 2002 04:57:02 -0700 (PDT) Message-Id: <200208261157.EAA26501@eskimo.com> From: Ross Lippert To: freebsd-questions@freebsd.org, freebsd-ports@freebsd.org Cc: zorn@boulder.colorado.edu Subject: memory profiling Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I'm not sure if this is a port or a base problem, but I am trying to find a memory leak in a 3rd party program and I am trying to use the mprof port to do it (if there is a better port to use for this, I welcome recommendations). (using FreeBSD-4.6-RELEASE) /usr/ports/devel/mprof seems to create a libc_mp.a which is to be linked which has different malloc,et al, functions in it, so I did, what I thought was the right thing: $ gcc -g test.c /usr/local/lib/libc_mp.a or $ gcc -g test.c -L /usr/local/lib -lc_mp and I get /tmp/ccEeiQfR.o: In function `main': /home/ripper/Choices/MyApps/Other/test.c(.text+0x13): undefined reference to `_malloc_leap' /home/ripper/Choices/MyApps/Other/test.c(.text+0x7f): undefined reference to `_free_leap' I'm not sure where _malloc/free_leap are supposed to be defined, whether this is a problem of the port or a problem of the base -- like maybe these functions are expected to be in regular libc but aren't. I have grepped around my */lib/* directories and not seen anything which defines these symbols. -r PS my test program is #include #include #include int main() { int i; char *p = (char *) malloc(20*sizeof(char)); fprintf(stderr,"%x\n",p); for(i=0; i < 20; ++i) fprintf(stderr,"%c",p[i]); free(p); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message