From owner-freebsd-current@FreeBSD.ORG Thu Apr 30 20:57:31 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62711065670 for ; Thu, 30 Apr 2009 20:57:31 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7818FC20 for ; Thu, 30 Apr 2009 20:57:31 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.3/8.14.3) with ESMTP id n3UKT6kO061325; Thu, 30 Apr 2009 13:29:07 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.3/8.14.3/Submit) id n3UKT61B061324; Thu, 30 Apr 2009 13:29:06 -0700 (PDT) (envelope-from david) Date: Thu, 30 Apr 2009 13:29:06 -0700 From: David Wolfskill To: Jung-uk Kim Message-ID: <20090430202906.GE1387@albert.catwhisker.org> References: <20090429161626.GQ1387@albert.catwhisker.org> <49F9CD25.70102@icyb.net.ua> <200904301552.03118.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UoQnh8DjDgfWLrgi" Content-Disposition: inline In-Reply-To: <200904301552.03118.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org Subject: Re: Panic "Fatal trap 18: integer divide fault while in kernel mode" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 30 Apr 2009 20:57:32 -0000 --UoQnh8DjDgfWLrgi Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 30, 2009 at 03:51:59PM -0400, Jung-uk Kim wrote: > ... > > >> db> bt > > >> Tracing pid 0 tid 100000 td 0xc0d43610 > > >> cpu_topo(2,c1420d34,c081ff07,c1420d58,c0820042,...) at > > >> cpu_topo+0x43 smp_topo(c0804378,2,c4145a5c,fffffff,0,...) at > > >> smp_topo+0x10b > > >> sched_setup(0,141ec00,141ec00,141e000,1425000,...) at > > >> sched_setup+0x1a mi_startup() at mi_startup+0x96 > > >> begin() at begin+0x2c > > > > > > My guess is that (cpu_cores * cpu_logical) somehow equals to > > > zero. > > > > That was masked earlier by additional checks on zero, > > and now that routine moved to the separate function > > (and to separate call path from subr_smp.c:mp_start() > > which seems not to be called). > > > > > Have you by a chance saved this crash dump? > > > I think that t would be interesting to look at it in kgdb. I was unable to save a dump; sorry -- "panic" merely sat there. Since the kernel had yet to have probed any devices (that I can tell), that may have had something to do with it. > Please try the attached patch. >=20 > Jung-uk Kim > --- sys/amd64/amd64/mp_machdep.c (revision 191699) > +++ sys/amd64/amd64/mp_machdep.c (working copy) > @@ -214,6 +214,8 @@ > else if (type =3D=3D CPUID_TYPE_CORE) > cpu_cores =3D cnt; > } > + if (cpu_cores =3D=3D 0) > + cpu_cores =3D 1; > if (cpu_logical =3D=3D 0) > cpu_logical =3D 1; > cpu_cores /=3D cpu_logical; > --- sys/i386/i386/mp_machdep.c (revision 191699) > +++ sys/i386/i386/mp_machdep.c (working copy) > @@ -267,6 +267,8 @@ > else if (type =3D=3D CPUID_TYPE_CORE) > cpu_cores =3D cnt; > } > + if (cpu_cores =3D=3D 0) > + cpu_cores =3D 1; > if (cpu_logical =3D=3D 0) > cpu_logical =3D 1; > cpu_cores /=3D cpu_logical; OK; I tried, but the symptoms appear unchanged: =2E.. =B3 Select option, [Enter] for default =B3 =B3 or [Space] to pause timer 9 =B3 =C0=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4= =C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=C4=D9 GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb SMAP type=3D01 base=3D0000000000000000 len=3D000000000009fc00 SMAP type=3D02 base=3D000000000009fc00 len=3D0000000000000400 SMAP type=3D01 base=3D0000000000100000 len=3D000000002fee2800 SMAP type=3D02 base=3D000000002ffe2800 len=3D000000000001d800 SMAP type=3D02 base=3D00000000feda0000 len=3D0000000000060000 SMAP type=3D02 base=3D00000000ffb80000 len=3D0000000000480000 Copyright (c) 1992-2009 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #1027 r191682M: Thu Apr 30 13:19:50 PDT 2009 root@d254.dwolf.juniper.net.:/common/S4/obj/usr/src/sys/CANARY WARNING: WITNESS option enabled, expect reduced performance. Preloaded elf kernel "/boot/kernel/kernel" at 0xc1131000. Preloaded elf module "/boot/kernel/linux.ko" at 0xc113114c. Preloaded elf module "/boot/kernel/if_an.ko" at 0xc11311f8. Preloaded elf module "/boot/kernel/if_wi.ko" at 0xc11312a4. Preloaded elf module "/boot/kernel/radeon.ko" at 0xc1131350. Preloaded elf module "/boot/kernel/drm.ko" at 0xc11313fc. Timecounter "i8254" frequency 1193182 Hz quality 0 Calibrating TSC clock ... TSC clock: 2392953980 Hz CPU: Mobile Intel(R) Pentium(R) 4 - M CPU 2.40GHz (2392.95-MHz 686-class CP= U) Origin =3D "GenuineIntel" Id =3D 0xf27 Stepping =3D 7 Features=3D0xbfebf9ff Features2=3D0x400 Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 128 entries Data TLB: 4 KB or 4 MB pages, fully associative, 64 entries 1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte = line size Trace cache: 12K-uops, 8-way set associative 2nd-level cache: 512 KB, 8-way set associative, sectored cache, 64 byte lin= e size real memory =3D 805306368 (768 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009efff, 647168 bytes (158 pages) 0x0000000000100000 - 0x00000000003fffff, 3145728 bytes (768 pages) 0x0000000001425000 - 0x000000002f2d9fff, 770396160 bytes (188085 pages) avail memory =3D 769626112 (733 MB) bios32: Found BIOS32 Service Directory header at 0xc00ffe80 bios32: Entry =3D 0xffe90 (c00ffe90) Rev =3D 0 Len =3D 1 pcibios: PCI BIOS entry at 0xf0000+0xbfee pnpbios: Found PnP BIOS data at 0xc00fe2d0 pnpbios: Entry =3D f0000:e2f4 Rev =3D 1.0 pnpbios: Event flag at 4b4 Other BIOS signatures found: Fatal trap 18: integer divide fault while in kernel mode cpuid =3D 0; apic id =3D 00 instruction pointer =3D 0x20:0xc0b3c9f3 stack pointer =3D 0x28:0xc1420d00 frame pointer =3D 0x28:0xc1420d20 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, def32 1, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 0 (swapper) [thread pid 0 tid 100000 ] Stopped at cpu_topo+0x43: idivl %ecx,%eax db> bt Tracing pid 0 tid 100000 td 0xc0d43690 cpu_topo(2,c1420d34,c081ff07,c1420d58,c0820042,...) at cpu_topo+0x43 smp_topo(c0804378,2,c4145a5c,fffffff,0,...) at smp_topo+0x10b sched_setup(0,141ec00,141ec00,141e000,1425000,...) at sched_setup+0x1a mi_startup() at mi_startup+0x96 begin() at begin+0x2c db>=20 Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --UoQnh8DjDgfWLrgi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkn6ChIACgkQmprOCmdXAD1PlgCffzZPMOmMbQ3jSIRcmftDugps gKAAmwb4diY5gkvxXN8eKdUp/tM8t8y2 =LryZ -----END PGP SIGNATURE----- --UoQnh8DjDgfWLrgi--