From owner-freebsd-ports@FreeBSD.ORG Fri May 6 22:47:54 2005 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 2368B16A4D4 for ; Fri, 6 May 2005 22:47:54 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id A938843DB7 for ; Fri, 6 May 2005 22:47:53 +0000 (GMT) (envelope-from martin.gumucio@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so641281wra for ; Fri, 06 May 2005 15:47:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ErJyLbxvqw1I06357YjdqaSAcBETw7yJLycuv+6+cnBex8nDgbexVQj86ZmnGyzN8kFSe1nnkrEdfxwqOURwa63G3vmSNwZoHCf36UrSjDSA9Mtzervs+PwF3dMfFud0WVG6lXcK3TzOFdw6kOCN+xIjOcxkOjyV63+b4vq+0Ok= Received: by 10.54.36.13 with SMTP id j13mr1129336wrj; Fri, 06 May 2005 15:47:53 -0700 (PDT) Received: by 10.54.26.8 with HTTP; Fri, 6 May 2005 15:47:53 -0700 (PDT) Message-ID: <6ed3737105050615476b567b14@mail.gmail.com> Date: Sat, 7 May 2005 00:47:53 +0200 From: Martin Gumucio To: ports@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: FreeBSD Port: zsnes-1.42 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: martin@gumucio.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2005 22:47:54 -0000 Its broken, all you get is a crash =20 "zsnes in free(): error: junk pointer, too high to make sense Abort trap (core dumped)" Below is quoted a helpful post from the zsnes forum, im gonna give it a try, but i guess for now mark the port as broken? Quoted text from http://board.zsnes.com/phpBB2/viewtopic.php?t=3D2271&highlight=3Dzsnes+free= +error+junk+pointer+high+make+sense -------- Well, this might prove helpful to you guys. I looked at what differences in free() commands there are between 1.40 and 1.41, and I found that you guys added in a free(homedir) command into the obtaindir() function of linux/zfilew.c. I think the problem is that getenv in FreeBSD doesn't allocate memory in the program, so when homedir is successfully assigned the result of getenv("HOME") and it's later tried to be freed, it fails because the memory being used is outside the ZSNES program memory space. I tried to add a simple int that is initialized to 0 before that getenv() call and if the getenv call fails, it'll set that int to 1, and then before the free(homedir) I put in an if to check if that int is a 1 or not, and if it was, then do the free(), and that stopped ZSNES from crashing on loading under my system. I hope this helps out.