Bug #1004

UP kernel crashes

Added by sepherosa about 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

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

History

#1 Updated by dillon about 6 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
<>

#2 Updated by dillon about 6 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
<>

#3 Updated by sepherosa about 6 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

#4 Updated by sepherosa about 6 years ago

It is at ~sephe/crash/kernel.bz2

#5 Updated by swildner about 6 years ago

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

Sascha

#6 Updated by mneumann about 6 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((newpte & VPTE_MANAGED) == 0 || m->flags & PG_MAPPED);
+ KKASSERT((newpte & PG_MANAGED) == 0 || (m->flags & PG_MAPPED));
pmap_inval_flush(&info);
}

#7 Updated by swildner about 6 years ago

Yep, your patch works for me too.

Sascha

#8 Updated by dillon about 6 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((newpte & VPTE_MANAGED) == 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
<>

Also available in: Atom PDF