Opened 10 years ago

Closed 10 years ago

#4158 closed bug (fixed)

Unable to boot with r31942+ with kernel tracing enabled

Reported by: anevilyak Owned by: bonefish
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

With a current version I get a panic very early in the boot process such that I can't even invoke the kernel debugger. I see this on serial:

Welcome to kernel debugger output!
Haiku revision: 31957
CPU 0: type 0 family 15 extended_family 0 model 11 extended_model 2 stepping 1, string 'AuthenticAMD'
CPU 0: vendor 'AMD' model name 'AMD Athlon(tm) 64 X2 Dual Core Processor 3800+'
CPU 0: features: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfsh mmx fxsr sse sse2 htt sse3 syscall nx mmxext ffxsr long 3dnowext 3dnow
heap_add_area: area -1 added to small heap 0x81191000 - usable range 0x8119e000 - 0x81991000
heap_add_area: area -1 added to medium heap 0x81991000 - usable range 0x81992000 - 0x81e5d000
heap_add_area: area -1 added to large heap 0x81e5dccc - usable range 0x81e5f000 - 0x82191000
slab: init base 0x82191000 + 0x4000
PANIC: page fault, but interrupts were disabled. Touching address 0x0000000c from eip 0x80074d41

Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0

Offhand the only revision I see today that could be a potential culprit is hrev31941, binary searching now to verify if that is indeed the culprit or not.

Change History (14)

comment:1 by anevilyak, 10 years ago

Confirmed that it still boots at hrev31940, checking hrev31941 now.

comment:2 by anevilyak, 10 years ago

Owner: changed from axeld to bonefish

The culprit is in fact hrev31942. If it helps, I have 1GB of RAM and a 200MB trace buffer.

comment:3 by anevilyak, 10 years ago

Further info: reducing the trace buffer to 20MB has the same result ; disabling tracing entirely however results in a bootable system. Anything I can do to help narrow this down?

comment:4 by bonefish, 10 years ago

I believe the kernel debugger should be usable. You just don't get on-screen output. I.e. you can type on the machine and get the output via serial output. A stack trace would be very much appreciated. If it doesn't work please attach an objdump of the function hit by the eip.

comment:5 by bonefish, 10 years ago

Forgot to ask: Does this happen on the first boot or only on reboots?

in reply to:  5 comment:6 by anevilyak, 10 years ago

Replying to bonefish:

Forgot to ask: Does this happen on the first boot or only on reboots?

That was on first boot, building with tracing enabled right now to get you the requested backtrace.

comment:7 by anevilyak, 10 years ago

Keyboard input to the kernel debugger does indeed work, but it recognizes none of its commands at this point:

kdebug> bt
Unknown command "bt". Enter "help" to get a list of all supported commands.
kdebug> sc
Unknown command "sc". Enter "help" to get a list of all supported commands.
kdebug> help
Unknown command "help". Enter "help" to get a list of all supported commands.

Assuming I did so correctly, objdump:

[rene@leviathan ~/devel/haiku/generated-gcc4/objects/haiku/x86/release/system/kernel]$ objdump -d --start-address=0x80074e09 ./kernel_x86 | less

./kernel_x86:     file format elf32-i386-freebsd

Disassembly of section .text:

80074e09 <_ZL14allocate_entrymt+0x14>:
80074e09:       83 78 0c 00             cmpl   $0x0,0xc(%eax)
80074e0d:       0f 84 4b 01 00 00       je     80074f5e <_ZL14allocate_entrymt+0x169>
80074e13:       85 db                   test   %ebx,%ebx
80074e15:       0f 84 43 01 00 00       je     80074f5e <_ZL14allocate_entrymt+0x169>
80074e1b:       81 fb fb ff 00 00       cmp    $0xfffb,%ebx
80074e21:       0f 87 37 01 00 00       ja     80074f5e <_ZL14allocate_entrymt+0x169>
80074e27:       e9 41 01 00 00          jmp    80074f6d <_ZL14allocate_entrymt+0x178>
80074e2c:       9c                      pushf
80074e2d:       58                      pop    %eax
80074e2e:       fa                      cli
80074e2f:       c1 e8 09                shr    $0x9,%eax
80074e32:       83 e0 01                and    $0x1,%eax
80074e35:       89 45 ec                mov    %eax,0xffffffec(%ebp)
80074e38:       83 ec 0c                sub    $0xc,%esp
80074e3b:       ff 75 e4                pushl  0xffffffe4(%ebp)
80074e3e:       e8 80 fd fd ff          call   80054bc3 <acquire_spinlock>
80074e43:       c6 45 eb 01             movb   $0x1,0xffffffeb(%ebp)
80074e47:       83 c4 10                add    $0x10,%esp
80074e4a:       8d 43 03                lea    0x3(%ebx),%eax
80074e4d:       c1 e8 02                shr    $0x2,%eax
80074e50:       89 45 f0                mov    %eax,0xfffffff0(%ebp)
80074e53:       89 c7                   mov    %eax,%edi
80074e55:       47                      inc    %edi
80074e56:       a1 f0 56 13 80          mov    0x801356f0,%eax
80074e5b:       8d 14 bd 00 00 00 00    lea    0x0(,%edi,4),%edx
80074e62:       03 50 0c                add    0xc(%eax),%edx
80074e65:       8b 40 04                mov    0x4(%eax),%eax
80074e68:       05 00 00 40 01          add    $0x1400000,%eax
80074e6d:       39 c2                   cmp    %eax,%edx
80074e6f:       77 0f                   ja     80074e80 <_ZL14allocate_entrymt+0x8b>
80074e71:       eb 63                   jmp    80074ed6 <_ZL14allocate_entrymt+0xe1>
80074e73:       e8 ff f9 ff ff          call   80074877 <_ZL16free_first_entryv>
80074e78:       84 c0                   test   %al,%al
80074e7a:       0f 84 a2 00 00 00       je     80074f22 <_ZL14allocate_entrymt+0x12d>
80074e80:       a1 f0 56 13 80          mov    0x801356f0,%eax
80074e85:       8b 50 0c                mov    0xc(%eax),%edx
80074e88:       39 50 08                cmp    %edx,0x8(%eax)
80074e8b:       77 e6                   ja     80074e73 <_ZL14allocate_entrymt+0x7e>
80074e8d:       39 50 04                cmp    %edx,0x4(%eax)
80074e90:       0f 84 f3 00 00 00       je     80074f89 <_ZL14allocate_entrymt+0x194>
80074e96:       e8 dc f9 ff ff          call   80074877 <_ZL16free_first_entryv>
80074e9b:       84 c0                   test   %al,%al
80074e9d:       0f 85 e6 00 00 00       jne    80074f89 <_ZL14allocate_entrymt+0x194>
80074ea3:       eb 7d                   jmp    80074f22 <_ZL14allocate_entrymt+0x12d>
80074ea5:       66 81 22 00 c0          andw   $0xc000,(%edx)
80074eaa:       8a 42 03                mov    0x3(%edx),%al
80074ead:       83 e0 0f                and    $0xf,%eax
80074eb0:       83 c8 10                or     $0x10,%eax
80074eb3:       88 42 03                mov    %al,0x3(%edx)
80074eb6:       8b 4b 04                mov    0x4(%ebx),%ecx
80074eb9:       89 4b 0c                mov    %ecx,0xc(%ebx)
80074ebc:       89 c8                   mov    %ecx,%eax
80074ebe:       29 d0                   sub    %edx,%eax
80074ec0:       89 c2                   mov    %eax,%edx
80074ec2:       c1 e2 0c                shl    $0xc,%edx
80074ec5:       81 e2 00 c0 ff 0f       and    $0xfffc000,%edx
80074ecb:       8b 01                   mov    (%ecx),%eax
80074ecd:       25 ff 3f 00 f0          and    $0xf0003fff,%eax
80074ed2:       09 d0                   or     %edx,%eax
80074ed4:       89 01                   mov    %eax,(%ecx)
80074ed6:       a1 f0 56 13 80          mov    0x801356f0,%eax
80074edb:       8b 50 08                mov    0x8(%eax),%edx
80074ede:       8b 40 0c                mov    0xc(%eax),%eax
80074ee1:       39 c2                   cmp    %eax,%edx
80074ee3:       0f 86 b2 00 00 00       jbe    80074f9b <_ZL14allocate_entrymt+0x1a6>
80074ee9:       29 c2                   sub    %eax,%edx
80074eeb:       89 d3                   mov    %edx,%ebx
80074eed:       c1 fb 02                sar    $0x2,%ebx
80074ef0:       39 df                   cmp    %ebx,%edi
80074ef2:       0f 86 a3 00 00 00       jbe    80074f9b <_ZL14allocate_entrymt+0x1a6>
80074ef8:       a1 f0 56 13 80          mov    0x801356f0,%eax
80074efd:       8b 40 08                mov    0x8(%eax),%eax
80074f00:       8b 00                   mov    (%eax),%eax
80074f02:       89 c6                   mov    %eax,%esi
80074f04:       81 e6 ff 3f 00 00       and    $0x3fff,%esi
80074f0a:       e8 68 f9 ff ff          call   80074877 <_ZL16free_first_entryv>
80074f0f:       84 c0                   test   %al,%al
80074f11:       74 0f                   je     80074f22 <_ZL14allocate_entrymt+0x12d>
80074f13:       89 f0                   mov    %esi,%eax
80074f15:       25 ff ff 00 00          and    $0xffff,%eax
80074f1a:       01 c3                   add    %eax,%ebx
80074f1c:       39 df                   cmp    %ebx,%edi
80074f1e:       77 d8                   ja     80074ef8 <_ZL14allocate_entrymt+0x103>
80074f20:       eb 79                   jmp    80074f9b <_ZL14allocate_entrymt+0x1a6>
80074f22:       bb 00 00 00 00          mov    $0x0,%ebx
80074f27:       eb 03                   jmp    80074f2c <_ZL14allocate_entrymt+0x137>
80074f29:       ff 46 10                incl   0x10(%esi)
80074f2c:       83 7d e4 00             cmpl   $0x0,0xffffffe4(%ebp)
80074f30:       74 31                   je     80074f63 <_ZL14allocate_entrymt+0x16e>
80074f32:       80 7d eb 00             cmpb   $0x0,0xffffffeb(%ebp)
80074f36:       74 2b                   je     80074f63 <_ZL14allocate_entrymt+0x16e>
80074f38:       83 ec 0c                sub    $0xc,%esp
80074f3b:       ff 75 e4                pushl  0xffffffe4(%ebp)
80074f3e:       e8 7f f8 fd ff          call   800547c2 <release_spinlock>
80074f43:       83 c4 10                add    $0x10,%esp
80074f46:       8b 45 ec                mov    0xffffffec(%ebp),%eax
80074f49:       f7 d8                   neg    %eax
80074f4b:       25 00 02 00 00          and    $0x200,%eax
80074f50:       9c                      pushf
80074f51:       5a                      pop    %edx
80074f52:       81 e2 ff fd ff ff       and    $0xfffffdff,%edx
80074f58:       09 c2                   or     %eax,%edx
80074f5a:       52                      push   %edx
80074f5b:       9d                      popf
80074f5c:       eb 05                   jmp    80074f63 <_ZL14allocate_entrymt+0x16e>
80074f5e:       bb 00 00 00 00          mov    $0x0,%ebx
80074f63:       89 d8                   mov    %ebx,%eax
80074f65:       8d 65 f4                lea    0xfffffff4(%ebp),%esp
80074f68:       5b                      pop    %ebx
80074f69:       5e                      pop    %esi
80074f6a:       5f                      pop    %edi
80074f6b:       5d                      pop    %ebp
80074f6c:       c3                      ret
80074f6d:       83 c0 1c                add    $0x1c,%eax
80074f70:       89 45 e4                mov    %eax,0xffffffe4(%ebp)
80074f73:       0f 85 b3 fe ff ff       jne    80074e2c <_ZL14allocate_entrymt+0x37>
80074f79:       c6 45 eb 00             movb   $0x0,0xffffffeb(%ebp)
80074f7d:       c7 45 ec 00 00 00 00    movl   $0x0,0xffffffec(%ebp)
80074f84:       e9 c1 fe ff ff          jmp    80074e4a <_ZL14allocate_entrymt+0x55>
80074f89:       8b 1d f0 56 13 80       mov    0x801356f0,%ebx
80074f8f:       8b 53 0c                mov    0xc(%ebx),%edx
80074f92:       3b 53 04                cmp    0x4(%ebx),%edx
80074f95:       0f 85 0a ff ff ff       jne    80074ea5 <_ZL14allocate_entrymt+0xb0>
80074f9b:       8b 35 f0 56 13 80       mov    0x801356f0,%esi
80074fa1:       8b 5e 0c                mov    0xc(%esi),%ebx
80074fa4:       8b 4d f0                mov    0xfffffff0(%ebp),%ecx
80074fa7:       81 e1 ff 3f 00 00       and    $0x3fff,%ecx
80074fad:       8b 03                   mov    (%ebx),%eax
80074faf:       25 00 c0 ff ff          and    $0xffffc000,%eax
80074fb4:       09 c8                   or     %ecx,%eax
80074fb6:       66 89 03                mov    %ax,(%ebx)
80074fb9:       8a 55 e2                mov    0xffffffe2(%ebp),%dl
80074fbc:       c1 e2 04                shl    $0x4,%edx
80074fbf:       8a 43 03                mov    0x3(%ebx),%al
80074fc2:       83 e0 0f                and    $0xf,%eax
80074fc5:       09 d0                   or     %edx,%eax
80074fc7:       88 43 03                mov    %al,0x3(%ebx)
80074fca:       8b 55 f0                mov    0xfffffff0(%ebp),%edx
80074fcd:       c1 e2 02                shl    $0x2,%edx
80074fd0:       03 56 0c                add    0xc(%esi),%edx
80074fd3:       89 56 0c                mov    %edx,0xc(%esi)
80074fd6:       81 e1 ff 3f 00 00       and    $0x3fff,%ecx
80074fdc:       c1 e1 0e                shl    $0xe,%ecx
80074fdf:       8b 02                   mov    (%edx),%eax
80074fe1:       25 ff 3f 00 f0          and    $0xf0003fff,%eax
80074fe6:       09 c8                   or     %ecx,%eax
80074fe8:       89 02                   mov    %eax,(%edx)
80074fea:       f6 45 e2 04             testb  $0x4,0xffffffe2(%ebp)
80074fee:       0f 84 35 ff ff ff       je     80074f29 <_ZL14allocate_entrymt+0x134>
80074ff4:       e9 33 ff ff ff          jmp    80074f2c <_ZL14allocate_entrymt+0x137>

If necessary, I can attach a zipped copy of the relevant kernel_x86 binary.

comment:8 by anevilyak, 10 years ago

Grr....too early in the morning. Here's the beginning of the function in question:

80074df5 <_ZL14allocate_entrymt>:
80074df5:       55                      push   %ebp
80074df6:       89 e5                   mov    %esp,%ebp
80074df8:       57                      push   %edi
80074df9:       56                      push   %esi
80074dfa:       53                      push   %ebx
80074dfb:       83 ec 1c                sub    $0x1c,%esp
80074dfe:       89 c3                   mov    %eax,%ebx
80074e00:       66 89 55 e2             mov    %dx,0xffffffe2(%ebp)
80074e04:       a1 f0 56 13 80          mov    0x801356f0,%eax

comment:9 by anevilyak, 10 years ago

Summary: Unable to boot with r31957Unable to boot with r31942+ with kernel tracing enabled

comment:10 by bonefish, 10 years ago

The matching eip would help. At least the one in the description doesn't fit.

comment:11 by anevilyak, 10 years ago

Sorry, for that particular binary/KDL combo the eip was 0x80074e09.

comment:12 by bonefish, 10 years ago

Status: newassigned

We can reproduce the problem on stippi's machine. Looking into it...

comment:13 by anevilyak, 10 years ago

Cool, please let me know if any other information from my machine would help :)

comment:14 by bonefish, 10 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev31973.

Note: See TracTickets for help on using tickets.