From owner-freebsd-current@freebsd.org Wed Mar 28 22:06:54 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB98DF7641B for ; Wed, 28 Mar 2018 22:06:53 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 810AC84E46; Wed, 28 Mar 2018 22:06:53 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd17.aul.t-online.de (fwd17.aul.t-online.de [172.20.27.64]) by mailout04.t-online.de (Postfix) with SMTP id EBC6741AFF81; Thu, 29 Mar 2018 00:06:45 +0200 (CEST) Received: from Stefans-MBP-7.fritz.box (TWopYaZLQh1ZGG5OUc+bsb8UaovcKxCur7tELlGlgy0U-9YRvUGSnldsQo9AibPZqI@[87.151.209.250]) by fwd17.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1f1JDR-4faQJE0; Thu, 29 Mar 2018 00:06:45 +0200 Subject: Re: Boot failure: panic: No heap setup To: Warner Losh References: <79d2bd72-f8b2-6476-9589-ebad9716698f@freebsd.org> From: Stefan Esser Cc: Kyle Evans , FreeBSD Current Message-ID: Date: Thu, 29 Mar 2018 00:06:44 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ID: TWopYaZLQh1ZGG5OUc+bsb8UaovcKxCur7tELlGlgy0U-9YRvUGSnldsQo9AibPZqI X-TOI-MSGID: e5a01b17-ac65-42bb-9463-168dd46a1094 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2018 22:06:54 -0000 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 > > > > > > > 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 > > > > > > > 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@ 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