Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Oct 2016 16:36:33 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Andy Farkas <chuzzwassa@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Reproducible panic - Going nowhere without my init!
Message-ID:  <20161005133633.GH38409@kib.kiev.ua>
In-Reply-To: <CAAJ1ec3XO790tQsGJO4=9KiLwOX_b4reioAqxXgtnD3dtsZjkw@mail.gmail.com>
References:  <CAAJ1ec3XO790tQsGJO4=9KiLwOX_b4reioAqxXgtnD3dtsZjkw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161005133633.GH38409>