tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: memcpy of struct buf, or similar?



Simon Burge wrote:

> Simon Burge wrote:
> 
> > Chris Gilbert wrote:
> > 
> > > Simon Burge wrote:
> > > > Andrew Doran wrote:
> > > > 
> > > >> I am trying to fix PR 38761.  [ ... ]
> > > > 
> > > > FWIW, just sticking a
> > > > 
> > > >         KASSERT(mutex_owned(&bufcache_lock));
> > > > 
> > > > before each time b_cflags is modified fails to reach single user when it
> > > > hits genfs_getpages():
> > > > 
> > > > [ ... ]
> 
> All modifications of b_cflags are checked with the above
> KASSERT except kern/vfs_bio.c:nestiobuf_setup() and
> miscfs/genfs/genfs_io.c:genfs_getpages() and I've still ended
> up with one process in biowait, another in biolock and a bunch
> in tstile.

My last for the night...  With Andy's patched biowait()/biodone() and
the above KASSERTS, I fairly quickly got while doing a build:

panic: WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
kernel diagnostic assertion "cv_has_waiters(&bp->b_done)" failed: file 
"../../../../kern/vfs_bio.c", line 1553WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0

WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
fatal breakpoint trapWARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
 in supervisor mode
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
WARNING: SPL NOT LOWERED ON TRAP EXIT 6 0
trap type 1 code 0 rip ffffffff8050bde5 cs 8 rflags 246 cr2  7f7ffdae8020 cpl 3 
rsp ffff800064fc4bb0
Stopped in pid 0.4 (system) at  netbsd:breakpoint+0x5:  leave
db{0}> bt
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x260
__kernassert() at netbsd:__kernassert+0x2d
biodone2() at netbsd:biodone2+0x136
biointr() at netbsd:biointr+0x3c
softint_dispatch() at netbsd:softint_dispatch+0xd3
db{0}> mac cpu 1
using CPU 1
db{0}> bt       
__cpu_simple_lock() at netbsd:__cpu_simple_lock+0xc
db{0}> mac cpu 2
using CPU 2
db{0}> bt       
__cpu_simple_lock() at netbsd:__cpu_simple_lock+0x13
db{0}> mac cpu 3
using CPU 3
db{0}> bt       
x86_mwait() at netbsd:x86_mwait+0xd
idle_loop() at netbsd:idle_loop+0x176
Bad frame pointer: 0xffff80006463c420
db{0}> mac cpu 4
using CPU 4
db{0}> bt       
__cpu_simple_lock() at netbsd:__cpu_simple_lock+0x13
alltraps() at netbsd:alltraps+0x1a9
uiomove() at netbsd:uiomove+0x63
ubc_uiomove() at netbsd:ubc_uiomove+0xd2
ffs_read() at netbsd:ffs_read+0x410
VOP_READ() at netbsd:VOP_READ+0x66
vn_read() at netbsd:vn_read+0x9f
dofileread() at netbsd:dofileread+0x80
sys_read() at netbsd:sys_read+0x72
syscall() at netbsd:syscall+0x9a
db{0}> mac cpu 5
using CPU 5
db{0}> bt       
bus_space_read_stream_1() at netbsd:bus_space_read_stream_1+0xe
cnputc() at netbsd:cnputc+0x2a
putchar() at netbsd:putchar+0x139
kprintf() at netbsd:kprintf+0x3ea
printf() at netbsd:printf+0xcd
db{0}> mac cpu 6 
using CPU 6
db{0}> bt       
__cpu_simple_lock() at netbsd:__cpu_simple_lock+0x13
db{0}> mac cpu 7
using CPU 7
db{0}> bt       
__cpu_simple_lock() at netbsd:__cpu_simple_lock+0x13

Simon.

ps: Two unrelated things.  A "show all backtraces" command in ddb that
iterates over all CPUs might be useful!  If anyone knows how to teach
DDB in amd64 to show function arguments I'm all ears.


Home | Main Index | Thread Index | Old Index