From owner-freebsd-stable@freebsd.org Mon Jul 24 17:36:59 2017 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 D4721CFF7AA for ; Mon, 24 Jul 2017 17:36:59 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C0AF770EDB; Mon, 24 Jul 2017 17:36:58 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id v6OHarkn050536 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2017 19:36:53 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: markj@FreeBSD.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id v6OHanHA074385; Tue, 25 Jul 2017 00:36:49 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: stable/11 debugging kernel unable to produce crashdump again To: Mark Johnston References: <587928B3.2050607@grosbein.net> <20170113193726.GC77535@wkstn-mjohnston.west.isilon.com> <587A0E12.7070205@grosbein.net> <59746BD5.5010301@grosbein.net> <20170724014445.GA20872@raichu> <59762849.5090208@grosbein.net> <20170724172232.GA71482@wkstn-mjohnston.west.isilon.com> Cc: FreeBSD Stable , Alexander Motin From: Eugene Grosbein Message-ID: <59763031.7000109@grosbein.net> Date: Tue, 25 Jul 2017 00:36:49 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20170724172232.GA71482@wkstn-mjohnston.west.isilon.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_96_Q, LOCAL_FROM autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 3.3 DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-Spam-Level: *** 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: Mon, 24 Jul 2017 17:36:59 -0000 On 25.07.2017 00:22, Mark Johnston wrote: > On Tue, Jul 25, 2017 at 12:03:05AM +0700, Eugene Grosbein wrote: >> Thanks, this helped: >> >> $ addr2line -f -e kernel.debug 0xffffffff80919c00 >> g_raid_shutdown_post_sync >> /home/src/sys/geom/raid/g_raid.c:2458 >> >> That is GEOM_RAID's g_raid_shutdown_post_sync() that hangs if called just before >> crashdump generation but works just fine during normal system shutdown. > > I think graid probably needs a treatment similar to r301173/r316032. > g_raid_shutdown_post_sync() appears to be quite similar to the > corresponding gmirror handler. In particular, it just attempts to mark > the individual components as clean and destroy the GEOM, which is not > really safe after a panic. > > diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c > index 7a1fd8c5ce2e..aa2529d5466a 100644 > --- a/sys/geom/raid/g_raid.c > +++ b/sys/geom/raid/g_raid.c > @@ -2461,6 +2461,9 @@ g_raid_shutdown_post_sync(void *arg, int howto) > struct g_raid_softc *sc; > struct g_raid_volume *vol; > > + if (panicstr != NULL) > + return; > + > mp = arg; > g_topology_lock(); > g_raid_shutdown = 1; > I'r rather leave this to Alexander. Funny thing is that it's not 100% hangs if I add some debugging printfs: more printfs added, more probability that it does not hang and proceeds to successfull crashdump generation. I use old "sc" console (not vt), if that matters.