From owner-freebsd-current@freebsd.org Wed Mar 28 20:28:31 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 4B6C4F723CC for ; Wed, 28 Mar 2018 20:28:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF60C81477 for ; Wed, 28 Mar 2018 20:28:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id z143-v6so20677275itc.0 for ; Wed, 28 Mar 2018 13:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BVkLl7Zg0bh6uOpWPMi2jJD8f9vTwLTT2Hpvnz3NkIU=; b=nvZTC0HNSrPOWdLcbCWX9te1mfrqfefpwraQLk3KIFVtC2NCFy0XJh4+64V2fbLbq/ 9WC62OLS+smKI3GyjIv2KA2PKsakYwN5l/nrtLCxb1ZFcZtwDQb01P/0JZwpZIe2zUs0 sy7FtoKPr+C8yygNxlgVBMdReLkxN6f1aeDywOZQ9q+icvnQ+V6y96o3gBze9KDU8eE9 7ctB+p4MWx0MibwrGWHC9X+OuSb1FonvI9JGpV7tMj8bH65OUQTpj59xJPaVA96TDOJv GFJ/S9KQ93KAC6WZdsIFIBrnj4DKGfL+0tfoaQKTZu3/j2yQYYvQdSguc853uLZmKyHX 2TYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BVkLl7Zg0bh6uOpWPMi2jJD8f9vTwLTT2Hpvnz3NkIU=; b=h6n6F89rABA8y5CNtRDF0Lg3Ip/ZJHpp/T2/+tuGYwHY4XWq8Sk1j8LeI8TFjwJc3f nV/ZLoA7nBKKRswhK5wyNHdGmG8dZ52dseYanppSWo/urm2bJZ9jrqy8hiQpalDV4xHj Nk9OAacH5BWw8Hw7F/p05EuotsKf7f02wiaG1XsQS1aa+jRWn2tW4j0uG1OcGpPFywQo ftsUPt7R4nxl4w0R2jSpqiIqKs2BioNXHKEJ2Ir12rHryEhN3Vi8304jAxWe9uoQokhK CwfJYYhxYqNP1a0e7DqxoPBQ/1wCAV4ZWgBMlDAs/ADb0WXX95GOz9piqJVM3+h7E96z 8j3w== X-Gm-Message-State: AElRT7G8TfEmGRFqeT5/YDwx4z+BXmWvWUQa9HZ7m7rYdjRpM9o0fkkn 699aTZqY/M7bgeyPFvP2nHEvhHUqTVjbN4AdztBeiw== X-Google-Smtp-Source: AIpwx49BoktgrGkmhdUJWhPNF87+vOaFE/pzO4OIa80tzknXiMWKvRk1XQclK1Kfw4xs8hHQfXLZV99dh3lP2mU/u6s= X-Received: by 2002:a24:19c9:: with SMTP id b192-v6mr3840716itb.1.1522268909936; Wed, 28 Mar 2018 13:28:29 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 28 Mar 2018 13:28:29 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <79d2bd72-f8b2-6476-9589-ebad9716698f@freebsd.org> From: Warner Losh Date: Wed, 28 Mar 2018 13:28:29 -0700 X-Google-Sender-Auth: Qfw2nMVY7tHYPvgT1kEy_wzONNQ Message-ID: Subject: Re: Boot failure: panic: No heap setup To: Kyle Evans Cc: Stefan Esser , "" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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 20:28:31 -0000 On Wed, Mar 28, 2018 at 1:10 PM, Kyle Evans wrote: > On Tue, Mar 27, 2018 at 6:39 PM, Stefan Esser wrote: > > Am 27.03.18 um 21:31 schrieb Kyle Evans: > >> > >> On Tue, Mar 27, 2018 at 11:06 AM, Stefan Esser wrote: > >>> > >>> A few weeks ago I tried the LUA boot and found, that my kernel did not > >>> start > >>> (i.e. did not print the initial FreeBSD version line), but instead > >>> stopped > >>> with: > >> > >> > >> Oy =/ > >> > >>> panic: No heap setup > >>> > >>> I recovered by booting from an alternate boot device and kept my system > >>> running until today, where I decided to give the LUA boot another try. > >>> > >>> The boot failure happened again, with identical message: > >>> > >>> panic: No heap setup > >> > >> > >> Hmm... that's an sbrk panic [1], indicating that setheap hadn't been > >> called. zfsgptboot is zfsboot with gpt bits included, so the relevant > >> setheap call is [2] I believe. It's not immediately clear to me how > >> switching interpreters could actually be breaking it in this way. > >> > >> At what point are you hitting this panic? After menu, before kernel > >> transition? > > > > > > The menu is displayed and I can unload the kernel and load the kernel > > and modules from an alternate path. The lua code seems to work just fine, > > but as soon as I enter the "boot" command, the panic happens. > > > > This happens when the loader transfers control to the kernel but before > > any other output is generated. I tried booting a GENERIC kernel just to > > be sure this is not caused by an out-dated kernel config file. > > > >>> I tried booting a GENERIC kernel, but only rebuilding the boot loader > >>> (gptzfsloader in my case) without LUA support fixed the issue for me > ... > >>> > >>> The system is -CURRENT (built today) on amd64 (not converted to UEFI, > >>> yet). > > > > > > 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... Warner