Subject: NULL reference gives kernel panic
To: None <port-sh3@netbsd.org>
From: Marcus Comstedt <marcus@mc.pp.se>
List: port-sh3
Date: 05/01/2002 18:03:17
This is probably a feature of the new pmap code.  If a NULL pointer is
dereferenced from user code, you don't get a normal segfault, but
instead the kernel panics!

Reproduction recipe:

% cat > bomb.s

        mov #0,r0
        mov.b @r0,r0
        rts
        nop

% as -o bomb.o bomb.s
% ld -m shlunx -o bomb bomb.o
% ./bomb
panic: kernel debugging assertion "((((int)va < 0) && (pmap == pmap_kernel())) || (((int)va > 0) && (pmap != pmap_kernel()))) && va != 0" failed: file "../../../../arch/sh3/sh3/pmap.c", line 876

Stopped in pid 177 (bomb) at    0x8c0bbd36:     mov     r14,r15
db>


  // Marcus