[haiku-gsoc] Re: [ARM port] Fixing KDL memory access fault when printing the backtrace

  • From: pulkomandy <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Tue, 12 Aug 2014 16:33:30 +0200

> > Additionally, debug_memcpy displays arch_start_kernel(which invokes
> > the kernel) and it's callers in the backtrace. Should those callers
> > also be displayed or should the backtrace stop at _start(kernel
> > entry)? If the ones before kernel entry needn't be displayed, then
> > debug_memcpy won't work in it's current state and would require some
> > fixing specifically for ARM. Ideally, I think modifying get_next_frame
> > to do something ARM specific would be the best solution; even not
> > invoking debug_memcpy is probably fine unless uniformity across all
> > archs needs to be maintained.

Either way is fine. Maybe the bootloader should setup a zeroed frame in
the kernel stack so the kernel stops there and doesn't try to analyze
bootloader functions?

> >
> > As a temporary workaround, I added a check in get_next_frame to ensure
> > that the difference between the pointer to the current frame and that
> > of the previous do not differ by greater than 0x100000, which seems to
> > work because I get a 'kdebug>" prompt.
> >
> 
> I suspect our exception handling is broken to start with, it was never
> tested for anything else then ARMv5. If that is the case, then the fault
> handler handling will be broken too. I suspect that's what you are seeing.
> 
>  Way to go to get the kdebug> prompt though, tried any KDL hangman yet? ;)

"kdebug>"  is the kernel debugger prompt. Besides playing kdlhangman,
you can use it to analyze various things (interrupts, semaphores,
threads, teams, etc.) Some help is available here:
https://www.haiku-os.org/documents/dev/welcome_to_kernel_debugging_land

Is the prompt reacting to input? If not, the next step is to make that
work. Once it does, we can try to understand why the kernel crashed and
fix the issue, and then it will crash a little further. And we continue
fixing issues until the userland (and bash) runs.

-- 
Adrien.

Other related posts: