Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2005 13:45:01 -0700
From:      Allan Bowhill <allanb@u.washington.edu>
To:        freebsd-questions@freebsd.org
Subject:   Kernel panic on keyboard-interaction with rc.local and ACPI
Message-ID:  <20050506204501.GA656@kosmos.my.net>

next in thread | raw e-mail | index | archive | help

--r5Pyd7+fXNt84Ff3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

My apologies in advance for the length of this email.

I recently updated my 5.4 system after security notices, and I'm getting a=
=20
kernel panic when I interact on the keyboard with a rc.local script.=20

Disabling ACPI makes the problem go away, but I am on a laptop so I think
I want ACPI on.

The shell script is something I wrote/mooched/hacked that allows me to sele=
ct a=20
wifi station to login to during boot time. The machine is a  laptop: Dell=
=20
Inspiron 1150. It's probably bad form to have an interactive script on
boot, but anyway...=20

here is the rc.local script:

=3D=3D=20

run_it () {
  case "${AUTO_RUN}" in
  '')
    unset YES_OR_NO
    echo ''
    echo -n '    Connect to'
    echo ''
    echo -n '    1.) Wifi 1'
    echo ''
    echo -n '    2.) Wifi 2'
    echo ''
    echo -n '    [Default: Wifi 2] ? 1, 2, [Enter]'
    echo ''
    read YES_OR_NO

    case "${YES_OR_NO}" in
    1)
      echo "    logging into Wifi 1 using card ${1}"
      echo ''
      eval "echo ifconfig Wifi 1"
      echo ''
      ;;
    ''|2)
      echo "    logging into Wifi 2 using card ${1}"
      echo ''
      eval "echo ifconfig Wifi 2"
      echo ''
      ;;
    *)
      echo ''
      echo "    Invalid selection for command  ${1}"
      echo ''
      echo "    Make sure to run ${1} yourself"
      echo ''
    esac
    ;;
  *) ;;
  esac
}

run_it "ath0"
dhclient "ath0"

=3D=3D

The kernel boots fine, and gets to the point where rc.local runs:

Connect to:

1)   Wifi station 1
2)   Wifi station 2

When I hit a key, I get the following message (entered by hand here):

Fatal Trap 12
page fault while in kernel mode

fault virtual address: 0x7408a85c
fault code: supervisor read, page not present
instruction pointer: 0x8: 0x7408a85c
stack pointer: 0x10: 0xcbc60c94
frame pointer: 0x10: 0xcbc60c94
code segment: base 0x0 limit 0xffff
              type 0x16=20
              DPL 0, pres 1, def32 1, gran 1
processor eflags: interrupt enabled, resume IOPL=3D0
current process: 13 (irq1: atkbd0)
trap number: 12
panic: page fault
Uptime: 36s                   =20
Cannot dump. no demp device defined.

(The above is the first attempt. I was able later to get a crashdump, and r=
ecompiled the kernel with=20
debug on so the message above is in a slightly different environment than w=
hat the crash dump saw)

In the crash dump, and it kind of looks like the kernel can't create a thre=
ad to handle a=20
keyboard interrupt for some reason.=20

atkbd_intr() in /usr/src/sys/dev/kbd/atkbd.c gets a null argument for kbd, =
which it tries to=20
dereference:

453     atkbd_intr(keyboard_t *kbd, void *arg)
454     {
(kgdb)=20
455             atkbd_state_t *state;
456             int delay[2];
457             int c;
458
459             if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
460                     /* let the callback function to process the input */
461                     (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
462                                                 kbd->kb_callback.kc_arg=
);
463             } else {


It gets this from atkbd_isa_intr() in /usr/src/sys/isa/atkbd_isa.c

static void
atkbd_isa_intr(void *arg)
{
        keyboard_t *kbd;
 =20
        kbd =3D (keyboard_t *)arg;                   <-- null void pointer =
cast as keyboard_t *
        (*kbdsw[kbd->kb_index]->intr)(kbd, NULL);
}

Which, in turn gets the null pointer from a critical section in an interrup=
t thread handler in kern_intr.c.
But, there I am lost :)

I can provide more info if needed, given that I can keep the machine runnin=
g...


--Allan Bowhill



[GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so:=
 Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain condition=
s.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
#0  doadump () at pcpu.h:160
160             __asm __volatile("movl %%fs:0,%0" : "=3Dr" (td));
(kgdb) where
#0  doadump () at pcpu.h:160
#1  0xc0665172 in boot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.c:4=
10
#2  0xc0665479 in panic (fmt=3D0xc08a0119 "%s") at /usr/src/sys/kern/kern_s=
hutdown.c:566
#3  0xc085566d in trap_fatal (frame=3D0xcbc60c34, eva=3D0) at /usr/src/sys/=
i386/i386/trap.c:817
#4  0xc0855390 in trap_pfault (frame=3D0xcbc60c34, usermode=3D0, eva=3D1946=
724444) at /usr/src/sys/i386/i386/trap.c:735
#5  0xc0854f5c in trap (frame=3D
      {tf_fs =3D 24, tf_es =3D 16, tf_ds =3D -1066991600, tf_edi =3D 13, tf=
_esi =3D -1063617632, tf_ebp =3D -876213100, tf_isp =3D -876213152, tf_ebx =
=3D -1050240512, tf_edx =3D -1066827385, tf_ecx =3D -1063864572, tf_eax =3D=
 13, tf_trapno =3D 12, tf_err =3D 0, tf_eip =3D 1946724444, tf_cs =3D 8, tf=
_eflags =3D 66050, tf_esp =3D -1065129891, tf_ss =3D 13}) at /usr/src/sys/i=
386/i386/trap.c:425
#6  0xc084317a in calltrap () at /usr/src/sys/i386/i386/exception.s:140
#7  0x00000018 in ?? ()
#8  0x00000010 in ?? ()
#9  0xc0670010 in thr_create (td=3D0xc09a7ba0, uap=3D0x0) at /usr/src/sys/k=
ern/kern_thr.c:160
#10 0xc082659e in atkbd_intr (kbd=3D0xc0991ba0, arg=3D0x0) at /usr/src/sys/=
dev/kbd/atkbd.c:461
#11 0xc085d8db in atkbd_isa_intr (arg=3D0x0) at /usr/src/sys/isa/atkbd_isa.=
c:177
#12 0xc064db55 in ithread_loop (arg=3D0xc14f7c00) at /usr/src/sys/kern/kern=
_intr.c:547
#13 0xc064cb7e in fork_exit (callout=3D0xc064d9b6 <ithread_loop>, arg=3D0x0=
, frame=3D0x0) at /usr/src/sys/kern/kern_fork.c:791
#14 0xc08431dc in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:=
209

=3D=3D=3D
here is an uninformative boot log output:


May  6 11:54:31 sputnik syslogd: kernel boot file is /boot/kernel/kernel
May  6 11:54:31 sputnik kernel: Copyright (c) 1992-2005 The FreeBSD Project.
May  6 11:54:31 sputnik kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988,=
 1989, 1991, 1992, 1993, 1994
May  6 11:54:31 sputnik kernel: The Regents of the University of California=
=2E All rights reserved.
May  6 11:54:31 sputnik kernel: FreeBSD 5.4-STABLE #1: Fri May  6 10:32:52 =
PDT 2005
May  6 11:54:31 sputnik kernel: root@sputnik.attbi.com:/usr/obj/usr/src/sys=
/GENERIC
May  6 11:54:31 sputnik kernel: Timecounter "i8254" frequency 1193182 Hz qu=
ality 0
May  6 11:54:31 sputnik kernel: CPU: Intel(R) Celeron(R) CPU 2.40GHz (2397.=
97-MHz 686-class CPU)
May  6 11:54:31 sputnik kernel: Origin =3D "GenuineIntel"  Id =3D 0xf29  St=
epping =3D 9
May  6 11:54:31 sputnik kernel: Features=3D0xbfebf9ff<FPU,VME,DE,PSE,TSC,MS=
R,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE=
,SSE2,SS,H$
May  6 11:54:31 sputnik kernel: real memory  =3D 267161600 (254 MB)
May  6 11:54:31 sputnik kernel: avail memory =3D 251768832 (240 MB)
May  6 11:54:31 sputnik kernel: npx0: <math processor> on motherboard
May  6 11:54:31 sputnik kernel: npx0: INT 16 interface
May  6 11:54:31 sputnik kernel: acpi0: <DELL CPi R  > on motherboard
May  6 11:54:31 sputnik kernel: Timecounter "ACPI-fast" frequency 3579545 H=
z quality 1000
May  6 11:54:31 sputnik kernel: acpi_timer0: <24-bit timer at 3.579545MHz> =
port 0x808-0x80b on acpi0
May  6 11:54:31 sputnik kernel: cpu0: <ACPI CPU (2 Cx states)> on acpi0
May  6 11:54:31 sputnik kernel: acpi_throttle0: <ACPI CPU Throttling> on cp=
u0
May  6 11:54:31 sputnik kernel: acpi_acad0: <AC Adapter> on acpi0
May  6 11:54:31 sputnik kernel: acpi_cmbat0: <Control Method Battery> on ac=
pi0
May  6 11:54:31 sputnik kernel: acpi_lid0: <Control Method Lid Switch> on a=
cpi0
May  6 11:54:31 sputnik kernel: acpi_button0: <Power Button> on acpi0
May  6 11:54:31 sputnik kernel: acpi_button1: <Sleep Button> on acpi0
May  6 11:54:31 sputnik kernel: pcib0: <ACPI Host-PCI bridge> port 0xcf8-0x=
cff on acpi0
May  6 11:54:31 sputnik kernel: ACPI link \_SB_.PCI0.LNKB has invalid initi=
al irq 11, ignoring
May  6 11:54:31 sputnik kernel: pci0: <ACPI PCI bus> on pcib0
May  6 11:54:31 sputnik kernel: pci0: <base peripheral> at device 0.1 (no d=
river attached)
May  6 11:54:31 sputnik kernel: pci0: <base peripheral> at device 0.3 (no d=
river attached)
May  6 11:54:31 sputnik kernel: agp0: <Intel 8285xM (85xGM GMCH) SVGA contr=
oller> port 0xc000-0xc007 mem 0xe7f80000-0xe7ffffff,0xf0000000-0xf7ffffff i=
rq 11 at$
May  6 11:54:31 sputnik kernel: agp0: detected 892k stolen memory
May  6 11:54:31 sputnik kernel: agp0: aperture size is 128M
May  6 11:54:31 sputnik kernel: pci0: <display> at device 2.1 (no driver at=
tached)
May  6 11:54:31 sputnik kernel: uhci0: <Intel 82801DB (ICH4) USB controller=
 USB-A> port 0xbf80-0xbf9f irq 11 at device 29.0 on pci0
May  6 11:54:31 sputnik kernel: usb0: <Intel 82801DB (ICH4) USB controller =
USB-A> on uhci0
May  6 11:54:31 sputnik kernel: usb0: USB revision 1.0
May  6 11:54:31 sputnik kernel: uhub0: Intel UHCI root hub, class 9/0, rev =
1.00/1.00, addr 1
May  6 11:54:31 sputnik kernel: uhub0: 2 ports with 2 removable, self power=
ed
May  6 11:54:31 sputnik kernel: uhci1: <Intel 82801DB (ICH4) USB controller=
 USB-B> port 0xbf40-0xbf5f irq 11 at device 29.1 on pci0
May  6 11:54:31 sputnik kernel: usb1: <Intel 82801DB (ICH4) USB controller =
USB-B> on uhci1
May  6 11:54:31 sputnik kernel: usb1: USB revision 1.0
May  6 11:54:31 sputnik kernel: uhub1: Intel UHCI root hub, class 9/0, rev =
1.00/1.00, addr 1
May  6 11:54:31 sputnik kernel: uhub1: 2 ports with 2 removable, self power=
ed
May  6 11:54:31 sputnik kernel: uhci2: <Intel 82801DB (ICH4) USB controller=
 USB-C> port 0xbf20-0xbf3f irq 11 at device 29.2 on pci0
May  6 11:54:31 sputnik kernel: usb2: <Intel 82801DB (ICH4) USB controller =
USB-C> on uhci2
May  6 11:54:31 sputnik kernel: usb2: USB revision 1.0
May  6 11:54:31 sputnik kernel: uhub2: Intel UHCI root hub, class 9/0, rev =
1.00/1.00, addr 1
May  6 11:54:31 sputnik kernel: uhub2: 2 ports with 2 removable, self power=
ed
May  6 11:54:31 sputnik kernel: pci0: <serial bus, USB> at device 29.7 (no =
driver attached)
May  6 11:54:31 sputnik kernel: pcib1: <ACPI PCI-PCI bridge> at device 30.0=
 on pci0
May  6 11:54:31 sputnik kernel: pci2: <ACPI PCI bus> on pcib1
May  6 11:54:31 sputnik kernel: cbb0: <TI1510 PCI-CardBus Bridge> at device=
 4.0 on pci2
May  6 11:54:31 sputnik kernel: cardbus0: <CardBus bus> on cbb0
May  6 11:54:31 sputnik kernel: pccard0: <16-bit PCCard bus> on cbb0
May  6 11:54:31 sputnik kernel: isab0: <PCI-ISA bridge> at device 31.0 on p=
ci0
May  6 11:54:31 sputnik kernel: isa0: <ISA bus> on isab0
May  6 11:54:31 sputnik kernel: atapci0: <Intel ICH4 UDMA100 controller> po=
rt 0xbfa0-0xbfaf,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on pci0
May  6 11:54:31 sputnik kernel: ata0: channel #0 on atapci0
May  6 11:54:31 sputnik kernel: ata1: channel #1 on atapci0
May  6 11:54:31 sputnik kernel: pcm0: <Intel ICH4 (82801DB)> port 0xcc40-0x=
cc7f,0xc800-0xc8ff mem 0xe7eff400-0xe7eff4ff,0xe7eff800-0xe7eff9ff irq 5 at=
 device $
May  6 11:54:31 sputnik kernel: pcm0: <SigmaTel STAC9750/51 AC97 Codec>
May  6 11:54:31 sputnik kernel: acpi_tz0: <Thermal Zone> on acpi0
May  6 11:54:31 sputnik kernel: atkbdc0: <Keyboard controller (i8042)> port=
 0x66,0x62,0x64,0x60 irq 1 on acpi0
May  6 11:54:31 sputnik kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
May  6 11:54:31 sputnik kernel: kbd0 at atkbd0
May  6 11:54:31 sputnik kernel: orm0: <ISA Option ROMs> at iomem 0xcf800-0x=
cffff,0xcf000-0xcf7ff,0xce800-0xcefff,0xce000-0xce7ff,0xcd800-0xcdfff,0xc00=
00-0xcd7$
May  6 11:54:31 sputnik kernel: pmtimer0 on isa0
May  6 11:54:31 sputnik kernel: ppc0: parallel port not found.
May  6 11:54:31 sputnik kernel: sc0: <System console> at flags 0x100 on isa0
May  6 11:54:31 sputnik kernel: sc0: VGA <16 virtual consoles, flags=3D0x30=
0>
May  6 11:54:31 sputnik kernel: sio0: configured irq 4 not in bitmap of pro=
bed irqs 0
May  6 11:54:31 sputnik kernel: sio0: port may not be enabled
May  6 11:54:31 sputnik kernel: sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 o=
n isa0
May  6 11:54:31 sputnik kernel: sio0: type 8250 or not responding
May  6 11:54:31 sputnik kernel: sio1: configured irq 3 not in bitmap of pro=
bed irqs 0
May  6 11:54:31 sputnik kernel: sio1: port may not be enabled
May  6 11:54:31 sputnik kernel: vga0: <Generic ISA VGA> at port 0x3c0-0x3df=
 iomem 0xa0000-0xbffff on isa0
May  6 11:54:31 sputnik kernel: ums0: Microsoft Basic Optical Mouse, rev 1.=
10/0.00, addr 2, iclass 3/1
May  6 11:54:31 sputnik kernel: ums0: 3 buttons and Z dir.
May  6 11:54:31 sputnik kernel: Timecounter "TSC" frequency 2397972040 Hz q=
uality 800
May  6 11:54:31 sputnik kernel: Timecounters tick every 10.000 msec
May  6 11:54:31 sputnik kernel: cardbus0: <network, ethernet> at device 0.0=
 (no driver attached)
May  6 11:54:31 sputnik kernel: acd0: DVDROM <TEAC DVD-ROM DV-28E-C/D.4B> a=
t ata0-master PIO4
May  6 11:54:31 sputnik kernel: ad2: 19077MB <HTS548020M9AT00/MG1OA53A> [38=
760/16/63] at ata1-master UDMA100
May  6 11:54:31 sputnik kernel: Mounting root from ufs:/dev/ad2s2a


--=20
Allan Bowhill
abowhill@blarg.net
de39313bc71ca152385e170359715f9b
This life is a test.  It is only a test.  Had this been an actual life,
you would have received further instructions as to what to do and where
to go.

--r5Pyd7+fXNt84Ff3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFCe9dMBC/kSIeFE54RAjOSAKDaYnBqvwPtIfPVaAYwjOluEXvyhwCgvGiZ
ZOEhR7hvI71g16cUC3a+64c=
=l2pM
-----END PGP SIGNATURE-----

--r5Pyd7+fXNt84Ff3--



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