From owner-freebsd-stable@freebsd.org Fri Oct 7 12:18:53 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 B981DAF502E for ; Fri, 7 Oct 2016 12:18:53 +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 3B0729A3 for ; Fri, 7 Oct 2016 12:18:53 +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 u97CImeT000691 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 7 Oct 2016 15:18:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u97CImeT000691 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u97CImAi000690; Fri, 7 Oct 2016 15:18:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 7 Oct 2016 15:18:48 +0300 From: Konstantin Belousov To: Andy Farkas Cc: freebsd-stable@freebsd.org Subject: Re: Reproducible panic - Going nowhere without my init! Message-ID: <20161007121848.GY38409@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: Fri, 07 Oct 2016 12:18:53 -0000 On Fri, Oct 07, 2016 at 08:32:24AM +1000, Andy Farkas wrote: > With your latest patch applied, I ran through my procedure more > than a dozen times and no panics! > > Any explanation why sleep(STALL_TIMEOUT) as apposed to a > bunch of sleep(1)'s tickles the panic? What happened was sleep() got interrupted by a signal. Normally reboot(8) stops init with SIGTSTP, then kill processes, then calls reboot(2). reboot(8) does not and cannot get acknowledges for the receipts of the signals by signalled processes, which indeed may result in the sleep interruption if other signal is delivered to init before SIGTSTP. Patch does not add 'just bunch of sleeps'. The code in the patch ensures that _exit() is called not earlier than STALL_TIMEOUT from the moment of detection of the shell exit, by reissuing sleep(). I changed the argument to 1 second to avoid situation where we e.g. sleep for 15 secs, get interrupt and then sleep for whole 30 secs. The overtime with sleep(1) is limited to 1 second. > > Also, it is definitely not sleeping for 30 seconds. I guess some > event interrupts the sleep loop?