From owner-freebsd-hackers Wed Oct 21 06:37:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA17948 for freebsd-hackers-outgoing; Wed, 21 Oct 1998 06:37:58 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA17933 for ; Wed, 21 Oct 1998 06:37:49 -0700 (PDT) (envelope-from jhay@zibbi.mikom.csir.co.za) Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.9.1/8.9.1) id PAA07535; Wed, 21 Oct 1998 15:36:51 +0200 (SAT) From: John Hay Message-Id: <199810211336.PAA07535@zibbi.mikom.csir.co.za> Subject: Re: 3.0-R on a amd386dx/40 In-Reply-To: <199810211020.UAA09162@nymph.dtir.qld.gov.au> from Stephen McKay at "Oct 21, 98 08:20:59 pm" To: syssgm@dtir.qld.gov.au (Stephen McKay) Date: Wed, 21 Oct 1998 15:36:51 +0200 (SAT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >> Try "awk", for example. It uses floating point, and I think it will die. > >> "df" uses double. "newfs" uses float. "ls" doesn't, and it works. It's > >> a floating point problem, or I'll eat my copy of the Pointy Hat! > >> > >> I still think the "npx" lines from boot are relevant. > > > >ok, here are the lines: > >npx0 on motherboard > >npx0: 387 emulator Ok, here is what I have found so far. I used a 3.0 system with a new kernel with Peter Wemm's commits to i386/math_emulate.c. Then I recompiled libc.a with vfprintf.c with debugging on and then also compiled fsck with debugging on and got it to dump core on a 386 machine. Here is some of gdb's output. What is interesting is that the coredump address (0x806859f) falls between two assembler instructions... or did disassem get it wrong? Or am I confused? Is it possible that the emulator in the kernel restarts the program at the wrong place? John -- John Hay -- John.Hay@mikom.csir.co.za ----------------- Core was generated by `fsck'. Program terminated with signal 10, Bus error. #0 0x806859f in cvt (value=5.2716105037754986, ndigits=1, flags=256, sign=0xefbfd9fb "", decpt=0xefbfd9f4, ch=102, length=0xefbfd9f0) at /usr/src/lib/libc/../libc/stdio/vfprintf.c:1219 1219 if (value < 0) { (gdb) bt #0 0x806859f in cvt (value=5.2716105037754986, ndigits=1, flags=256, sign=0xefbfd9fb "", decpt=0xefbfd9f4, ch=102, length=0xefbfd9f0) at /usr/src/lib/libc/../libc/stdio/vfprintf.c:1219 #1 0x8066a5e in vfprintf (fp=0x80765bc, fmt0=0x80712c7 "(%d frags, %d blocks, %.1f%% fragmentation)\n", ap=0xefbfdc00 "\t\024\a\b\e\021") at /usr/src/lib/libc/../libc/stdio/vfprintf.c:608 #2 0x805e488 in printf () #3 0x804acef in checkfilesys (filesys=0x8076714 "/dev/rwd0s1e", mntpt=0x0, auxdata=0, child=0) at main.c:271 #4 0x804a9e1 in main (argc=2, argv=0xefbfdde0) at main.c:136 #5 0x80480c9 in _start () (gdb) list 1214 */ 1215 if (ch == 'e' || ch == 'E') 1216 ndigits++; 1217 mode = 2; /* ndigits significant digits */ 1218 } 1219 if (value < 0) { 1220 value = -value; 1221 *sign = '-'; 1222 } else 1223 *sign = '\000'; (gdb) disassem Dump of assembler code for function cvt: 0x8068568 : pushl %ebp 0x8068569 : movl %esp,%ebp 0x806856b : subl $0x8,%esp 0x806856e : pushl %edi 0x806856f : pushl %esi 0x8068570 : pushl %ebx 0x8068571 : movl 0x18(%ebp),%ecx 0x8068574 : movl 0x20(%ebp),%esi 0x8068577 : cmpl $0x66,%esi 0x806857a : jne 0x8068584 0x806857c : movl $0x3,%edx 0x8068581 : jmp 0x8068596 0x8068583 : nop 0x8068584 : cmpl $0x65,%esi 0x8068587 : je 0x806858e 0x8068589 : cmpl $0x45,%esi 0x806858c : jne 0x8068591 0x806858e : incl 0x10(%ebp) 0x8068591 : movl $0x2,%edx 0x8068596 : fldz 0x8068598 : fcompl 0x8(%ebp) 0x806859b : fnstsw 0x806859e : andb $0x45,%ah 0x80685a1 : jne 0x80685b0 0x80685a3 : fldl 0x8(%ebp) 0x80685a6 : fchs 0x80685a8 : fstpl 0x8(%ebp) 0x80685ab : movb $0x2d,(%ecx) 0x80685ae : jmp 0x80685b3 0x80685b0 : movb $0x0,(%ecx) 0x80685b3 : leal 0xfffffff8(%ebp),%eax 0x80685b6 : pushl %eax 0x80685b7 : leal 0xfffffffc(%ebp),%eax 0x80685ba : pushl %eax 0x80685bb : pushl 0x1c(%ebp) 0x80685be : pushl 0x10(%ebp) ... ----------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message