Kernel panic on keyboard-interaction with rc.local and ACPI

Allan Bowhill allanb at u.washington.edu
Fri May 6 13:48:41 PDT 2005


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 
kernel panic when I interact on the keyboard with a rc.local script. 

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 select a 
wifi station to login to during boot time. The machine is a  laptop: Dell 
Inspiron 1150. It's probably bad form to have an interactive script on
boot, but anyway... 

here is the rc.local script:

== 

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"

==

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 
              DPL 0, pres 1, def32 1, gran 1
processor eflags: interrupt enabled, resume IOPL=0
current process: 13 (irq1: atkbd0)
trap number: 12
panic: page fault
Uptime: 36s                    
Cannot dump. no demp device defined.

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

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

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

453     atkbd_intr(keyboard_t *kbd, void *arg)
454     {
(kgdb) 
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;
  
        kbd = (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 interrupt 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 running...


--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 conditions.
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" : "=r" (td));
(kgdb) where
#0  doadump () at pcpu.h:160
#1  0xc0665172 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:410
#2  0xc0665479 in panic (fmt=0xc08a0119 "%s") at /usr/src/sys/kern/kern_shutdown.c:566
#3  0xc085566d in trap_fatal (frame=0xcbc60c34, eva=0) at /usr/src/sys/i386/i386/trap.c:817
#4  0xc0855390 in trap_pfault (frame=0xcbc60c34, usermode=0, eva=1946724444) at /usr/src/sys/i386/i386/trap.c:735
#5  0xc0854f5c in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = -1066991600, tf_edi = 13, tf_esi = -1063617632, tf_ebp = -876213100, tf_isp = -876213152, tf_ebx = -1050240512, tf_edx = -1066827385, tf_ecx = -1063864572, tf_eax = 13, tf_trapno = 12, tf_err = 0, tf_eip = 1946724444, tf_cs = 8, tf_eflags = 66050, tf_esp = -1065129891, tf_ss = 13}) at /usr/src/sys/i386/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=0xc09a7ba0, uap=0x0) at /usr/src/sys/kern/kern_thr.c:160
#10 0xc082659e in atkbd_intr (kbd=0xc0991ba0, arg=0x0) at /usr/src/sys/dev/kbd/atkbd.c:461
#11 0xc085d8db in atkbd_isa_intr (arg=0x0) at /usr/src/sys/isa/atkbd_isa.c:177
#12 0xc064db55 in ithread_loop (arg=0xc14f7c00) at /usr/src/sys/kern/kern_intr.c:547
#13 0xc064cb7e in fork_exit (callout=0xc064d9b6 <ithread_loop>, arg=0x0, frame=0x0) at /usr/src/sys/kern/kern_fork.c:791
#14 0xc08431dc in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:209

===
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. 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 at sputnik.attbi.com:/usr/obj/usr/src/sys/GENERIC
May  6 11:54:31 sputnik kernel: Timecounter "i8254" frequency 1193182 Hz quality 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 = "GenuineIntel"  Id = 0xf29  Stepping = 9
May  6 11:54:31 sputnik kernel: Features=0xbfebf9ff<FPU,VME,DE,PSE,TSC,MSR,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  = 267161600 (254 MB)
May  6 11:54:31 sputnik kernel: avail memory = 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 Hz 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 cpu0
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 acpi0
May  6 11:54:31 sputnik kernel: acpi_lid0: <Control Method Lid Switch> on acpi0
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-0xcff on acpi0
May  6 11:54:31 sputnik kernel: ACPI link \_SB_.PCI0.LNKB has invalid initial 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 driver attached)
May  6 11:54:31 sputnik kernel: pci0: <base peripheral> at device 0.3 (no driver attached)
May  6 11:54:31 sputnik kernel: agp0: <Intel 8285xM (85xGM GMCH) SVGA controller> port 0xc000-0xc007 mem 0xe7f80000-0xe7ffffff,0xf0000000-0xf7ffffff irq 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 attached)
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 powered
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 powered
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 powered
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 pci0
May  6 11:54:31 sputnik kernel: isa0: <ISA bus> on isab0
May  6 11:54:31 sputnik kernel: atapci0: <Intel ICH4 UDMA100 controller> port 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-0xcc7f,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-0xcffff,0xcf000-0xcf7ff,0xce800-0xcefff,0xce000-0xce7ff,0xcd800-0xcdfff,0xc0000-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=0x300>
May  6 11:54:31 sputnik kernel: sio0: configured irq 4 not in bitmap of probed 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 on 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 probed 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 quality 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> at ata0-master PIO4
May  6 11:54:31 sputnik kernel: ad2: 19077MB <HTS548020M9AT00/MG1OA53A> [38760/16/63] at ata1-master UDMA100
May  6 11:54:31 sputnik kernel: Mounting root from ufs:/dev/ad2s2a


-- 
Allan Bowhill
abowhill at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050506/21455b15/attachment.bin


More information about the freebsd-questions mailing list