Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Nov 2010 11:18:58 +0300
From:      Sergey Kandaurov <pluknet@gmail.com>
To:        Dan Allen <danallen46@airwired.net>, Andriy Gapon <avg@freebsd.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Fatal trap 18
Message-ID:  <AANLkTik0=x6h3YK0F_yrRJ_MGHp9pf8dVubbEwpmAa1y@mail.gmail.com>
In-Reply-To: <68E248E0-8619-4859-BFFE-1B5F5ABBC51F@airwired.net>
References:  <68E248E0-8619-4859-BFFE-1B5F5ABBC51F@airwired.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3 November 2010 08:30, Dan Allen <danallen46@airwired.net> wrote:
> FreeBSD 8.1-STABLE sometime after 10/28/2010 has caused a fatal boot erro=
r on my Toshiba U205, 1.8 GHz Core Duo laptop.
>
> Many times every week I sync with STABLE and build everything. =A0I have =
been doing this for years.
>
> I sync'd (via csup) and built on 10/28/2010 and everything was fine.
>
> Then I sync'd yesterday 11/1/2010 and it crashes on boot. =A0The diagnost=
ics print out the following:
>
> ---
>
> Fatal trap 18: integer divide fault while in kernel mode
>
> kdb_backtrace
> panic
> trap_fatal
> trap
> calltrap
> topo_probe
> cpu_topo
> smp_topo
> sched_setup
> mi_startup
>
> ---
>
> I reverted at the loader via boot /boot/kernel.old, resync'd today, rebui=
lt, and things are still broken.
>

It's possible in theory to leave cpu_logical as zero in topo_probe_0x4().
So, it makes sense to add some sort of the check.

Index: svn/freebsd/head/sys/amd64/amd64/mp_machdep.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
--- svn/freebsd/head/sys/amd64/amd64/mp_machdep.c       (revision 214725)
+++ svn/freebsd/head/sys/amd64/amd64/mp_machdep.c       (working copy)
@@ -239,6 +239,8 @@
                        cpu_logical++;
        }

+       if (cpu_logical =3D=3D 0)
+               cpu_logical =3D 1;        /* XXX max_logical? */
        cpu_cores /=3D cpu_logical;
        hyperthreading_cpus =3D cpu_logical;
 }


--=20
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik0=x6h3YK0F_yrRJ_MGHp9pf8dVubbEwpmAa1y>