NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/58666: panic: lock error: Reader / writer lock: rw_vector_enter,357: locking against myself



>> Date: Sun,  8 Sep 2024 09:42:51 +0200 (CEST)
>> From: he%NetBSD.org@localhost
>> 
>> uvm_fault_internal(ce5820e8,0,2,0,ffffffff,ffffffff,4000,1723,f4023cd4,ce5820e8) at uvm_fault_internal+0xcf
>> trap() at trap+0x472
>> --- trap (number 6) ---
>> pmap_ctor(0,e02a0600,1,0,f0,0,c1507dc0,0,f4023e24,c0cc7b3a) at pmap_ctor+0xb7
>
> Can you get the line number of pmap_ctor+0xb7 in your kernel, and
> disassemble it?
>
> $TOOLDIR/bin/i486--netbsdelf-addr2line -e ./netbsd.gdb -i pmap_ctor+0xb7
> $TOOLDIR/bin/i486--netbsdelf-gdb -ex 'disas pmap_ctor+0xb7' ./netbsd.gdb

Even though I see you have a suggested fix, for the record here
is the equivalent of the above, using a rebuilt netbsd.gdb:

Doesn't look like addr2line wants to play ball:

fxxxx# /usr/tools/bin/i486--netbsdelf-addr2line -e ./netbsd.2.gdb -i pmap_ctor+0xb7
??:0
fxxxx# 

fxxxx# gdb -q netbsd.2.gdb
...
(gdb) info line *(pmap_ctor+0xb7)
Line 2702 of "/usr/src/sys/arch/x86/x86/pmap.c"
   starts at address 0xc049e659 <pmap_ctor+174>
   and ends at 0xc049e664 <pmap_ctor+185>.

OK, this isn't disass from pmap_ctor+0xb7, but I thought this
would be easier to read (marked +0xb7 with <--):

(gdb) disass pmap_ctor
Dump of assembler code for function pmap_ctor:
   0xc049e5ab <+0>:       push   %ebp
   0xc049e5ac <+1>:       mov    %esp,%ebp
   0xc049e5ae <+3>:       push   %edi
   0xc049e5af <+4>:       push   %esi
   0xc049e5b0 <+5>:       push   %ebx
   0xc049e5b1 <+6>:       sub    $0x14,%esp
   0xc049e5b4 <+9>:       mov    0xc(%ebp),%ebx
   0xc049e5b7 <+12>:      movl   $0x0,0x8(%esp)
   0xc049e5bf <+20>:      movl   $0x2,0x4(%esp)
   0xc049e5c7 <+28>:      lea    0xc0(%ebx),%eax
   0xc049e5cd <+34>:      mov    %eax,(%esp)
   0xc049e5d0 <+37>:      call   0xc0c877dd <mutex_init>
   0xc049e5d5 <+42>:      lea    0xc4(%ebx),%eax
   0xc049e5db <+48>:      mov    %eax,(%esp)
   0xc049e5de <+51>:      call   0xc0c984ae <rw_init>
   0xc049e5e3 <+56>:      movl   $0x1,0x4(%esp)
   0xc049e5eb <+64>:      lea    0x74(%ebx),%eax
   0xc049e5ee <+67>:      mov    %eax,(%esp)
   0xc049e5f1 <+70>:      call   0xc0cbf506 <kcpuset_create>
   0xc049e5f6 <+75>:      movl   $0x1,0x4(%esp)
   0xc049e5fe <+83>:      lea    0x78(%ebx),%eax
   0xc049e601 <+86>:      mov    %eax,(%esp)
   0xc049e604 <+89>:      call   0xc0cbf506 <kcpuset_create>
   0xc049e609 <+94>:      movl   $0x0,0x88(%ebx)
   0xc049e613 <+104>:     movl   $0x0,0x54(%ebx)
   0xc049e61a <+111>:     movl   $0x0,0x60(%ebx)
   0xc049e621 <+118>:     movl   $0x0,0x58(%ebx)
   0xc049e628 <+125>:     movl   $0x0,0x5c(%ebx)
   0xc049e62f <+132>:     movl   $0x1,0x4(%esp)
   0xc049e637 <+140>:     movl   $0xc1508060,(%esp)
   0xc049e63e <+147>:     call   0xc0cc6295 <pool_get>
   0xc049e643 <+152>:     mov    %eax,0x24(%ebx)
   0xc049e646 <+155>:     mov    %ebx,0xc(%ebp)
   0xc049e649 <+158>:     mov    %eax,%ebx
   0xc049e64b <+160>:     movl   $0x0,-0x14(%ebp)
   0xc049e652 <+167>:     movl   $0x0,-0x10(%ebp)
   0xc049e659 <+174>:     mov    $0x1000,%ecx   <-- +0xb7
   0xc049e65e <+179>:     mov    %ebx,%edi
   0xc049e660 <+181>:     xor    %eax,%eax
   0xc049e662 <+183>:     rep stos %eax,%es:(%edi)
   0xc049e664 <+185>:     xor    %esi,%esi
   0xc049e666 <+187>:     lea    -0x14(%ebp),%eax
   0xc049e669 <+190>:     mov    %eax,0x8(%esp)
   0xc049e66d <+194>:     mov    %esi,%eax
   0xc049e66f <+196>:     shl    $0xc,%eax
   0xc049e672 <+199>:     add    %ebx,%eax
   0xc049e674 <+201>:     mov    %eax,0x4(%esp)
   0xc049e678 <+205>:     movl   $0xc14dfd40,(%esp)
   0xc049e67f <+212>:     call   0xc049e3f0 <pmap_extract>
   0xc049e684 <+217>:     mov    -0x14(%ebp),%eax
   0xc049e687 <+220>:     or     0xc14eb048,%eax
   0xc049e68d <+226>:     mov    -0x10(%ebp),%edx
   0xc049e690 <+229>:     or     0xc14eb04c,%edx
   0xc049e696 <+235>:     or     $0x3,%eax
   0xc049e699 <+238>:     mov    %eax,0x2fe0(%ebx,%esi,8)
   0xc049e6a0 <+245>:     mov    %edx,0x2fe4(%ebx,%esi,8)
   0xc049e6a7 <+252>:     add    $0x1,%esi
   0xc049e6aa <+255>:     cmp    $0x4,%esi
   0xc049e6ad <+258>:     jne    0xc049e666 <pmap_ctor+187>
   0xc049e6af <+260>:     lea    0x3000(%ebx),%edx
   0xc049e6b5 <+266>:     mov    0xc14955a8,%eax
   0xc049e6ba <+271>:     shl    $0x3,%eax
   0xc049e6bd <+274>:     mov    %edx,%edi
   0xc049e6bf <+276>:     mov    $0xbfdff000,%esi
   0xc049e6c4 <+281>:     cmp    $0x4,%eax
   0xc049e6c7 <+284>:     jae    0xc049e763 <pmap_ctor+440>
   0xc049e6cd <+290>:     test   $0x2,%al
   0xc049e6cf <+292>:     je     0xc049e6d3 <pmap_ctor+296>
   0xc049e6d1 <+294>:     movsw  %ds:(%esi),%es:(%edi)
   0xc049e6d3 <+296>:     test   $0x1,%al
   0xc049e6d5 <+298>:     je     0xc049e6d8 <pmap_ctor+301>
   0xc049e6d7 <+300>:     movsb  %ds:(%esi),%es:(%edi)
   0xc049e6d8 <+301>:     movl   $0xc14dfe40,(%esp)
   0xc049e6df <+308>:     call   0xc01253c0 <mutex_enter>
   0xc049e6e4 <+313>:     mov    0xc(%ebp),%eax
--Type <RET> for more, q to quit, c to continue without paging--
   0xc049e6e7 <+316>:     mov    0x24(%eax),%esi
   0xc049e6ea <+319>:     mov    0xc14955a8,%eax
   0xc049e6ef <+324>:     mov    0x2ffc(%esi,%eax,8),%edx
   0xc049e6f6 <+331>:     or     0x2ff8(%esi,%eax,8),%edx
   0xc049e6fd <+338>:     je     0xc049e77c <pmap_ctor+465>
   0xc049e6ff <+340>:     mov    0xc(%ebp),%ebx
   0xc049e702 <+343>:     xor    %eax,%eax
   0xc049e704 <+345>:     mov    0x2fe0(%esi,%eax,8),%ecx
   0xc049e70b <+352>:     and    $0xfffff000,%ecx
   0xc049e711 <+358>:     mov    0x2fe4(%esi,%eax,8),%edx
   0xc049e718 <+365>:     and    $0xfffff,%edx
   0xc049e71e <+371>:     mov    %ecx,0x28(%ebx,%eax,8)
   0xc049e722 <+375>:     mov    %edx,0x2c(%ebx,%eax,8)
   0xc049e726 <+379>:     add    $0x1,%eax
   0xc049e729 <+382>:     cmp    $0x4,%eax
   0xc049e72c <+385>:     jne    0xc049e704 <pmap_ctor+345>
   0xc049e72e <+387>:     mov    0xc1508040,%eax
   0xc049e733 <+392>:     mov    %eax,0x1c(%ebx)
   0xc049e736 <+395>:     test   %eax,%eax
   0xc049e738 <+397>:     je     0xc049e740 <pmap_ctor+405>
   0xc049e73a <+399>:     lea    0x1c(%ebx),%edx
   0xc049e73d <+402>:     mov    %edx,0x20(%eax)
   0xc049e740 <+405>:     mov    %ebx,0xc1508040
   0xc049e746 <+411>:     movl   $0xc1508040,0x20(%ebx)
   0xc049e74d <+418>:     movl   $0xc14dfe40,(%esp)
   0xc049e754 <+425>:     call   0xc01253e0 <mutex_exit>
   0xc049e759 <+430>:     xor    %eax,%eax
   0xc049e75b <+432>:     add    $0x14,%esp
   0xc049e75e <+435>:     pop    %ebx
   0xc049e75f <+436>:     pop    %esi
   0xc049e760 <+437>:     pop    %edi
   0xc049e761 <+438>:     pop    %ebp
   0xc049e762 <+439>:     ret    
   0xc049e763 <+440>:     test   $0x1,%dl
   0xc049e766 <+443>:     jne    0xc049e7a4 <pmap_ctor+505>
   0xc049e768 <+445>:     test   $0x2,%edi
   0xc049e76e <+451>:     jne    0xc049e793 <pmap_ctor+488>
   0xc049e770 <+453>:     mov    %eax,%ecx
   0xc049e772 <+455>:     shr    $0x2,%ecx
   0xc049e775 <+458>:     rep movsl %ds:(%esi),%es:(%edi)
   0xc049e777 <+460>:     jmp    0xc049e6cd <pmap_ctor+290>
   0xc049e77c <+465>:     movl   $0xc14dfe40,(%esp)
   0xc049e783 <+472>:     call   0xc01253e0 <mutex_exit>
   0xc049e788 <+477>:     mov    0xc(%ebp),%eax
   0xc049e78b <+480>:     mov    0x24(%eax),%ebx
   0xc049e78e <+483>:     jmp    0xc049e64b <pmap_ctor+160>
   0xc049e793 <+488>:     movzwl (%esi),%edx
   0xc049e796 <+491>:     mov    %dx,(%edi)
   0xc049e799 <+494>:     add    $0x2,%edi
   0xc049e79c <+497>:     add    $0x2,%esi
   0xc049e79f <+500>:     sub    $0x2,%eax
   0xc049e7a2 <+503>:     jmp    0xc049e770 <pmap_ctor+453>
   0xc049e7a4 <+505>:     movzbl 0xbfdff000,%ecx
   0xc049e7ab <+512>:     mov    %cl,0x3000(%ebx)
   0xc049e7b1 <+518>:     lea    0x3001(%ebx),%edi
   0xc049e7b7 <+524>:     mov    $0xbfdff001,%esi
   0xc049e7bc <+529>:     sub    $0x1,%eax
   0xc049e7bf <+532>:     jmp    0xc049e768 <pmap_ctor+445>
End of assembler dump.
(gdb) 



Home | Main Index | Thread Index | Old Index