From owner-freebsd-stable@freebsd.org Fri Jan 13 19:31:08 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 38223CAE39F for ; Fri, 13 Jan 2017 19:31:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E67B7101E for ; Fri, 13 Jan 2017 19:31:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id l7so7414261qtd.3 for ; Fri, 13 Jan 2017 11:31:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LNWqIAUD3JHzlKYpT0suhZmcMqyqQKRINs69EQy6X5E=; b=MS1py9zVbeY5sJrYDLWkM2toUA6TR8CKChZiZZnxiBqFychewVBGDf81Au3wql9Vcq bYNpwDNmSUQ9jbEK2ppcziiVYbIC/yXKZbVmd0f/1FQ/w2ZNMHdNCWRzNzeFsvW6kYDe nsPN58GDYv9GZKWZ/kuPBhq8XkCYdqD0cA+MHG0X37BIrKFKD52EQHlu7ibuvGfoZuy6 djEq6qQoHE5UzfVdWao4KMyddkS2zIm/WWVJh6JzYMQRawu/YmyQVGG6Xth/3cufVreG 3niouHxcPIAuE0Uw7/VqSgJqzDhOyqtnCQ4H6VPPB+pVUPGHfE2WLF1fgdtPx7qmHqzf ikxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=LNWqIAUD3JHzlKYpT0suhZmcMqyqQKRINs69EQy6X5E=; b=i2KvCdt3qBRRt/d+PF78z5P7y1Xu9jaXlTUGhkDm8x47/t4T4O+/dkIhJTAIwkiLEc yadffFPsIiomw6u8CAQexVSwZMj23hNceyhc06HpQgFDYW66GNmuwxBwcGiX3wy8Az0j gp3jHbBEYt2b0g1bRaSD2W5rhlCtkEM6b6CG6l5ujtvJ/YFdjaMj9ucYRWDSpe6AZWOJ w7OopDq7bnDZreBGPhQZou5NjTB4NUpQB9triy/shL6EACjf8HhKqzfUyMQByPEjghT0 t+d3Gp6xQrN8/vywloiw0an94tUlm9QHMoqf6rE3jBqdUjCOIFfkPZWQX1CkYf7XEi5+ SEwQ== X-Gm-Message-State: AIkVDXLyc0W7ciCQCuwWpMl51Q4uqgmAkqAup75LXzfuY2ryPRV1o3DL1EPNa7HzdSz4JA== X-Received: by 10.237.52.199 with SMTP id x65mr18563923qtd.152.1484335867118; Fri, 13 Jan 2017 11:31:07 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id b16sm9888760qka.9.2017.01.13.11.31.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 11:31:06 -0800 (PST) Sender: Mark Johnston Date: Fri, 13 Jan 2017 11:37:26 -0800 From: Mark Johnston To: Eugene Grosbein Cc: FreeBSD Stable Subject: Re: stable/11 debugging kernel unable to produce crashdump Message-ID: <20170113193726.GC77535@wkstn-mjohnston.west.isilon.com> References: <587928B3.2050607@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <587928B3.2050607@grosbein.net> User-Agent: Mutt/1.7.2 (2016-11-26) 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, 13 Jan 2017 19:31:08 -0000 On Sat, Jan 14, 2017 at 02:21:23AM +0700, Eugene Grosbein wrote: > Hi! > > I'm struggling to debug a panic in 11.0-STABLE/i386 that successfully produces crashdump > but I want more information. So I've rebuilt my custom kernel to include > options INVARIANTS, WITNESS and DEADLKRES. Now any panic results in quick unclean reboot > without crashdump generation. Serial console shows: > > Script started on Sat Jan 14 02:03:16 2017 > Command: cu -l cuau0 -s 115200 > Connected > > root@gw:~ # sysctl debug.kdb.panic=1 > debug.kdb.panic:panic: kdb_sysctl_panic > KDB: stack backtrace: > db_trace_self_wrapper(e8bc2ae8,0,e8bc2ae8,e8bc2a48,c06b4af4,...) at 0xc04c457b = db_trace_self_wrapper+0x2b/frame 0xe8bc2a20 > vpanic(c0a4916e,e8bc2a54,e8bc2a54,e8bc2a5c,c06e881f,...) at 0xc06b4a7f = vpanic+0x6f/frame 0xe8bc2a34 > panic(c0a4916e,1,c0ae7e48,e8bc2a88,c06bfdd3,...) at 0xc06b4af4 = panic+0x14/frame 0xe8bc2a48 > kdb_sysctl_panic(c0ae7e48,0,0,0,e8bc2ae8) at 0xc06e881f = kdb_sysctl_panic+0x4f/frame 0xe8bc2a5c > sysctl_root_handler_locked(0,0,e8bc2ae8,e8bc2aa8) at 0xc06bfdd3 = sysctl_root_handler_locked+0x83/frame 0xe8bc2a88 > sysctl_root(0,e8bc2ae8) at 0xc06bf744 = sysctl_root+0x144/frame 0xe8bc2ad8 > userland_sysctl(c759f9c0,e8bc2b60,3,0,0,0,bfbfdc5c,4,e8bc2bc0,0) at 0xc06bfb9d = userland_sysctl+0x12d/frame 0xe8bc2b30 > sys___sysctl(c759f9c0,e8bc2c00) at 0xc06bfa32 = sys___sysctl+0x52/frame 0xe8bc2bd0 > syscall(e8bc2ce8) at 0xc0980801 = syscall+0x2a1/frame 0xe8bc2cdc > Xint0x80_syscall() at 0xc096e45e = Xint0x80_syscall+0x2e/frame 0xe8bc2cdc > --- syscall (202, FreeBSD ELF32, sys___sysctl), eip = 0x2818541b, esp = 0xbfbfdbc8, ebp = 0xbfbfdbf0 --- > Uptime: 4m36s > panic: malloc: called with spinlock or critical section held > Uptime: 4m36s > panic: _mtx_lock_sleep: recursed on non-recursive mutex CAM device lock @ /home/src/sys/cam/ata/ata_da.c:3382 I suspect that this is because we only stop the scheduler upon a panic if SMP is configured. Can you retest with the patch below applied? Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c (revision 312082) +++ sys/kern/kern_shutdown.c (working copy) @@ -713,6 +713,7 @@ CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); } +#endif /* * Ensure that the scheduler is stopped while panicking, even if panic @@ -719,7 +720,6 @@ * has been entered from kdb. */ td->td_stopsched = 1; -#endif bootopt = RB_AUTOBOOT; newpanic = 0;