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>

next in thread | previous in thread | raw e-mail | index | archive | help
So far I have not had a re-occurrence of the crash.=C2=A0 It has only been =
a couple hours so far, will update if it happens or not over the next coupl=
e days. Thanks!
-Darren

     =20
  =20
=C2=A0 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> >=20
K> > FreeBSD asrock 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r315684: Thu Mar 2=
3 14:56:45 EDT 2017=C2=A0=C2=A0=C2=A0=C2=A0 darren@asrock:/usr/obj/usr/src/=
sys/GENERIC=C2=A0 amd64
K> > I manually typed out the following, apologize for any typos.=20
K> >=20
K> >=20
K> > panic: sleepq_add: td 0xfffff80003c01a40 to sleep on wchan 0xfffff8000=
6f0873c with sleeping prohibited
K> > cpuid =3D 0
K> > time =3D 1490372797
K> > KDB: stack backtrace:
K> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00=
72e33690
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_getpa=
ges_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/fram=
e 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 =3D 0, rsp =3D 0, rbp =3D 0 ---
K> > KDB: enter: panic
K> > [ thread pid 12 tid 100038 ]
K> > Stopped at=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 kdb_enter+0x3b: movq=C2=A0=C2=
=A0=C2=A0 $0,kdb_why
K> > db>
K>=20
K> Indeed, the context where sendfile_iodone() is executed, cannot call fdr=
op().

Can you please test the attached patch?

--=20
Totus tuus, Glebius.


  =20
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 bits=128)
 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=3D40000  COMPILER_TYPE=3Dcla=
ng  COMPILER_FREEBSD_VERSION=3D1200006 MAKEOBJDIRPREFIX=3D/usr/obj  MACHINE=
_ARCH=3Damd64  MACHINE=3Damd64  CPUTYPE=3D GROFF_BIN_PATH=3D/usr/obj/usr/sr=
c/tmp/legacy/usr/bin  GROFF_FONT_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sha=
re/groff_font  GROFF_TMAC_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/tmac=
 CC=3D"/usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0 --sysroo=
t=3D/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CXX=3D"/usr/local/=
bin/ccache c++  -target x86_64-unknown-freebsd12.0 --sysroot=3D/usr/obj/usr=
/src/tmp -B/usr/obj/usr/src/tmp/usr/bin"  CPP=3D"cpp -target x86_64-unknown=
-freebsd12.0 --sysroot=3D/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bi=
n"  AS=3D"as" AR=3D"ar" LD=3D"ld" LLVM_LINK=3D""  NM=3Dnm OBJCOPY=3D"objcop=
y"  RANLIB=3Dranlib STRINGS=3D  SIZE=3D"size"  INSTALL=3D"sh /usr/src/tools=
/install.sh"  PATH=3D/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=3Dkernel 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=3D/us=
r/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -c -O2 -pipe -fno-strict-a=
liasing -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KE=
RNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-poi=
nter -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -=
mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchro=
nous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall=
 -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototype=
s -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf=
__=3D__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-pointe=
r-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member =
-mno-aes -mno-avx -std=3Diso9899: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_OPTIO=
N_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-fram=
e-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=3Dkernel -mno-re=
d-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffre=
estanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnes=
ted-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winli=
ne -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__=
 -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno=
-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-eq=
uality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-=
negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=
=3Diso9899: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=3Dmake 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_OPT=
ION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-f=
rame-pointer  -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-floa=
t  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector=
 -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wm=
issing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer=
-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnosti=
cs-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-er=
ror-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -=
Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-o=
f-packed-member  -mno-aes -mno-avx  -std=3Diso9899: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=3Dkernel.debug  kernel.full kernel

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

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




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