Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2017 21:44:13 +0000 (UTC)
From:      Darren <darren780@yahoo.com>
To:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: r315684 panic: sleepq_add: td 0xfffff80003c01a40 to sleep on wchan 0xfffff80006f0873c with sleeping prohibited
Message-ID:  <1262380892.3757534.1490478253615@mail.yahoo.com>
In-Reply-To: <20170325033142.GA23308@FreeBSD.org>
References:  <1824572972.3096988.1490377215756.ref@mail.yahoo.com> <1824572972.3096988.1490377215756@mail.yahoo.com> <20170325010314.GG43712@kib.kiev.ua> <20170325033142.GA23308@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

So far I have not had a re-occurrence of the crash.  It has only been a couple hours so far, will update if it happens or not over the next couple days. Thanks!
-Darren

      
   
  Darren,

On Sat, Mar 25, 2017 at 03:03:14AM +0200, Konstantin Belousov wrote:
K> On Fri, Mar 24, 2017 at 05:40:15PM +0000, Darren wrote:
K> > I am getting this panic every hour to every couple of hours.
K> > 
K> > FreeBSD asrock 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r315684: Thu Mar 23 14:56:45 EDT 2017     darren@asrock:/usr/obj/usr/src/sys/GENERIC  amd64
K> > I manually typed out the following, apologize for any typos. 
K> > 
K> > 
K> > panic: sleepq_add: td 0xfffff80003c01a40 to sleep on wchan 0xfffff80006f0873c with sleeping prohibited
K> > cpuid = 0
K> > time = 1490372797
K> > KDB: stack backtrace:
K> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0072e33690
K> > vpanic() at vpanic+0x19c/frame 0xfffffe0072e33710
K> > kassert_panic() at kassert_panic+0x126/frame 0xfffffe0072e33780
K> > sleepq_add() at sleepq_add+0x34f/frame 0xfffffe0072337d0
K> > _sleep() at _sleep+0x28d/frame 0xfffffe0072e33870
K> > soclose() at soclose+0xda/frame 0xfffffe0072e338b0
K> > _fdrop() at _fdrop+0x1a/frame 0xfffffe0072e338d0
K> > sendfile_iodone() at sendfile_iodone+0x19d/frame 0xfffffe0072e33910
K> > vnode_pager_generic_getpages_done_async() at vnode_pager_generic_getpages_done_async+037/frame 0xfffffe0072e33930
K> > bufdone() at bufdone+0x64/frame 0xfffffe0072e33960
K> > g_io_deliver() at g_io_deliver+0x276/frame 0xfffffe0072e339b0
K> > g_io_deliver() at g_io_deliver+0x276/frame 0xfffffe0072e33a00
K> > g_disk_done() at g_disk_done+0x104/frame 0xfffffe0072e33a40
K> > xpt_done_process() at xpt_done_process+0x35f/frame 0xfffffe0072e33a80
K> > xpt_done_direct() at ahci_ch_intr_direct+0xd5/frame 0xfffffe0072e33af0
K> > ahci_itr() at ahci_intr+0x102/frame 0xfffffe0072e33b20
K> > intr_event_execute_handlers() at intr_event_execute_handlers+0x99/frame 0xfffffe0072e33b60
K> > ithread_loop() at ithread_loop+0xb6/frame 0xfffffe0072e33bb0
K> > fork_exit() at fork_exit+0x84/frame 0xfffffe0072e33bf0
K> > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0072e33bf0
K> > --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
K> > KDB: enter: panic
K> > [ thread pid 12 tid 100038 ]
K> > Stopped at      kdb_enter+0x3b: movq    $0,kdb_why
K> > db>
K> 
K> Indeed, the context where sendfile_iodone() is executed, cannot call fdrop().

Can you please test the attached patch?

-- 
Totus tuus, Glebius.


   
From owner-freebsd-current@freebsd.org  Sat Mar 25 22:28:09 2017
Return-Path: <owner-freebsd-current@freebsd.org>
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 54217D1D4A8
 for <freebsd-current@mailman.ysv.freebsd.org>;
 Sat, 25 Mar 2017 22:28:09 +0000 (UTC) (envelope-from null@pozo.com)
Received: from pozo.com (pozo.com [50.197.129.137])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "pozo.com", Issuer "pozo.com" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2B4C3D2F;
 Sat, 25 Mar 2017 22:28:09 +0000 (UTC) (envelope-from null@pozo.com)
Received: from octo.pozo.com (octo.pozo.com [192.168.0.2])
 (authenticated bits8)
 by pozo.com (8.15.2/8.15.2) with ESMTPA id v2PMLGh6044514;
 Sat, 25 Mar 2017 15:21:16 -0700 (PDT) (envelope-from null@pozo.com)
From: Manfred Antar <null@pozo.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Subject: New /head/sys/amd64/amd64/genassym.c breaks buildkernel amd64 current
Message-Id: <B9277145-868A-4493-B121-378B29F99B4A@pozo.com>
Date: Sat, 25 Mar 2017 15:21:15 -0700
Cc: avg@freebsd.org
To: FreeBSD Current <freebsd-current@freebsd.org>
X-Mailer: Apple Mail (2.3259)
X-Spam-Status: No, score=-92.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
 J_CHICKENPOX_22,J_CHICKENPOX_65,J_CHICKENPOX_66,RP_MATCHES_RCVD,TW_AV,TW_BJ,
 TW_GD, TW_JC, USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1,
 No
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on pozo.com
X-pozocom-MailScanner-Information: Please contact the ISP for more information
X-pozocom-MailScanner-ID: v2PMLGh6044514
X-pozocom-MailScanner: Found to be clean
X-pozocom-MailScanner-From: null@pozo.com
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 25 Mar 2017 22:28:09 -0000

Recent change to genassym.c breaks building a current kernel:

--------------------------------------------------------------
>>> stage 3.1: building everything
--------------------------------------------------------------
cd /usr/obj/usr/src/sys/pozo; COMPILER_VERSION=40000  COMPILER_TYPE=clang  COMPILER_FREEBSD_VERSION=1200006 MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin  GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC="/usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CXX="/usr/local/bin/ccache c++  -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin"  CPP="cpp -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size"  INSTALL="sh /usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make  -m /usr/src/share/mk  KERNEL=kernel all -DNO_MODULES_OBJ
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
/usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 /usr/src/sys/amd64/amd64/genassym.c
In file included from /usr/src/sys/amd64/amd64/genassym.c:47:
/usr/src/sys/sys/bus.h:730:10: fatal error: 'device_if.h' file not found
#include "device_if.h"
         ^~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/sys/pozo
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src


cd /usr/obj/usr/src/sys/pozo ; make device_if.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h

also bus_if.h is missing:
(pozo)5023}make
/usr/local/bin/ccache cc -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 /usr/src/sys/amd64/amd64/genassym.c
In file included from /usr/src/sys/amd64/amd64/genassym.c:47:
/usr/src/sys/sys/bus.h:731:10: fatal error: 'bus_if.h' file not found

so:
make bus_if.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
then the build works:

MAKE=make sh /usr/src/sys/conf/newvers.sh  pozo
--- vers.o ---
/usr/local/bin/ccache cc -c -O2 -pipe -fno-strict-aliasing  -g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999   vers.c
ctfconvert -L VERSION -g vers.o
--- kernel.full ---
linking kernel.full
ctfmerge -L VERSION -g -o kernel.full ...
     text     data       bss        dec        hex   filename
  8657083   805570   3350664   12813317   0xc38405   kernel.full
--- kernel.debug ---
objcopy --only-keep-debug kernel.full kernel.debug
--- kernel ---
objcopy --strip-debug --add-gnu-debuglink=kernel.debug  kernel.full kernel

somehow this needs to happen before genassym.c is compiled
this is a kernel without any modules

Manfred
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



help

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