Re: Boot failure: panic: No heap setup

From: Stefan Esser <se_at_freebsd.org>
Date: Thu, 29 Mar 2018 00:06:44 +0200
Am 28.03.18 um 22:28 schrieb Warner Losh:
>     > Hmmm, the code references point into the boot loader code - I had
>     > expected that there is a problem in the kernel, not the boot loader.
>     >
>     >> [1]
>     >> https://svnweb.freebsd.org/base/head/stand/libsa/sbrk.c?view=markup#l56
>     <https://svnweb.freebsd.org/base/head/stand/libsa/sbrk.c?view=markup#l56>
>     >
>     >
>     > Seems that setbase has either not been called or has been called with
>     > base=0.
> 
>     Right, which is odd...
> 
>     >> [2]
>     >> https://svnweb.freebsd.org/base/head/stand/i386/zfsboot/zfsboot.c?view=markup#l688
>     <https://svnweb.freebsd.org/base/head/stand/i386/zfsboot/zfsboot.c?view=markup#l688>
>     >
>     >
>     > I had thought, that the zfs boot code has been initialized before the
>     > menu is displayed?
> 
>     Right, all of this should be done looooong before we get to the
>     interpreter. Can you break into the loader prompt and try the `heap`
>     command, see what that outputs? CC'ing imp_at_ because he actually knows
>     things.
> 
> Totally weird. I'd add a printf to the sethead() function to display its args
> and see if you get this panic before/after that printf...

I'm currently using a Forth-enabled boot loader again, since this is a
"production" machine (my home server, which also receives and keeps all
my work email, for example).

I'll build a clean world with the LUA loader and test it on one of the
next days. Tests will include the "heap" loader command and I'll add the
printf (though, if sbrk() has really not been called, I guess that will
not go too well ...).

Is it possible, that the setheap function is called a second time, just
before jumping into the kernel? (In that case adding the printf might
crash the loader in the first setheap call ...)

Since the loader menu (and escaping from the menu) works, there must be
a valid heap, at that time.

Regards, STefan
Received on Wed Mar 28 2018 - 20:06:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:15 UTC