From owner-freebsd-current Sat Mar 30 13:58: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from energyhq.homeip.net (213-97-200-73.uc.nombres.ttd.es [213.97.200.73]) by hub.freebsd.org (Postfix) with ESMTP id 4F6D437B41A for ; Sat, 30 Mar 2002 13:58:05 -0800 (PST) Received: by energyhq.homeip.net (Postfix, from userid 1001) id 0C7303FC4C; Sat, 30 Mar 2002 22:58:59 +0100 (CET) Date: Sat, 30 Mar 2002 22:58:58 +0100 From: Miguel Mendez To: Kris Kennaway Cc: current@freebsd.org, tlambert2@mindspring.com Subject: Re: Bus error compiling thefish 0.2 on -current Message-ID: <20020330225858.A57430@energyhq.homeip.net> Mail-Followup-To: Kris Kennaway , current@freebsd.org, tlambert2@mindspring.com References: <20020330141745.A54712@energyhq.homeip.net> <20020330184051.A54936@energyhq.homeip.net> <20020330133109.A83442@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020330133109.A83442@xor.obsecurity.org>; from kris@obsecurity.org on Sat, Mar 30, 2002 at 01:31:09PM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 30, 2002 at 01:31:09PM -0800, Kris Kennaway wrote: Hi Terry and Kris, > Sounds like it could be the malloc.conf defaults on -current exposing > a bug in the program code. Yes, there was a bug in my code, it just didn't show up on -STABLE. Apparently, when one uses efence, allocated memory is zeroed, which would explain why the program worked when linked with efence. I've built a debug version of libdialog and found something interesting... #0 0x28324253 in dialog_checklist (title=3D0x80bcf54 "Knobs Menu",=20 prompt=3D0x80bcf60 "A checked entry means that knob is set to YES", height=3D-1,width=3D-1, list_height=3D15, cnt=3D-1697, it=3D0x81e6014, result=3D0x0) at checklist.c:82 82 status[i] =3D ditems[i].checked ? ditems[i].checked(&ditems[i]) : FALSE; There is something odd in that cnt value, as there aren't 1697 entries in the menu. The problem is the way the dialog structure is built, I malloc memory but don't zero it, so when I call the function that in the end calls dialog, it erroneously assumes that there are more entries than there really are, since it simply checks for !=3D0 data. The garbage present in the malloc'ed mem is the cause. Why this problem doesn't show on -STABLE is still beyond my comprehension, default malloc behaviour maybe? Anyway, problem solved, thanks for all. Cheers, --=20 Miguel Mendez - flynn@energyhq.homeip.net GPG Public Key :: http://energyhq.homeip.net/files/pubkey.txt EnergyHQ :: http://www.energyhq.tk FreeBSD - The power to serve! --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8pjUinLctrNyFFPERAsI9AJ9zAqdrLiErgzppyIi/zkCfELlVbgCfT2R1 6SD/INcUW1a3GrE17YmgXTQ= =UhAn -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message