From owner-freebsd-ports@FreeBSD.ORG Sun Apr 18 22:36:10 2004 Return-Path: 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 3063D16A4CE for ; Sun, 18 Apr 2004 22:36:10 -0700 (PDT) Received: from bittern.mail.pas.earthlink.net (bittern.mail.pas.earthlink.net [207.217.120.119]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3C7443D2D for ; Sun, 18 Apr 2004 22:36:09 -0700 (PDT) (envelope-from mike@inbox.lv) Received: from pool0343.cvx27-bradley.dialup.earthlink.net ([209.179.57.88] helo=ringworm.mojavegreen.com) by bittern.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1BFRRw-0000DE-00 for freebsd-ports@freebsd.org; Sun, 18 Apr 2004 22:36:09 -0700 Received: by ringworm.mojavegreen.com (Postfix, from userid 1000) id 69E7C8455; Sun, 18 Apr 2004 22:29:01 -0700 (PDT) From: "Michael C. Shultz" Organization: Mojave Green Software co. To: freebsd-ports@freebsd.org Date: Sun, 18 Apr 2004 22:28:55 -0700 User-Agent: KMail/1.6.1 References: <86u0zgipdr.fsf@comcast.net> In-Reply-To: <86u0zgipdr.fsf@comcast.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404182228.55828.ringworm@inbox.lv> Subject: Re: devel/libidn: warning when freeing memory X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 05:36:10 -0000 On Sunday 18 April 2004 09:05 pm, Kaarthik Sivakumar wrote: > When idn is run, it prints the following message for any string given > to it: > > idn in free(): error: junk pointer, too high to make sense > > After setting MALLOC_OPTIONS to A and compiling libidn with '-g', I > got the following backtrace: > > ,---- > > | (gdb) run > | Starting program: /usr/home/programs/libidn-0.4.2/src/.libs/idn > | libidn 0.4.2 > | Copyright 2002, 2003, 2004 Simon Josefsson. > | GNU Libidn comes with NO WARRANTY, to the extent permitted by law. > | You may redistribute copies of GNU Libidn under the terms of > | the GNU Lesser General Public License. For more information > | about these matters, see the file named COPYING.LIB. > | Type each input string on a line by itself, terminated by a newline > | character. test this string > | idn in free(): error: junk pointer, too high to make sense > | > | Program received signal SIGABRT, Aborted. > | 0x281f1d4f in kill () from /lib/libc.so.5 > | (gdb) bt > | #0 0x281f1d4f in kill () from /lib/libc.so.5 > | #1 0x281e67f8 in raise () from /lib/libc.so.5 > | #2 0x2825ef02 in abort () from /lib/libc.so.5 > | #3 0x2825d67e in tcflow () from /lib/libc.so.5 > | #4 0x2825d6ab in tcflow () from /lib/libc.so.5 > | #5 0x2825e1d8 in tcflow () from /lib/libc.so.5 > | #6 0x2825e420 in free () from /lib/libc.so.5 > | #7 0x08049c1f in main (argc=1, argv=0xbfbfe9f0) at idn.c:381 > | #8 0x08048c62 in _start () > | (gdb) fr 7 > | #7 0x08049c1f in main (argc=1, argv=0xbfbfe9f0) at idn.c:381 > | 381 free (r); > | (gdb) l > | 376 argv[0], rc); > | 377 free (q); > | 378 return 1; > | 379 } > | 380 > | 381 free (r); > | 382 } > | 383 #endif > | 384 > | 385 if (args_info.debug_given) > | (gdb) p r > | $1 = 0x6f732e > | (gdb) > > `---- > > I tried debugging but I couldnt figure out what was wrong. The address > seems low for stack addresses, but it is obviously high for a heap > address. > > Thanks > > kaarthik > > > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" The error comes from freeing something that isn't allocated. You don't have enough information here to find the problem. Where was "r" and "q" malloc'ed? Are either of them being freed more than once? Did one of them get their address reassigned? A quick thing you can do is comment out the free's, if the problem goes away then you'll know which variable is the culprit. -Mike