From owner-freebsd-stable@freebsd.org Wed Oct 5 13:36:39 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77291AF5632 for ; Wed, 5 Oct 2016 13:36:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE5E2EE4 for ; Wed, 5 Oct 2016 13:36:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u95DaXsN094274 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 5 Oct 2016 16:36:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u95DaXsN094274 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u95DaXGH094273; Wed, 5 Oct 2016 16:36:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 5 Oct 2016 16:36:33 +0300 From: Konstantin Belousov To: Andy Farkas Cc: freebsd-stable@freebsd.org Subject: Re: Reproducible panic - Going nowhere without my init! Message-ID: <20161005133633.GH38409@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 13:36:39 -0000 On Wed, Oct 05, 2016 at 07:32:33PM +1000, Andy Farkas wrote: > On 05/10/2016 18:43, Konstantin Belousov wrote: > > > Apply the following patch. I am interested if anything additional appear > > on the console. Screenshot is good enough. > > Patch applied. Panic (easlily!) reproduced. No additional output. > > Screenshot: http://imgur.com/KOOBysH > > I guess init is dying before it gets there. No, init does not die in your case, since error code is zero, and the termination signal is absent. It must occur because init explicitely called _exit(0). Please try this variation, I want to see if the error code changed. diff --git a/sbin/init/init.c b/sbin/init/init.c index bda86b5..1e88964 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -884,8 +884,13 @@ single_user(void) if (Reboot) { /* Instead of going single user, let's reboot the machine */ sync(); - reboot(howto); - _exit(0); + if (reboot(howto) == -1) { + emergency("reboot(%#x) failed, %s", howto, + strerror(errno)); + _exit(1); /* panic and reboot */ + } + warning("reboot(%#x) returned", howto); + _exit(97); /* panic as well */ } shell = get_shell();