Project

General

Profile

Actions

Bug #1004

closed

UP kernel crashes

Added by sepherosa over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi,

Following line is printed immediately after copyrights prints:
panic: assertion: (newpte & VPTE_MANAGED) == 0 || m->flags & PG_MAPPED
in pmap_enter

Back trace shows no function name.

SMP kernel works without problem.

Best Regards,
sephe

Actions #1

Updated by dillon over 16 years ago

:Hi,
:
:Following line is printed immediately after copyrights prints:
:panic: assertion: (newpte & VPTE_MANAGED) == 0 || m->flags & PG_MAPPED
:in pmap_enter
:
:Back trace shows no function name.
:
:SMP kernel works without problem.
:
:Best Regards,
:sephe
:
:--
:Live Free or Die

Ok, I'll track it down a little later today.  I added a bunch of
assertions on the page management state so something isn't acting
the way it should be. It's going to be something simple.
-Matt
Matthew Dillon
<>
Actions #2

Updated by dillon over 16 years ago

:Hi,
:
:Following line is printed immediately after copyrights prints:
:panic: assertion: (newpte & VPTE_MANAGED) == 0 || m->flags & PG_MAPPED
:in pmap_enter
:
:Back trace shows no function name.
:
:SMP kernel works without problem.
:
:Best Regards,
:sephe

I haven't been able to reproduce this.  My UP vkernel boots ok.
Could you try gdb'ing your vkernel after it drops into DDB and see
if gdb can produce a backtrace ?
-Matt
Matthew Dillon
<>
Actions #3

Updated by sepherosa over 16 years ago

On Sun, May 11, 2008 at 1:26 AM, Matthew Dillon
<> wrote:

:Hi,
:
:Following line is printed immediately after copyrights prints:
:panic: assertion: (newpte & VPTE_MANAGED) == 0 || m->flags & PG_MAPPED
:in pmap_enter
:
:Back trace shows no function name.
:
:SMP kernel works without problem.
:
:Best Regards,
:sephe

I haven't been able to reproduce this. My UP vkernel boots ok.

Could you try gdb'ing your vkernel after it drops into DDB and see
if gdb can produce a backtrace ?

Grr, my working kernel is relatively old and panics upon vnconfig
vkernel root image.
But I built a GENERIC kernel and managed to map the backtrace address
to the function name:
begin (0xc0141beb)
mi_startup (0xc029ad61)
vm_mem_init (0xc041bfcc)
pmap_init (0xc04a1286)
kmem_alloc3 (0xc041c500)
vm_map_wire (0xc041fb10)
vm_fault_wire (0xc041b766)
vm_fault (0xc041b602)
pmap_enter (0xc04a37b3)
panic (0xc02bbd53)

Hope this will be helpful
I am uploading kernel image to leaf

Best Regards,
sephe

Actions #4

Updated by sepherosa over 16 years ago

It is at ~sephe/crash/kernel.bz2

Actions #5

Updated by swildner over 16 years ago

Just for the record, I see this panic here too on my laptop.

Sascha

Actions #6

Updated by mneumann over 16 years ago

Sascha Wildner wrote:
> Sepherosa Ziehau wrote:
>> Hi,
>>
>> Following line is printed immediately after copyrights prints:
>> panic: assertion: (newpte & VPTE_MANAGED) 0 || m->flags & PG_MAPPED
>> in pmap_enter
>>
>> Back trace shows no function name.
>>
>> SMP kernel works without problem.
>
> Just for the record, I see this panic here too on my laptop.

Me too in a Qemu instance.

The following patch should fix it (works fine here).

Regards,

Michael

Index: pmap.c
=================================================================
RCS file: /home/dcvs/src/sys/platform/pc32/i386/pmap.c,v
retrieving revision 1.84
diff u -r1.84 pmap.c
--
pmap.c 9 May 2008 07:24:46 0000 1.84
++ pmap.c 11 May 2008 13:49:19 -0000
@ -2102,7 +2102,7 @
if (newpte & PG_RW)
vm_page_flag_set(m, PG_WRITEABLE);
}
KKASSERT 0 || m->flags & PG_MAPPED);
KKASSERT((newpte & PG_MANAGED) 0 || (m->flags & PG_MAPPED));
pmap_inval_flush(&info);
}

Actions #7

Updated by swildner over 16 years ago

Yep, your patch works for me too.

Sascha

Actions #8

Updated by dillon over 16 years ago

:Me too in a Qemu instance.
:
:The following patch should fix it (works fine here).
:
:Regards,
:
: Michael
:
:Index: pmap.c
:===================================================================
:RCS file: /home/dcvs/src/sys/platform/pc32/i386/pmap.c,v
:retrieving revision 1.84
:diff u -r1.84 pmap.c
:--
pmap.c 9 May 2008 07:24:46 0000 1.84
:+++ pmap.c 11 May 2008 13:49:19 -0000
:@ -2102,7 +2102,7 @
: if (newpte & PG_RW)
: vm_page_flag_set(m, PG_WRITEABLE);
: }
:
KKASSERT 0 || m->flags & PG_MAPPED);
:+ KKASSERT((newpte & PG_MANAGED) 0 || (m->flags & PG_MAPPED));
: pmap_inval_flush(&info);
: }

Nice catch!  Silly me, I was using a vkernel define in the real 
kernel's pmap module :-)
I've committed the fix.
-Matt
Matthew Dillon
&lt;&gt;
Actions

Also available in: Atom PDF