Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2013 12:57:08 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Chris Torek <torek@torek.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: boot time crash in if_detach_internal()
Message-ID:  <20130402085708.GI76816@FreeBSD.org>
In-Reply-To: <201304010945.r319jJw7027369@elf.torek.net>
References:  <201304010945.r319jJw7027369@elf.torek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 01, 2013 at 03:45:19AM -0600, Chris Torek wrote:
C> I have been poking about with the bhyve virtualization code in
C> FreeBSD 10-current, and managed to crash FreeBSD during its
C> bootstrap process due to the fact that if_detach is called
C> from boot time configuration code, before the internal domain
C> system initialization has happened.
C> 
C> I added the following patch to work around the problem.  As
C> the large comment notes, it might not be quite correct but it
C> does allow the boot to proceed (of course the "dead" network
C> device is soon a problem anyway...).
C> 
C> The fix mirrors (more or less) the code in if_attach_internal().
C> Feel free to accept, ignore, or modify the patch. :-)
C> 
C> Chris
C> 
C> diff --git a/sys/net/if.c b/sys/net/if.c
C> --- a/sys/net/if.c
C> +++ b/sys/net/if.c
C> @@ -845,6 +845,15 @@
C>  
C>  	if_purgeaddrs(ifp);
C>  
C> +	/*
C> +	 * torek: it's not entirely clear to me where and how this
C> +	 * should go, but if domain_init_status < 2 then there should
C> +	 * be no inet, inet6, etc items, and this is where the crash
C> +	 * happens during boot, so let's try this:
C> +	 */
C> +	if (domain_init_status < 2)
C> +		return;
C> +
C>  #ifdef INET
C>  	in_ifdetach(ifp);
C>  #endif

Can you provide a backtrace that leads to this?

-- 
Totus tuus, Glebius.



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