From owner-freebsd-current@freebsd.org Sun Aug 9 06:47:15 2015 Return-Path: Delivered-To: freebsd-current@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 EE65D99DF78 for ; Sun, 9 Aug 2015 06:47:15 +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 5BB668A7 for ; Sun, 9 Aug 2015 06:47:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t796l44b033749 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 9 Aug 2015 09:47:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t796l44b033749 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t796l4b7033748; Sun, 9 Aug 2015 09:47:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Aug 2015 09:47:04 +0300 From: Konstantin Belousov To: Tim Kientzle Cc: FreeBSD Current Subject: Re: Consistent crash of BeagleBone kernel Message-ID: <20150809064704.GH2072@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.5.23 (2014-03-12) 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-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2015 06:47:16 -0000 On Sat, Aug 08, 2015 at 05:24:37PM -0700, Tim Kientzle wrote: > I???m seeing the following crash quite consistently on r286438. It looks like the recent work on the kernel linker locking still has some issues. > > Any suggested workarounds? > > Tim > > ==== log trace === > ... > Starting file system checks: > /dev/mmcsd0s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/mmcsd0s2a: clean, 7320851 free (179 frags, 915084 blocks, 0.0% fragmentation) > lock order reversal: > 1st 0xcd225040 bufwait (bufwait) @ /Users/tim/projects/crochet/src-head/sys/kern/vfs_bio.c:3191 > 2nd 0xc2e69400 dirhash (dirhash) @ /Users/tim/projects/crochet/src-head/sys/ufs/ufs/ufs_dirhash.c:281 > ??? usual stack trace omitted ... > Mounting local file systems:random: unblocking device. > . > ELF ldconfig path: /lib /usr/lib /usr/lib/compat > Setting hostname: beaglebone. > Setting up harvesting:[HIGH_PERFORMANCE],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED > Feeding entropy:. > lock order reversal: > 1st 0xc083ef40 kernel linker (kernel linker) @ /Users/tim/projects/crochet/src-head/sys/kern/kern_linker.c:1030 > 2nd 0xc2d63c94 ufs (ufs) @ /Users/tim/projects/crochet/src-head/sys/kern/vfs_lookup.c:529 > KDB: stack backtrace: > panic: _sx_xlock_hard: recursed on non-recursive sx kernel linker @ /Users/tim/projects/crochet/src-head/sys/kern/kern_linker.c:552 > > KDB: enter: panic > [ thread pid 168 tid 100079 ] > Stopped at $d.7: ldrb r15, [r15, r15, ror r15]! > db> bt > Tracing pid 168 tid 100079 td 0xc30db6a0 > panic: _sx_xlock_hard: recursed on non-recursive sx kernel linker @ /Users/tim/projects/crochet/src-head/sys/kern/kern_linker.c:552 Without a backtrace it is too much work to guess what is going on there. You could mark the kld_sx as recursive in kern_linker.c:linker_init(). Then either add a hack to kern_sx.c:sx_xlock_hard() to print the backtrace on the kld_sx recursion, or just hope that the LOR just before the panic is indicative. What is strange is that this is first report of the issue, the latest change to kern_linker.c was around a year ago.