From owner-freebsd-current@FreeBSD.ORG Tue May 6 16:33:12 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BDF937B401 for ; Tue, 6 May 2003 16:33:12 -0700 (PDT) Received: from arthur.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DED243FA3 for ; Tue, 6 May 2003 16:33:11 -0700 (PDT) (envelope-from simon@arthur.nitro.dk) Received: by arthur.nitro.dk (Postfix, from userid 1000) id D611010BF82; Wed, 7 May 2003 01:33:09 +0200 (CEST) Date: Wed, 7 May 2003 01:33:09 +0200 From: "Simon L. Nielsen" To: freebsd-current@freebsd.org Message-ID: <20030506233309.GE86292@nitro.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OROCMA9jn6tkzFBc" Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: Coredump in disklabel with md device X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2003 23:33:12 -0000 --OROCMA9jn6tkzFBc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello While trying to make a patch for docs/51897 and testing it I'm making bsdlabel/disklabel coredump : # dd if=3D/dev/zero of=3Dsomebackingfile bs=3D1k count=3D10k # mdconfig -a -t vnode -f somebackingfile -u 0 # disklabel -w md0 # disklabel -e md0 I then add : d: * 0 4.2BSD and get a floating exception coredump. It seems the memory device is reporting a sector size of 0 (if I read the code right) : 0x0804ad88 in getasciipartspec (tp=3D0x0, lp=3D0xbfbff9d0, part=3D134540284= , lineno=3D5) at bsdlabel.c:999 999 if (pp->p_size < 1024*1024*1024 / lp->d_sec= size) { (gdb) bt #0 0x0804ad88 in getasciipartspec (tp=3D0x0, lp=3D0xbfbff9d0, part=3D13454= 0284, lineno=3D5) at bsdlabel.c:999 #1 0x0804aa37 in getasciilabel (f=3D0x2816c6c0, lp=3D0xbfbff9d0) at bsdlab= el.c:879 #2 0x08049f2f in edit () at bsdlabel.c:562 #3 0x0804934a in main (argc=3D1, argv=3D0xbfbffb74) at bsdlabel.c:234 #4 0x08049065 in _start () (gdb) print lp->d_secsize $1 =3D 0 100% reproduceable on : FreeBSD ford.nitro.dk 5.1-BETA FreeBSD 5.1-BETA #3: Tue May 6 22:49:47 CES= T 2003 FreeBSD@trillian.nitro.dk:/usr/obj/data/FreeBSD/clean-CURRENT/sy= s/GENERIC i386 If I hack bsdlabel to force 512 byte sectors (like below) everything seems to work fine (I can newfs and mount the new device). %%% Index: bsdlabel.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /data/FreeBSD/ncvs/src/sbin/bsdlabel/bsdlabel.c,v retrieving revision 1.90 diff -u -r1.90 bsdlabel.c --- bsdlabel.c 4 May 2003 19:27:22 -0000 1.90 +++ bsdlabel.c 7 May 2003 01:29:13 -0000 @@ -992,6 +992,10 @@ pp->p_frag =3D v / pp->p_fsize; NXTNUM(pp->p_cpg); } else { + /* HACK: Check for odd sectorsize e.g. from md devices */ + if(lp->d_secsize =3D=3D 0) + lp->d_secsize =3D 512; + /* * FIX! poor attempt at adaptive */ %%% --=20 Simon L. Nielsen --OROCMA9jn6tkzFBc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+uEY18kocFXgPTRwRAq5HAJwIpJQHY+6ASbSUpUXlMc5WWsfOnACg23OI WYvnNE1C0Or3I+9YIlyvbuI= =Gh74 -----END PGP SIGNATURE----- --OROCMA9jn6tkzFBc--