Bug 24958

Summary: Fatal trap 12 in kernel mode (swapper) on Compaq Presario
Product: Base System Reporter: pscott <pscott>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-CURRENT   
Hardware: Any   
OS: Any   

Description pscott 2001-02-08 22:10:01 UTC
4.2-CURRENT installs without a hitch on Compaq Presario. Even X11 
installs fine with the NVidia TNT2 display adapter. However, after
completing the installation, the machine will not boot the kernel.
This is the GENERIC kernel as delivered on the CDROM.

Receives the following:

Fatal trap 12: page fault while in kernel mode
fault virtual address      = 0x1
fault code                 = supervisor read, page not present
instruction pointer        = 0x8:0xc019fe83
stack pointer              = 0x10:0xc044aec0
frame pointer              = 0x10:0xc044aedc
code segment               = base rx0, limit 0xfffff, type 0x1b
                           = dpl 0, pres 1, def32 1, gran 1
processor eflags           = interrupt enabled, resume, iopl = 0
current process            = 0 (swapper)
interrupt mask             = net tty bio cam
trap number                = 12
panic: page fault

How-To-Repeat: boot from disk after install.
Comment 1 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-02-09 18:28:12 UTC
State Changed
From-To: open->closed

Try the mailing lists first.
Comment 2 pscott 2001-02-10 07:08:51 UTC
More information:

#nm -n kernel | grep c019f
...
c019f7a0 t msginit
c019f90c T msgsys
c019f938 t msg_freehdr
c019f9e0 T msgctl
c019fbc0 T msgget
c019fd60 T msgsnd  <----- Here!

#nm --size-sort kernel | egrep "(msgget)|(msgsnd)"
000001a0 T msgget
00000400 T msgsnd  <----- Definitely long enough!

#gdb /sys/compile/GENERIC/sysv_msg.o
(gdb) disas msgsnd
Dump of assembler code for function msgsnd:
0x5c0 <msgsnd>: push   %ebp
0x5c1 <msgsnd+1>:       mov    %esp,%ebp
0x5c3 <msgsnd+3>:       sub    $0x18,%esp
0x5c6 <msgsnd+6>:       push   %edi
0x5c7 <msgsnd+7>:       push   %esi
0x5c8 <msgsnd+8>:       push   %ebx
0x5c9 <msgsnd+9>:       mov    0xc(%ebp),%ecx
...
0x6c6 <msgsnd+262>:     call   0x6c7 <msgsnd+263>
0x6cb <msgsnd+267>:     mov    %eax,0xfffffff0(%ebp)
0x6ce <msgsnd+270>:     add    $0x10,%esp
0x6d1 <msgsnd+273>:     test   %ebx,%ebx
0x6d3 <msgsnd+275>:     je     0x6db <msgsnd+283>
0x6d5 <msgsnd+277>:     andw   $0xfdff,0x8(%esi)
0x6db <msgsnd+283>:     cmpl   $0x0,0xfffffff0(%ebp)
0x6df <msgsnd+287>:     jne    0x94c <msgsnd+908>
0x6e5 <msgsnd+293>:     cmpl   $0x0,0x20(%esi)     < --- Doesn't match dump!
0x6e9 <msgsnd+297>:     jne    0x654 <msgsnd+148>
0x6ef <msgsnd+303>:     mov    $0x52,%eax
0x6f4 <msgsnd+308>:     jmp    0x9b7 <msgsnd+1015>

A little math:

( ip = 0xc019fe83 ) - ( msgsnd = 0xc019fd60 ) = 0x0123
( msgsnd = 0x05c0 ) + ( 0x0123 ) = 0x06e3  < --- Doesn't match code!

Could be a wild interrupt vector. Can't check for conflicts because
the userconfig (boot -c) won't work either (pr kern/24957). Will attempt
to get userconfig to work on console attached to serial port (boot -h).
More to come . . .

Paul
Comment 3 pscott 2001-02-10 17:56:15 UTC
> "Paul A. Scott" <pscott@the-frontier.org> writes:
>>  #gdb /sys/compile/GENERIC/sysv_msg.o

>This is meaningless unless the kernel that crashed includes this
>precise object file.

You are correct. But, I compiled and linked the GENERIC kernel to get
sysv_msg.o and it matches exactly in size the kernel on the CDROM. All the
offsets in sysv_msg.o also match the offsets in the kernel. It's a good bet
they're the same. I'll get further into this when I'm back to work on
Monday.

>This still belongs on the lists, not in a PR.

Why? Seriously, I'd like to know what criteria you use for defining a
"problem." Let's look at this rationally. I have a brand-new, current
generation, Compaq Presario right out of the box. With the help of V-com's
System Commander 2000 boot manager, I installed Windows Me, and Windows/2000
Server on the box without any problems. Both Microsoft OS's run fine.
However, after installing FreeBSD 4.2-RELEASE on the box--which actually
installed without any problems--I boot the kernel and after it probes ppi0
it panics. Furthermore, I can't even use the userconfig utility because the
syscons driver
can't even write to the screen in an age-old standard way.

Lemme see, MS Windows runs, FreeBSD GENERIC doesn't. All devices are
standard ATA, PCI, and PNP; no ISA or legacy hardware.

  * kernel panics after probing ppi0
  * userconfig scrambles screen

Wouldn't you call these problems?

I spent 4 hours searching your precious mailing lists archives. Couldn't
find anything even close to kern/24957 and kern 24958.

You should know that I've been an avid FreeBSD user--and a minor
hacker--since the first FreeBSD 1.0 CDROM was delivered. I have a Walnut
Creek subscription and have installed and used in business--and
personally--nearly every release through 4.2-RELEASE. In that time, I've
reported a half-dozen pr reports, all of them received courteous responses,
and most were fixed in the next release. At one time, I submitted a patch to
the matcd driver, which made it into the next release. In conf/3354 I
reported a problem with the syscons driver, which is very similar to
kern/24957 I'm now reporting, and was e-mailed a fix by a very courteous
Kazutaka san. Over the past 8 years, I've become quite familiar with
FreeBSD.

So, with that background, please explain why this isn't a problem, and why
it doesn't belong in gnats.

Paul